spec/beaker/dsl/ezbake_utils_spec.rb in beaker-1.16.0 vs spec/beaker/dsl/ezbake_utils_spec.rb in beaker-1.17.0

- old
+ new

@@ -126,19 +126,19 @@ end RSpec.shared_examples "installs-ezbake-dependencies" do it "installs ezbake dependencies" do expect(subject).to receive(:install_package). - with( kind_of(FakeHost), anything(), anything()) + with( kind_of(Beaker::Host), anything(), anything()) subject.install_ezbake_deps host end end describe '#install_ezbake_deps' do let( :platform ) { Beaker::Platform.new('redhat-7-i386') } let(:host) do - FakeHost.new( :options => { 'platform' => platform }) + FakeHost.create('fakevm', platform.to_s) end before do allow(subject).to receive(:ezbake_tools_available?) { true } subject.initialize_ezbake_config @@ -162,28 +162,27 @@ end def install_from_ezbake_common_expects expect(subject).to receive(:`).with(/rake package:tar/).ordered expect(subject).to receive(:scp_to). - with( kind_of(FakeHost), anything(), anything()).ordered + with( kind_of(Beaker::Host), anything(), anything()).ordered expect(subject).to receive(:on). - with( kind_of(FakeHost), /tar -xzf/).ordered + with( kind_of(Beaker::Host), /tar -xzf/).ordered expect(subject).to receive(:on). - with( kind_of(FakeHost), /make -e install-#{EZBAKE_CONFIG_EXAMPLE[:real_name]}/).ordered + with( kind_of(Beaker::Host), /make -e install-#{EZBAKE_CONFIG_EXAMPLE[:real_name]}/).ordered end describe '#install_from_ezbake' do let( :platform ) { Beaker::Platform.new('redhat-7-i386') } let(:host) do - FakeHost.new( :options => { 'platform' => platform }) + FakeHost.create('fakevm', platform.to_s) end before do allow(subject).to receive(:ezbake_tools_available?) { true } end - context "for non *nix-like platforms" do let( :platform ) { Beaker::Platform.new('windows-7-i386') } it "raises an exception" do expect{ subject.install_from_ezbake host, "blah", "blah" @@ -210,11 +209,11 @@ expect(subject).to receive(:ezbake_stage) { Beaker::DSL::EZBakeUtils.config = EZBAKE_CONFIG_EXAMPLE }.ordered install_from_ezbake_common_expects expect(subject).to receive(:on). - with( kind_of(FakeHost), /install-rpm-sysv-init/).ordered + with( kind_of(Beaker::Host), /install-rpm-sysv-init/).ordered subject.install_from_ezbake host, "blah", "blah" end end @@ -226,10 +225,10 @@ end it "skips ezbake_stage" do install_from_ezbake_common_expects expect(subject).to receive(:on). - with( kind_of(FakeHost), /install-rpm-sysv-init/).ordered + with( kind_of(Beaker::Host), /install-rpm-sysv-init/).ordered subject.install_from_ezbake host, "blah", "blah" end end