diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2014-01-29 14:17:47 -0800 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2014-01-29 14:17:47 -0800 |
commit | b19b7d000887209f9d8dc1dc6aa468a0497a7391 (patch) | |
tree | 68d1eb6c136df20c2800f1dddb4e2c1ed5d75a42 /spec/unit/shell | |
parent | b5c9c6afdfd83fe3f1bf4c991daffeff94b49750 (diff) | |
download | chef-b19b7d000887209f9d8dc1dc6aa468a0497a7391.tar.gz |
s/stub!/stub/g
fix deprecation warnings
Diffstat (limited to 'spec/unit/shell')
-rw-r--r-- | spec/unit/shell/model_wrapper_spec.rb | 2 | ||||
-rw-r--r-- | spec/unit/shell/shell_ext_spec.rb | 22 | ||||
-rw-r--r-- | spec/unit/shell/shell_session_spec.rb | 12 |
3 files changed, 18 insertions, 18 deletions
diff --git a/spec/unit/shell/model_wrapper_spec.rb b/spec/unit/shell/model_wrapper_spec.rb index 35dc591edc..17e4227a75 100644 --- a/spec/unit/shell/model_wrapper_spec.rb +++ b/spec/unit/shell/model_wrapper_spec.rb @@ -72,7 +72,7 @@ describe Shell::ModelWrapper do # Creating a Chef::Search::Query object tries to read the private key... @searcher = mock("Chef::Search::Query #{__FILE__}:#{__LINE__}") - Chef::Search::Query.stub!(:new).and_return(@searcher) + Chef::Search::Query.stub(:new).and_return(@searcher) end it "falls back to listing the objects when the 'query' is :all" do diff --git a/spec/unit/shell/shell_ext_spec.rb b/spec/unit/shell/shell_ext_spec.rb index 22e9ae674b..4710fd9c4b 100644 --- a/spec/unit/shell/shell_ext_spec.rb +++ b/spec/unit/shell/shell_ext_spec.rb @@ -23,7 +23,7 @@ describe Shell::Extensions do before do @shell_client = TestableShellSession.instance - Shell.stub!(:session).and_return(@shell_client) + Shell.stub(:session).and_return(@shell_client) @job_manager = TestJobManager.new @root_context = Object.new @root_context.instance_eval(&ObjectTestHarness) @@ -37,7 +37,7 @@ describe Shell::Extensions do irb_context = mock("context", :main => target_context_obj) irb_session = mock("irb session", :context => irb_context) @job_manager.jobs = [[:thread, irb_session]] - @root_context.stub!(:jobs).and_return(@job_manager) + @root_context.stub(:jobs).and_return(@job_manager) @root_context.ensure_session_select_defined @root_context.jobs.select_shell_session(target_context_obj).should == irb_session @root_context.jobs.select_shell_session(:idontexist).should be_nil @@ -45,8 +45,8 @@ describe Shell::Extensions do it "finds, then switches to a session" do @job_manager.jobs = [] - @root_context.stub!(:ensure_session_select_defined) - @root_context.stub!(:jobs).and_return(@job_manager) + @root_context.stub(:ensure_session_select_defined) + @root_context.stub(:jobs).and_return(@job_manager) @job_manager.should_receive(:select_shell_session).and_return(:the_shell_session) @job_manager.should_receive(:switch).with(:the_shell_session) @root_context.find_or_create_session_for(:foo) @@ -54,8 +54,8 @@ describe Shell::Extensions do it "creates a new session if an existing one isn't found" do @job_manager.jobs = [] - @root_context.stub!(:jobs).and_return(@job_manager) - @job_manager.stub!(:select_shell_session).and_return(nil) + @root_context.stub(:jobs).and_return(@job_manager) + @job_manager.stub(:select_shell_session).and_return(nil) @root_context.should_receive(:irb).with(:foo) @root_context.find_or_create_session_for(:foo) end @@ -81,12 +81,12 @@ describe Shell::Extensions do it "turns irb tracing on and off" do @root_context.should respond_to(:trace) @root_context.conf.should_receive(:use_tracer=).with(true) - @root_context.stub!(:tracing?) + @root_context.stub(:tracing?) @root_context.tracing :on end it "says if tracing is on or off" do - @root_context.conf.stub!(:use_tracer).and_return(true) + @root_context.conf.stub(:use_tracer).and_return(true) @root_context.should_receive(:puts).with("tracing is on") @root_context.tracing? end @@ -111,14 +111,14 @@ describe Shell::Extensions do end it "says if echo is on or off" do - @root_context.conf.stub!(:echo).and_return(true) + @root_context.conf.stub(:echo).and_return(true) @root_context.should_receive(:puts).with("echo is on") @root_context.echo? end it "gives access to the stepable iterator" do - Shell::StandAloneSession.instance.stub!(:reset!) - Shell.session.stub!(:rebuild_context) + Shell::StandAloneSession.instance.stub(:reset!) + Shell.session.stub(:rebuild_context) events = Chef::EventDispatch::Dispatcher.new run_context = Chef::RunContext.new(Chef::Node.new, {}, events) run_context.resource_collection.instance_variable_set(:@iterator, :the_iterator) diff --git a/spec/unit/shell/shell_session_spec.rb b/spec/unit/shell/shell_session_spec.rb index a0fc3028f6..2ad24d05ce 100644 --- a/spec/unit/shell/shell_session_spec.rb +++ b/spec/unit/shell/shell_session_spec.rb @@ -87,8 +87,8 @@ describe Shell::StandAloneSession do end it "runs chef with the standalone recipe" do - @session.stub!(:node_built?).and_return(true) - Chef::Log.stub!(:level) + @session.stub(:node_built?).and_return(true) + Chef::Log.stub(:level) chef_runner = mock("Chef::Runner.new", :converge => :converged) # pre-heat resource collection cache @session.resource_collection @@ -116,7 +116,7 @@ describe Shell::SoloSession do end it "returns a collection based on it's compilation object and the extra recipe provided by chef-shell" do - @session.stub!(:node_built?).and_return(true) + @session.stub(:node_built?).and_return(true) kitteh = Chef::Resource::Cat.new("keyboard") @recipe.run_context.resource_collection << kitteh @session.resource_collection.should include(kitteh) @@ -133,7 +133,7 @@ describe Shell::SoloSession do end it "generates its resource collection from the compiled cookbooks and the ad hoc recipe" do - @session.stub!(:node_built?).and_return(true) + @session.stub(:node_built?).and_return(true) kitteh_cat = Chef::Resource::Cat.new("kitteh") @run_context.resource_collection << kitteh_cat keyboard_cat = Chef::Resource::Cat.new("keyboard_cat") @@ -143,8 +143,8 @@ describe Shell::SoloSession do end it "runs chef with a resource collection from the compiled cookbooks" do - @session.stub!(:node_built?).and_return(true) - Chef::Log.stub!(:level) + @session.stub(:node_built?).and_return(true) + Chef::Log.stub(:level) chef_runner = mock("Chef::Runner.new", :converge => :converged) Chef::Runner.should_receive(:new).with(an_instance_of(Chef::RunContext)).and_return(chef_runner) |