Sha256: 4183f90974d1d3b58f50225b191a3b2b451c670c2e2c30a4e3ee30d29b0975ed
Contents?: true
Size: 1.52 KB
Versions: 332
Compression:
Stored size: 1.52 KB
Contents
require 'spec_helper' describe Puppet::Type.type(:package).provider(:appdmg) do let(:resource) { Puppet::Type.type(:package).new(:name => 'foo', :provider => :appdmg) } let(:provider) { described_class.new(resource) } describe "when installing an appdmg" do let(:fake_mountpoint) { "/tmp/dmg.foo" } let(:fake_hdiutil_plist) { {"system-entities" => [{"mount-point" => fake_mountpoint}]} } before do fh = double('filehandle', path: '/tmp/foo') resource[:source] = "foo.dmg" allow(described_class).to receive(:open).and_yield(fh) allow(Dir).to receive(:mktmpdir).and_return("/tmp/testtmp123") allow(FileUtils).to receive(:remove_entry_secure) end describe "from a remote source" do let(:tmpdir) { "/tmp/good123" } before :each do resource[:source] = "http://fake.puppetlabs.com/foo.dmg" end it "should call tmpdir and use the returned directory" do expect(Dir).to receive(:mktmpdir).and_return(tmpdir) allow(Dir).to receive(:entries).and_return(["foo.app"]) expect(described_class).to receive(:curl) do |*args| expect(args[0]).to eq("-o") expect(args[1]).to include(tmpdir) expect(args).not_to include("-k") end allow(described_class).to receive(:hdiutil).and_return('a plist') expect(Puppet::Util::Plist).to receive(:parse_plist).with('a plist').and_return(fake_hdiutil_plist) expect(described_class).to receive(:installapp) provider.install end end end end
Version data entries
332 entries across 332 versions & 1 rubygems