spec/beaker/dsl/ezbake_utils_spec.rb in beaker-1.21.0 vs spec/beaker/dsl/ezbake_utils_spec.rb in beaker-2.0.0
- old
+ new
@@ -23,11 +23,11 @@
def wipe_out_ezbake_config
Beaker::DSL::EZBakeUtils.config = nil
end
def logger
- @logger ||= RSpec::Mocks::Mock.new('logger').as_null_object
+ @logger ||= RSpec::Mocks::Double.new('logger').as_null_object
end
end
module Beaker::DSL::EZBakeUtils::EZBake
Config = EZBAKE_CONFIG_EXAMPLE
@@ -105,11 +105,11 @@
allow(subject).to receive(:ezbake_tools_available?) { true }
subject.wipe_out_ezbake_config
end
it "initializes EZBakeUtils.config" do
- Dir.stub( :chdir ).and_yield()
+ allow( Dir ).to receive( :chdir ).and_yield()
allow(subject).to receive(:conditionally_clone) { true }
expect(subject).to receive(:`).with(/^lein.*/).ordered
expect(subject).to receive(:`).with("rake package:bootstrap").ordered
expect(subject).to receive(:load) { }.ordered
@@ -189,21 +189,21 @@
}.to raise_error(RuntimeError, /Beaker::DSL::EZBakeUtils unsupported platform:/)
end
end
it "raises an exception for unsupported *nix-like platforms" do
- Dir.stub( :chdir ).and_yield()
+ allow( Dir ).to receive( :chdir ).and_yield()
install_from_ezbake_common_expects
expect{
subject.install_from_ezbake host, "blah", "blah"
}.to raise_error(RuntimeError, /No ezbake installation step for/)
end
context "When Beaker::DSL::EZBakeUtils.config is nil" do
let( :platform ) { Beaker::Platform.new('el-7-i386') }
before do
- Dir.stub( :chdir ).and_yield()
+ allow( Dir ).to receive( :chdir ).and_yield()
subject.wipe_out_ezbake_config
end
it "runs ezbake_stage" do
expect(subject).to receive(:ezbake_stage) {
@@ -218,10 +218,10 @@
end
context "When Beaker::DSL::EZBakeUtils.config is a hash" do
let( :platform ) { Beaker::Platform.new('el-7-i386') }
before do
- Dir.stub( :chdir ).and_yield()
+ allow( Dir ).to receive( :chdir ).and_yield()
subject.initialize_ezbake_config
end
it "skips ezbake_stage" do
install_from_ezbake_common_expects