aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test/cask/container/dmg_spec.rb
blob: 4f3f57071060affe1e98f250f81ecd4bac20bae1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
describe Hbc::Container::Dmg, :cask do
  describe "#mount!" do
    it "does not store nil mounts for dmgs with extra data" do
      transmission = Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/local-transmission.rb")

      dmg = Hbc::Container::Dmg.new(
        transmission,
        Pathname(transmission.url.path),
        Hbc::SystemCommand,
      )

      dmg.mount do |mounts|
        begin
          expect(mounts).not_to include nil
        ensure
          mounts.each(&dmg.public_method(:eject))
        end
      end
    end
  end
end