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/support/shared | |
parent | b5c9c6afdfd83fe3f1bf4c991daffeff94b49750 (diff) | |
download | chef-b19b7d000887209f9d8dc1dc6aa468a0497a7391.tar.gz |
s/stub!/stub/g
fix deprecation warnings
Diffstat (limited to 'spec/support/shared')
3 files changed, 24 insertions, 24 deletions
diff --git a/spec/support/shared/functional/securable_resource.rb b/spec/support/shared/functional/securable_resource.rb index 3952b783dc..48daf78ae3 100644 --- a/spec/support/shared/functional/securable_resource.rb +++ b/spec/support/shared/functional/securable_resource.rb @@ -482,7 +482,7 @@ shared_examples_for "a securable resource without existing target" do it 'warns when mode tries to set owner bits but owner is not specified' do @warn = [] - Chef::Log.stub!(:warn) { |msg| @warn << msg } + Chef::Log.stub(:warn) { |msg| @warn << msg } resource.mode 0400 resource.run_action(:create) @@ -492,7 +492,7 @@ shared_examples_for "a securable resource without existing target" do it 'warns when mode tries to set group bits but group is not specified' do @warn = [] - Chef::Log.stub!(:warn) { |msg| @warn << msg } + Chef::Log.stub(:warn) { |msg| @warn << msg } resource.mode 0040 resource.run_action(:create) diff --git a/spec/support/shared/unit/api_error_inspector.rb b/spec/support/shared/unit/api_error_inspector.rb index 8231ceb195..b59fbce2c7 100644 --- a/spec/support/shared/unit/api_error_inspector.rb +++ b/spec/support/shared/unit/api_error_inspector.rb @@ -72,7 +72,7 @@ shared_examples_for "an api error inspector" do before do @response_body = "synchronize the clock on your host" @response = Net::HTTPUnauthorized.new("1.1", "401", "(response) unauthorized") - @response.stub!(:body).and_return(@response_body) + @response.stub(:body).and_return(@response_body) @exception = Net::HTTPServerException.new("(exception) unauthorized", @response) @inspector = described_class.new(@node_name, @exception, @config) @inspector.add_explanation(@description) @@ -88,7 +88,7 @@ shared_examples_for "an api error inspector" do before do @response_body = "check your key and node name" @response = Net::HTTPUnauthorized.new("1.1", "401", "(response) unauthorized") - @response.stub!(:body).and_return(@response_body) + @response.stub(:body).and_return(@response_body) @exception = Net::HTTPServerException.new("(exception) unauthorized", @response) @inspector = described_class.new(@node_name, @exception, @config) @inspector.add_explanation(@description) @@ -104,7 +104,7 @@ shared_examples_for "an api error inspector" do before do @response_body = "forbidden" @response = Net::HTTPForbidden.new("1.1", "403", "(response) forbidden") - @response.stub!(:body).and_return(@response_body) + @response.stub(:body).and_return(@response_body) @exception = Net::HTTPServerException.new("(exception) forbidden", @response) @inspector = described_class.new(@node_name, @exception, @config) @inspector.add_explanation(@description) @@ -120,7 +120,7 @@ shared_examples_for "an api error inspector" do before do @response_body = "didn't like your data" @response = Net::HTTPBadRequest.new("1.1", "400", "(response) bad request") - @response.stub!(:body).and_return(@response_body) + @response.stub(:body).and_return(@response_body) @exception = Net::HTTPServerException.new("(exception) bad request", @response) @inspector = described_class.new(@node_name, @exception, @config) @inspector.add_explanation(@description) @@ -136,7 +136,7 @@ shared_examples_for "an api error inspector" do before do @response_body = "probably caused by a redirect to a get" @response = Net::HTTPNotFound.new("1.1", "404", "(response) not found") - @response.stub!(:body).and_return(@response_body) + @response.stub(:body).and_return(@response_body) @exception = Net::HTTPServerException.new("(exception) not found", @response) @inspector = described_class.new(@node_name, @exception, @config) @inspector.add_explanation(@description) @@ -151,7 +151,7 @@ shared_examples_for "an api error inspector" do before do @response_body = "sad trombone" @response = Net::HTTPInternalServerError.new("1.1", "500", "(response) internal server error") - @response.stub!(:body).and_return(@response_body) + @response.stub(:body).and_return(@response_body) @exception = Net::HTTPFatalError.new("(exception) internal server error", @response) @inspector = described_class.new(@node_name, @exception, @config) @inspector.add_explanation(@description) @@ -166,7 +166,7 @@ shared_examples_for "an api error inspector" do before do @response_body = "sad trombone orchestra" @response = Net::HTTPBadGateway.new("1.1", "502", "(response) bad gateway") - @response.stub!(:body).and_return(@response_body) + @response.stub(:body).and_return(@response_body) @exception = Net::HTTPFatalError.new("(exception) bad gateway", @response) @inspector = described_class.new(@node_name, @exception, @config) @inspector.add_explanation(@description) diff --git a/spec/support/shared/unit/provider/useradd_based_user_provider.rb b/spec/support/shared/unit/provider/useradd_based_user_provider.rb index e9fe06dfd7..269372ab9b 100644 --- a/spec/support/shared/unit/provider/useradd_based_user_provider.rb +++ b/spec/support/shared/unit/provider/useradd_based_user_provider.rb @@ -57,21 +57,21 @@ shared_examples_for "a useradd-based user provider" do |supported_useradd_option end it "should set the option for #{attribute} if the new resources #{attribute} is not nil" do - @new_resource.stub!(attribute).and_return("hola") + @new_resource.stub(attribute).and_return("hola") provider.universal_options.should eql([option, 'hola']) end it "should set the option for #{attribute} if the new resources #{attribute} is not nil, without homedir management" do - @new_resource.stub!(:supports).and_return({:manage_home => false, + @new_resource.stub(:supports).and_return({:manage_home => false, :non_unique => false}) - @new_resource.stub!(attribute).and_return("hola") + @new_resource.stub(attribute).and_return("hola") provider.universal_options.should eql([option, 'hola']) end it "should set the option for #{attribute} if the new resources #{attribute} is not nil, without homedir management (using real attributes)" do - @new_resource.stub!(:manage_home).and_return(false) - @new_resource.stub!(:non_unique).and_return(false) - @new_resource.stub!(attribute).and_return("hola") + @new_resource.stub(:manage_home).and_return(false) + @new_resource.stub(:non_unique).and_return(false) + @new_resource.stub(attribute).and_return("hola") provider.universal_options.should eql([option, 'hola']) end end @@ -79,7 +79,7 @@ shared_examples_for "a useradd-based user provider" do |supported_useradd_option it "should combine all the possible options" do combined_opts = [] supported_useradd_options.sort{ |a,b| a[0] <=> b[0] }.each do |attribute, option| - @new_resource.stub!(attribute).and_return("hola") + @new_resource.stub(attribute).and_return("hola") combined_opts << option << 'hola' end provider.universal_options.should eql(combined_opts) @@ -99,8 +99,8 @@ shared_examples_for "a useradd-based user provider" do |supported_useradd_option describe "when the resource has a different home directory and supports home directory management" do before do - @new_resource.stub!(:home).and_return("/wowaweea") - @new_resource.stub!(:supports).and_return({:manage_home => true, + @new_resource.stub(:home).and_return("/wowaweea") + @new_resource.stub(:supports).and_return({:manage_home => true, :non_unique => false}) end @@ -112,9 +112,9 @@ shared_examples_for "a useradd-based user provider" do |supported_useradd_option describe "when the resource has a different home directory and supports home directory management (using real attributes)" do before do - @new_resource.stub!(:home).and_return("/wowaweea") - @new_resource.stub!(:manage_home).and_return(true) - @new_resource.stub!(:non_unique).and_return(false) + @new_resource.stub(:home).and_return("/wowaweea") + @new_resource.stub(:manage_home).and_return(true) + @new_resource.stub(:non_unique).and_return(false) end it "should set -m -d /homedir" do @@ -125,7 +125,7 @@ shared_examples_for "a useradd-based user provider" do |supported_useradd_option describe "when the resource supports non_unique ids" do before do - @new_resource.stub!(:supports).and_return({:manage_home => false, + @new_resource.stub(:supports).and_return({:manage_home => false, :non_unique => true}) end @@ -136,8 +136,8 @@ shared_examples_for "a useradd-based user provider" do |supported_useradd_option describe "when the resource supports non_unique ids (using real attributes)" do before do - @new_resource.stub!(:manage_home).and_return(false) - @new_resource.stub!(:non_unique).and_return(true) + @new_resource.stub(:manage_home).and_return(false) + @new_resource.stub(:non_unique).and_return(true) end it "should set -m -o" do |