summaryrefslogtreecommitdiff
path: root/spec/unit/application
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2014-01-29 14:17:47 -0800
committerLamont Granquist <lamont@scriptkiddie.org>2014-01-29 14:17:47 -0800
commitb19b7d000887209f9d8dc1dc6aa468a0497a7391 (patch)
tree68d1eb6c136df20c2800f1dddb4e2c1ed5d75a42 /spec/unit/application
parentb5c9c6afdfd83fe3f1bf4c991daffeff94b49750 (diff)
downloadchef-b19b7d000887209f9d8dc1dc6aa468a0497a7391.tar.gz
s/stub!/stub/g
fix deprecation warnings
Diffstat (limited to 'spec/unit/application')
-rw-r--r--spec/unit/application/apply.rb10
-rw-r--r--spec/unit/application/client_spec.rb12
-rw-r--r--spec/unit/application/knife_spec.rb6
-rw-r--r--spec/unit/application/solo_spec.rb24
4 files changed, 26 insertions, 26 deletions
diff --git a/spec/unit/application/apply.rb b/spec/unit/application/apply.rb
index 0dc24544b0..4ada2b521c 100644
--- a/spec/unit/application/apply.rb
+++ b/spec/unit/application/apply.rb
@@ -21,7 +21,7 @@ describe Chef::Application::Apply do
before do
@app = Chef::Application::Recipe.new
- @app.stub!(:configure_logging).and_return(true)
+ @app.stub(:configure_logging).and_return(true)
@recipe_text = "package 'nyancat'"
Chef::Config[:solo] = true
end
@@ -37,9 +37,9 @@ describe Chef::Application::Apply do
@recipe_file_name = "foo.rb"
@recipe_path = File.expand_path("foo.rb")
@recipe_file = mock("Tempfile (mock)", :read => @recipe_text)
- @app.stub!(:open).with(@recipe_path).and_return(@recipe_file)
- File.stub!(:exist?).with("foo.rb").and_return(true)
- Chef::Application.stub!(:fatal!).and_return(true)
+ @app.stub(:open).with(@recipe_path).and_return(@recipe_file)
+ File.stub(:exist?).with("foo.rb").and_return(true)
+ Chef::Application.stub(:fatal!).and_return(true)
end
it "should read text properly" do
@app.read_recipe_file(@recipe_file_name)[0].should == @recipe_text
@@ -49,7 +49,7 @@ describe Chef::Application::Apply do
end
describe "when recipe doesn't exist" do
before do
- File.stub!(:exist?).with(@recipe_file_name).and_return(false)
+ File.stub(:exist?).with(@recipe_file_name).and_return(false)
end
it "should raise a fatal" do
Chef::Application.should_receive(:fatal!)
diff --git a/spec/unit/application/client_spec.rb b/spec/unit/application/client_spec.rb
index 219a894cc6..f84932073f 100644
--- a/spec/unit/application/client_spec.rb
+++ b/spec/unit/application/client_spec.rb
@@ -23,9 +23,9 @@ describe Chef::Application::Client, "reconfigure" do
ARGV.clear
@app = Chef::Application::Client.new
- @app.stub!(:configure_opt_parser).and_return(true)
- @app.stub!(:configure_chef).and_return(true)
- @app.stub!(:configure_logging).and_return(true)
+ @app.stub(:configure_opt_parser).and_return(true)
+ @app.stub(:configure_chef).and_return(true)
+ @app.stub(:configure_logging).and_return(true)
@app.cli_arguments = []
Chef::Config[:interval] = 10
@@ -91,9 +91,9 @@ describe Chef::Application::Client, "setup_application" do
before do
@app = Chef::Application::Client.new
# this is all stuff the reconfigure method needs
- @app.stub!(:configure_opt_parser).and_return(true)
- @app.stub!(:configure_chef).and_return(true)
- @app.stub!(:configure_logging).and_return(true)
+ @app.stub(:configure_opt_parser).and_return(true)
+ @app.stub(:configure_chef).and_return(true)
+ @app.stub(:configure_logging).and_return(true)
end
it "should change privileges" do
diff --git a/spec/unit/application/knife_spec.rb b/spec/unit/application/knife_spec.rb
index 16f94c7786..e96be3e54f 100644
--- a/spec/unit/application/knife_spec.rb
+++ b/spec/unit/application/knife_spec.rb
@@ -35,8 +35,8 @@ describe Chef::Application::Knife do
before(:each) do
@knife = Chef::Application::Knife.new
- @knife.stub!(:puts)
- Chef::Knife.stub!(:list_commands)
+ @knife.stub(:puts)
+ Chef::Knife.stub(:list_commands)
end
it "should exit 1 and print the options if no arguments are given at all" do
@@ -76,7 +76,7 @@ describe Chef::Application::Knife do
describe "when given a path to the client key" do
it "expands a relative path relative to the CWD" do
relative_path = '.chef/client.pem'
- Dir.stub!(:pwd).and_return(CHEF_SPEC_DATA)
+ Dir.stub(:pwd).and_return(CHEF_SPEC_DATA)
with_argv(*%W{noop knife command -k #{relative_path}}) do
@knife.should_receive(:exit).with(0)
@knife.run
diff --git a/spec/unit/application/solo_spec.rb b/spec/unit/application/solo_spec.rb
index 41e0cf3b2b..cc32577218 100644
--- a/spec/unit/application/solo_spec.rb
+++ b/spec/unit/application/solo_spec.rb
@@ -20,9 +20,9 @@ require 'spec_helper'
describe Chef::Application::Solo do
before do
@app = Chef::Application::Solo.new
- @app.stub!(:configure_opt_parser).and_return(true)
- @app.stub!(:configure_chef).and_return(true)
- @app.stub!(:configure_logging).and_return(true)
+ @app.stub(:configure_opt_parser).and_return(true)
+ @app.stub(:configure_chef).and_return(true)
+ @app.stub(:configure_logging).and_return(true)
Chef::Config[:recipe_url] = false
Chef::Config[:json_attribs] = false
Chef::Config[:solo] = true
@@ -70,14 +70,14 @@ describe Chef::Application::Solo do
before do
Chef::Config[:cookbook_path] = "#{Dir.tmpdir}/chef-solo/cookbooks"
Chef::Config[:recipe_url] = "http://junglist.gen.nz/recipes.tgz"
- FileUtils.stub!(:mkdir_p).and_return(true)
+ FileUtils.stub(:mkdir_p).and_return(true)
@tarfile = StringIO.new("remote_tarball_content")
- @app.stub!(:open).with("http://junglist.gen.nz/recipes.tgz").and_yield(@tarfile)
+ @app.stub(:open).with("http://junglist.gen.nz/recipes.tgz").and_yield(@tarfile)
@target_file = StringIO.new
- File.stub!(:open).with("#{Dir.tmpdir}/chef-solo/recipes.tgz", "wb").and_yield(@target_file)
+ File.stub(:open).with("#{Dir.tmpdir}/chef-solo/recipes.tgz", "wb").and_yield(@target_file)
- Chef::Mixin::Command.stub!(:run_command).and_return(true)
+ Chef::Mixin::Command.stub(:run_command).and_return(true)
end
it "should create the recipes path based on the parent of the cookbook path" do
@@ -107,14 +107,14 @@ describe Chef::Application::Solo do
before do
Chef::Config[:solo] = true
- Chef::Daemon.stub!(:change_privilege)
+ Chef::Daemon.stub(:change_privilege)
@chef_client = mock("Chef::Client")
- Chef::Client.stub!(:new).and_return(@chef_client)
+ Chef::Client.stub(:new).and_return(@chef_client)
@app = Chef::Application::Solo.new
# this is all stuff the reconfigure method needs
- @app.stub!(:configure_opt_parser).and_return(true)
- @app.stub!(:configure_chef).and_return(true)
- @app.stub!(:configure_logging).and_return(true)
+ @app.stub(:configure_opt_parser).and_return(true)
+ @app.stub(:configure_chef).and_return(true)
+ @app.stub(:configure_logging).and_return(true)
end
it "should change privileges" do