spec/unit/command/shell_init_spec.rb in chef-dk-0.2.0 vs spec/unit/command/shell_init_spec.rb in chef-dk-0.2.1
- old
+ new
@@ -23,12 +23,12 @@
let(:stdout_io) { StringIO.new }
let(:stderr_io) { StringIO.new }
let(:command_instance) do
ChefDK::Command::ShellInit.new.tap do |c|
- c.stub(:stdout).and_return(stdout_io)
- c.stub(:stderr).and_return(stderr_io)
+ allow(c).to receive(:stdout).and_return(stdout_io)
+ allow(c).to receive(:stderr).and_return(stderr_io)
end
end
let(:argv) { ['bash'] }
@@ -55,11 +55,11 @@
let(:omnibus_bin_dir) { "/foo/bin" }
let(:omnibus_embedded_bin_dir) { "/foo/embedded/bin" }
before do
- command_instance.stub(:omnibus_embedded_bin_dir).and_return(omnibus_embedded_bin_dir)
- command_instance.stub(:omnibus_bin_dir).and_return(omnibus_bin_dir)
+ allow(command_instance).to receive(:omnibus_embedded_bin_dir).and_return(omnibus_embedded_bin_dir)
+ allow(command_instance).to receive(:omnibus_bin_dir).and_return(omnibus_bin_dir)
end
it "emits a script to add ChefDK's ruby to the shell environment" do
command_instance.run(argv)
expect(stdout_io.string).to eq(expected_environment_commands)