aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test/cask/container/dmg_spec.rb
blob: df99a6264a91d404da21b024fc58102f41486f07 (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(cask_path("local-transmission"))

      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