summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2014-01-29 18:42:40 -0800
committerLamont Granquist <lamont@scriptkiddie.org>2014-01-29 18:42:40 -0800
commite42e6fe2d0c971882451d27c986b9930de7d2ffe (patch)
treec52bf04ecf3d870298a05a30dfe05d2d3c8335d3 /spec
parent647d75df3caa7172754d9dfc2f9fe767aeb91857 (diff)
downloadchef-e42e6fe2d0c971882451d27c986b9930de7d2ffe.tar.gz
remove some more deprecation warnings
Diffstat (limited to 'spec')
-rw-r--r--spec/unit/application_spec.rb2
-rw-r--r--spec/unit/file_content_management/deploy/mv_unix_spec.rb2
-rw-r--r--spec/unit/knife/cookbook_site_download_spec.rb6
-rw-r--r--spec/unit/lwrp_spec.rb2
-rw-r--r--spec/unit/rest_spec.rb4
-rw-r--r--spec/unit/shell/shell_session_spec.rb2
6 files changed, 9 insertions, 9 deletions
diff --git a/spec/unit/application_spec.rb b/spec/unit/application_spec.rb
index cff887f631..6110a8a3c5 100644
--- a/spec/unit/application_spec.rb
+++ b/spec/unit/application_spec.rb
@@ -281,7 +281,7 @@ describe Chef::Application do
@app.config[:config_file] = "/tmp/non-existing-dir/file"
config_file_regexp = Regexp.new @app.config[:config_file]
Chef::Log.should_receive(:warn).at_least(:once).with(config_file_regexp).and_return(true)
- Chef::Log.should_receive(:warn).any_number_of_times.and_return(true)
+ Chef::Log.stub(:warn).and_return(true)
@app.configure_chef
end
end
diff --git a/spec/unit/file_content_management/deploy/mv_unix_spec.rb b/spec/unit/file_content_management/deploy/mv_unix_spec.rb
index 2be0abe7bb..0e8662b8ec 100644
--- a/spec/unit/file_content_management/deploy/mv_unix_spec.rb
+++ b/spec/unit/file_content_management/deploy/mv_unix_spec.rb
@@ -37,7 +37,7 @@ describe Chef::FileContentManagement::Deploy::MvUnix do
let(:target_file_mode) { 0644 }
let(:target_file_stat) do
- mock "File::Stat struct for target file",
+ double "File::Stat struct for target file",
:mode => target_file_mode,
:uid => target_file_uid,
:gid => target_file_gid
diff --git a/spec/unit/knife/cookbook_site_download_spec.rb b/spec/unit/knife/cookbook_site_download_spec.rb
index a3d43c5b4a..faf58f7bc7 100644
--- a/spec/unit/knife/cookbook_site_download_spec.rb
+++ b/spec/unit/knife/cookbook_site_download_spec.rb
@@ -24,7 +24,7 @@ describe Chef::Knife::CookbookSiteDownload do
before do
@knife = Chef::Knife::CookbookSiteDownload.new
@knife.name_args = ['apache2']
- @noauth_rest = mock 'no auth rest'
+ @noauth_rest = double('no auth rest')
@stdout = StringIO.new
@cookbook_api_url = 'http://cookbooks.opscode.com/api/v1/cookbooks'
@version = '1.0.2'
@@ -58,7 +58,7 @@ describe Chef::Knife::CookbookSiteDownload do
before do
@cookbook_data = { 'version' => @version,
'file' => "http://example.com/apache2_#{@version_us}.tgz" }
- @temp_file = stub :path => "/tmp/apache2_#{@version_us}.tgz"
+ @temp_file = double( :path => "/tmp/apache2_#{@version_us}.tgz" )
@file = File.join(Dir.pwd, "apache2-#{@version}.tar.gz")
@noauth_rest.should_receive(:sign_on_redirect=).with(false)
@@ -125,7 +125,7 @@ describe Chef::Knife::CookbookSiteDownload do
@version_us = @version.gsub '.', '_'
@cookbook_data = { 'version' => @version,
'file' => "http://example.com/apache2_#{@version_us}.tgz" }
- @temp_file = stub :path => "/tmp/apache2_#{@version_us}.tgz"
+ @temp_file = double(:path => "/tmp/apache2_#{@version_us}.tgz")
@file = File.join(Dir.pwd, "apache2-#{@version}.tar.gz")
@knife.name_args << @version
end
diff --git a/spec/unit/lwrp_spec.rb b/spec/unit/lwrp_spec.rb
index 9e56b9fe1c..0e0ea5dbb7 100644
--- a/spec/unit/lwrp_spec.rb
+++ b/spec/unit/lwrp_spec.rb
@@ -179,7 +179,7 @@ describe "LWRP" do
end
it "should create a method for each attribute" do
- new_resource = double("new resource", :null_object=>true)
+ new_resource = double("new resource").as_null_object
Chef::Provider::LwrpBuckPasser.new(nil, new_resource).methods.map{|m|m.to_sym}.should include(:action_pass_buck)
Chef::Provider::LwrpThumbTwiddler.new(nil, new_resource).methods.map{|m|m.to_sym}.should include(:action_twiddle_thumbs)
end
diff --git a/spec/unit/rest_spec.rb b/spec/unit/rest_spec.rb
index 86e447a66f..a53b4c9507 100644
--- a/spec/unit/rest_spec.rb
+++ b/spec/unit/rest_spec.rb
@@ -578,13 +578,13 @@ describe Chef::REST do
it "does not raise a divide by zero exception if the content's actual size is 0" do
http_response['Content-Length'] = "5"
http_response.stub(:read_body).and_yield('')
- expect { rest.streaming_request(url, {}) }.to_not raise_error(ZeroDivisionError)
+ expect { rest.streaming_request(url, {}) }.to raise_error(Chef::Exceptions::ContentLengthMismatch)
end
it "does not raise a divide by zero exception when the Content-Length is 0" do
http_response['Content-Length'] = "0"
http_response.stub(:read_body).and_yield("ninja")
- expect { rest.streaming_request(url, {}) }.to_not raise_error(ZeroDivisionError)
+ expect { rest.streaming_request(url, {}) }.to raise_error(Chef::Exceptions::ContentLengthMismatch)
end
it "it raises an exception when the download is truncated" do
diff --git a/spec/unit/shell/shell_session_spec.rb b/spec/unit/shell/shell_session_spec.rb
index d305ed0ec6..e5fc46e945 100644
--- a/spec/unit/shell/shell_session_spec.rb
+++ b/spec/unit/shell/shell_session_spec.rb
@@ -52,7 +52,7 @@ describe Shell::ClientSession do
@session = Shell::ClientSession.instance
@node = Chef::Node.build("foo")
@session.node = @node
- @session.instance_variable_set(:@client, stub(:sync_cookbooks => {}))
+ @session.instance_variable_set(:@client, double(:sync_cookbooks => {}))
@expansion = Chef::RunList::RunListExpansion.new(@node.chef_environment, [])
@node.run_list.should_receive(:expand).with(@node.chef_environment).and_return(@expansion)