diff options
Diffstat (limited to 'spec')
45 files changed, 216 insertions, 216 deletions
diff --git a/spec/functional/resource/registry_spec.rb b/spec/functional/resource/registry_spec.rb index b64989c141..455c31c283 100644 --- a/spec/functional/resource/registry_spec.rb +++ b/spec/functional/resource/registry_spec.rb @@ -547,7 +547,7 @@ describe Chef::Resource::RegistryKey, :windows_only do @new_resource.values([{:name=>"BriskWalk",:type=>:string,:data=>"is good for health"}]) @new_resource.recursive(false) @new_resource.run_action(:delete_key) - @new_resource.should_not raise_error(ArgumentError) + @new_resource.should_not raise_error end it "does nothing if the action is delete_key" do @new_resource.key(reg_parent + '\OpscodeWhyRun') diff --git a/spec/functional/run_lock_spec.rb b/spec/functional/run_lock_spec.rb index 51645c0ae3..3fe77ff7ff 100644 --- a/spec/functional/run_lock_spec.rb +++ b/spec/functional/run_lock_spec.rb @@ -163,7 +163,7 @@ describe Chef::RunLock do let!(:run_lock) { Chef::RunLock.new(lockfile) } it "creates the full path to the lockfile" do - lambda { run_lock.acquire }.should_not raise_error(Errno::ENOENT) + lambda { run_lock.acquire }.should_not raise_error File.should exist(lockfile) end diff --git a/spec/integration/solo/solo_spec.rb b/spec/integration/solo/solo_spec.rb index 94d279c726..cd4678f94d 100644 --- a/spec/integration/solo/solo_spec.rb +++ b/spec/integration/solo/solo_spec.rb @@ -79,7 +79,7 @@ EOM Process.waitpid(s1) Process.waitpid(s2) end - }.should_not raise_error(Timeout::Error) + }.should_not raise_error # Unfortunately file / directory helpers in integration tests # are implemented using before(:each) so we need to do all below diff --git a/spec/support/shared/unit/provider/file.rb b/spec/support/shared/unit/provider/file.rb index 1200b2a488..b37f0ae888 100644 --- a/spec/support/shared/unit/provider/file.rb +++ b/spec/support/shared/unit/provider/file.rb @@ -386,7 +386,7 @@ shared_examples_for Chef::Provider::File do it "does not raise an exception in why-run mode" do Chef::Config[:why_run] = true - lambda {provider.run_action(action)}.should_not raise_error(Chef::Exceptions::EnclosingDirectoryDoesNotExist) + lambda {provider.run_action(action)}.should_not raise_error Chef::Config[:why_run] = false end end @@ -635,7 +635,7 @@ shared_examples_for Chef::Provider::File do it "should not try to backup or delete the file, and should not be updated by last action" do provider.should_not_receive(:do_backup) File.should_not_receive(:delete) - lambda { provider.run_action(:delete) }.should_not raise_error() + lambda { provider.run_action(:delete) }.should_not raise_error resource.should_not be_updated_by_last_action end end 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 8043c0cd3b..a95d19d33c 100644 --- a/spec/support/shared/unit/provider/useradd_based_user_provider.rb +++ b/spec/support/shared/unit/provider/useradd_based_user_provider.rb @@ -315,7 +315,7 @@ shared_examples_for "a useradd-based user provider" do |supported_useradd_option and_return(passwd_s_status) rpm_status = double("Mixlib::ShellOut command", :exitstatus => 0, :stdout => "passwd-0.73-1\n", :stderr => "") provider.should_receive(:shell_out!).with("rpm -q passwd").and_return(rpm_status) - lambda { provider.check_lock }.should_not raise_error(Chef::Exceptions::User) + lambda { provider.check_lock }.should_not raise_error end it "should raise a Chef::Exceptions::User if passwd -S exits with 1 on #{os} and the passwd package is not version 0.73-1" do diff --git a/spec/unit/client_spec.rb b/spec/unit/client_spec.rb index 378f0cb7b6..6dc10c21b8 100644 --- a/spec/unit/client_spec.rb +++ b/spec/unit/client_spec.rb @@ -385,7 +385,7 @@ shared_examples_for Chef::Client do context "fatal admin check is configured" do it "should not raise an exception" do - @client.do_windows_admin_check.should_not raise_error(Chef::Exceptions::WindowsNotAdmin) + @client.do_windows_admin_check.should_not raise_error end end end @@ -402,7 +402,7 @@ shared_examples_for Chef::Client do context "fatal admin check is configured" do it "should raise an exception" do - @client.do_windows_admin_check.should_not raise_error(Chef::Exceptions::WindowsNotAdmin) + @client.do_windows_admin_check.should_not raise_error end end end diff --git a/spec/unit/cookbook/metadata_spec.rb b/spec/unit/cookbook/metadata_spec.rb index 9822146131..cba2aff5da 100644 --- a/spec/unit/cookbook/metadata_spec.rb +++ b/spec/unit/cookbook/metadata_spec.rb @@ -247,7 +247,7 @@ describe Chef::Cookbook::Metadata do it "should not accept anything but a string for display_name" do lambda { @meta.grouping("db/mysql/databases", :title => "foo") - }.should_not raise_error(ArgumentError) + }.should_not raise_error lambda { @meta.grouping("db/mysql/databases", :title => Hash.new) }.should raise_error(ArgumentError) @@ -256,7 +256,7 @@ describe Chef::Cookbook::Metadata do it "should not accept anything but a string for the description" do lambda { @meta.grouping("db/mysql/databases", :description => "foo") - }.should_not raise_error(ArgumentError) + }.should_not raise_error lambda { @meta.grouping("db/mysql/databases", :description => Hash.new) }.should raise_error(ArgumentError) @@ -281,7 +281,7 @@ describe Chef::Cookbook::Metadata do it "should not accept anything but a string for display_name" do lambda { @meta.attribute("db/mysql/databases", :display_name => "foo") - }.should_not raise_error(ArgumentError) + }.should_not raise_error lambda { @meta.attribute("db/mysql/databases", :display_name => Hash.new) }.should raise_error(ArgumentError) @@ -290,7 +290,7 @@ describe Chef::Cookbook::Metadata do it "should not accept anything but a string for the description" do lambda { @meta.attribute("db/mysql/databases", :description => "foo") - }.should_not raise_error(ArgumentError) + }.should_not raise_error lambda { @meta.attribute("db/mysql/databases", :description => Hash.new) }.should raise_error(ArgumentError) @@ -299,7 +299,7 @@ describe Chef::Cookbook::Metadata do it "should not accept anything but an array of strings for choice" do lambda { @meta.attribute("db/mysql/databases", :choice => ['dedicated', 'shared']) - }.should_not raise_error(ArgumentError) + }.should_not raise_error lambda { @meta.attribute("db/mysql/databases", :choice => [10, 'shared']) }.should raise_error(ArgumentError) @@ -316,10 +316,10 @@ describe Chef::Cookbook::Metadata do it "should let calculated be true or false" do lambda { @meta.attribute("db/mysql/databases", :calculated => true) - }.should_not raise_error(ArgumentError) + }.should_not raise_error lambda { @meta.attribute("db/mysql/databases", :calculated => false) - }.should_not raise_error(ArgumentError) + }.should_not raise_error lambda { @meta.attribute("db/mysql/databases", :calculated => Hash.new) }.should raise_error(ArgumentError) @@ -333,13 +333,13 @@ describe Chef::Cookbook::Metadata do it "accepts String for the attribute type" do lambda { @meta.attribute("db/mysql/databases", :type => "string") - }.should_not raise_error(ArgumentError) + }.should_not raise_error end it "accepts Array for the attribute type" do lambda { @meta.attribute("db/mysql/databases", :type => "array") - }.should_not raise_error(ArgumentError) + }.should_not raise_error lambda { @meta.attribute("db/mysql/databases", :type => Array.new) }.should raise_error(ArgumentError) @@ -348,38 +348,38 @@ describe Chef::Cookbook::Metadata do it "accepts symbol for the attribute type" do lambda { @meta.attribute("db/mysql/databases", :type => "symbol") - }.should_not raise_error(ArgumentError) + }.should_not raise_error end it "should let type be hash (backwards compatability only)" do lambda { @meta.attribute("db/mysql/databases", :type => "hash") - }.should_not raise_error(ArgumentError) + }.should_not raise_error end it "should let required be required, recommended or optional" do lambda { @meta.attribute("db/mysql/databases", :required => 'required') - }.should_not raise_error(ArgumentError) + }.should_not raise_error lambda { @meta.attribute("db/mysql/databases", :required => 'recommended') - }.should_not raise_error(ArgumentError) + }.should_not raise_error lambda { @meta.attribute("db/mysql/databases", :required => 'optional') - }.should_not raise_error(ArgumentError) + }.should_not raise_error end it "should convert required true to required" do lambda { @meta.attribute("db/mysql/databases", :required => true) - }.should_not raise_error(ArgumentError) + }.should_not raise_error #attrib = @meta.attributes["db/mysql/databases"][:required].should == "required" end it "should convert required false to optional" do lambda { @meta.attribute("db/mysql/databases", :required => false) - }.should_not raise_error(ArgumentError) + }.should_not raise_error #attrib = @meta.attributes["db/mysql/databases"][:required].should == "optional" end @@ -391,7 +391,7 @@ describe Chef::Cookbook::Metadata do it "should make sure recipes is an array" do lambda { @meta.attribute("db/mysql/databases", :recipes => []) - }.should_not raise_error(ArgumentError) + }.should_not raise_error lambda { @meta.attribute("db/mysql/databases", :required => Hash.new) }.should raise_error(ArgumentError) @@ -405,13 +405,13 @@ describe Chef::Cookbook::Metadata do it "should allow the default value to be a string, array, or hash" do lambda { @meta.attribute("db/mysql/databases", :default => []) - }.should_not raise_error(ArgumentError) + }.should_not raise_error lambda { @meta.attribute("db/mysql/databases", :default => {}) - }.should_not raise_error(ArgumentError) + }.should_not raise_error lambda { @meta.attribute("db/mysql/databases", :default => "alice in chains") - }.should_not raise_error(ArgumentError) + }.should_not raise_error lambda { @meta.attribute("db/mysql/databases", :required => :not_gonna_do_it) }.should raise_error(ArgumentError) @@ -441,14 +441,14 @@ describe Chef::Cookbook::Metadata do :default => "b" } @meta.attribute("db/mysql/databases", attrs) - }.should_not raise_error(ArgumentError) + }.should_not raise_error lambda { attrs = { :choice => [ "a", "b", "c", "d", "e"], :default => ["b", "d"] } @meta.attribute("db/mysql/databases", attrs) - }.should_not raise_error(ArgumentError) + }.should_not raise_error end it "should error if default is not a choice" do diff --git a/spec/unit/data_bag_item_spec.rb b/spec/unit/data_bag_item_spec.rb index 109cd76ef8..ead0dadfa2 100644 --- a/spec/unit/data_bag_item_spec.rb +++ b/spec/unit/data_bag_item_spec.rb @@ -67,15 +67,15 @@ describe Chef::DataBagItem do end it "should accept alphanum/-/_ for the id" do - lambda { @data_bag_item.raw_data = { "id" => "h1-_" } }.should_not raise_error(ArgumentError) + lambda { @data_bag_item.raw_data = { "id" => "h1-_" } }.should_not raise_error end it "should accept alphanum.alphanum for the id" do - lambda { @data_bag_item.raw_data = { "id" => "foo.bar" } }.should_not raise_error(ArgumentError) + lambda { @data_bag_item.raw_data = { "id" => "foo.bar" } }.should_not raise_error end it "should accept .alphanum for the id" do - lambda { @data_bag_item.raw_data = { "id" => ".bozo" } }.should_not raise_error(ArgumentError) + lambda { @data_bag_item.raw_data = { "id" => ".bozo" } }.should_not raise_error end it "should raise an exception if the id contains anything but alphanum/-/_" do diff --git a/spec/unit/file_content_management/deploy/mv_windows_spec.rb b/spec/unit/file_content_management/deploy/mv_windows_spec.rb index a4c814951d..7c2a2d7e71 100644 --- a/spec/unit/file_content_management/deploy/mv_windows_spec.rb +++ b/spec/unit/file_content_management/deploy/mv_windows_spec.rb @@ -51,11 +51,11 @@ describe Chef::FileContentManagement::Deploy::MvWindows do let(:staging_file_path) { "/tmp/random-dir/staging-file.tmp" } let(:target_file_security_object) do - mock "Securable Object for target file" + double "Securable Object for target file" end let(:updated_target_security_object) do - mock "Securable Object for target file after staging file deploy" + double "Securable Object for target file after staging file deploy" end before do @@ -83,13 +83,13 @@ describe Chef::FileContentManagement::Deploy::MvWindows do let(:original_target_file_group) { double("original target file group") } let(:target_file_security_descriptor) do - mock "security descriptor for target file", + double "security descriptor for target file", :group => original_target_file_group, :owner => original_target_file_owner end let(:updated_target_security_descriptor) do - mock "security descriptor for target file" + double "security descriptor for target file" end diff --git a/spec/unit/formatters/error_inspectors/resource_failure_inspector_spec.rb b/spec/unit/formatters/error_inspectors/resource_failure_inspector_spec.rb index 16e9c6584c..588e56ec6b 100644 --- a/spec/unit/formatters/error_inspectors/resource_failure_inspector_spec.rb +++ b/spec/unit/formatters/error_inspectors/resource_failure_inspector_spec.rb @@ -172,7 +172,7 @@ describe Chef::Formatters::ErrorInspectors::ResourceFailureInspector do end it "does not generate an error" do - lambda { @inspector.add_explanation(@description) }.should_not raise_error(TypeError) + lambda { @inspector.add_explanation(@description) }.should_not raise_error @description.display(@outputter) end end diff --git a/spec/unit/knife/cookbook_upload_spec.rb b/spec/unit/knife/cookbook_upload_spec.rb index e1fa5c975a..65331b3952 100644 --- a/spec/unit/knife/cookbook_upload_spec.rb +++ b/spec/unit/knife/cookbook_upload_spec.rb @@ -42,7 +42,7 @@ describe Chef::Knife::CookbookUpload do describe 'with --concurrency' do it 'should upload cookbooks with predefined concurrency' do - @cookbook_uploader = stub(:upload_cookbooks => nil) + @cookbook_uploader = double(:upload_cookbooks => nil) Chef::CookbookVersion.stub(:list_all_versions).and_return({}) @knife.config[:concurrency] = 3 @test_cookbook = Chef::CookbookVersion.new('test_cookbook') @@ -56,7 +56,7 @@ describe Chef::Knife::CookbookUpload do describe 'run' do before(:each) do - @cookbook_uploader = stub(:upload_cookbooks => nil) + @cookbook_uploader = double(:upload_cookbooks => nil) Chef::CookbookUploader.stub(:new => @cookbook_uploader) Chef::CookbookVersion.stub(:list_all_versions).and_return({}) end @@ -139,7 +139,7 @@ describe Chef::Knife::CookbookUpload do @knife.should_receive(:upload).exactly(3).times Timeout::timeout(5) do @knife.run - end.should_not raise_error(Timeout::Error) + end.should_not raise_error end end diff --git a/spec/unit/knife/core/ui_spec.rb b/spec/unit/knife/core/ui_spec.rb index d62fb0ffc9..e5147d7957 100644 --- a/spec/unit/knife/core/ui_spec.rb +++ b/spec/unit/knife/core/ui_spec.rb @@ -168,7 +168,7 @@ describe Chef::Knife::UI do it "should ignore Errno::EPIPE exceptions (CHEF-3516)" do @out.stub(:puts).and_raise(Errno::EPIPE) @err.stub(:puts).and_raise(Errno::EPIPE) - lambda {@ui.send(method, "hi")}.should_not raise_error(Errno::EPIPE) + lambda {@ui.send(method, "hi")}.should_not raise_error end it "should throw Errno::EPIPE exceptions with -VV (CHEF-3516)" do diff --git a/spec/unit/mixin/params_validate_spec.rb b/spec/unit/mixin/params_validate_spec.rb index 2947ebea4a..cc2fe198ca 100644 --- a/spec/unit/mixin/params_validate_spec.rb +++ b/spec/unit/mixin/params_validate_spec.rb @@ -32,7 +32,7 @@ describe Chef::Mixin::ParamsValidate do end it "should allow a hash and a hash as arguments to validate" do - lambda { @vo.validate({:one => "two"}, {}) }.should_not raise_error(ArgumentError) + lambda { @vo.validate({:one => "two"}, {}) }.should_not raise_error end it "should raise an argument error if validate is called incorrectly" do @@ -40,17 +40,17 @@ describe Chef::Mixin::ParamsValidate do end it "should require validation map keys to be symbols or strings" do - lambda { @vo.validate({:one => "two"}, { :one => true }) }.should_not raise_error(ArgumentError) - lambda { @vo.validate({:one => "two"}, { "one" => true }) }.should_not raise_error(ArgumentError) + lambda { @vo.validate({:one => "two"}, { :one => true }) }.should_not raise_error + lambda { @vo.validate({:one => "two"}, { "one" => true }) }.should_not raise_error lambda { @vo.validate({:one => "two"}, { Hash.new => true }) }.should raise_error(ArgumentError) end it "should allow options to be required with true" do - lambda { @vo.validate({:one => "two"}, { :one => true }) }.should_not raise_error(ArgumentError) + lambda { @vo.validate({:one => "two"}, { :one => true }) }.should_not raise_error end it "should allow options to be optional with false" do - lambda { @vo.validate({}, {:one => false})}.should_not raise_error(ArgumentError) + lambda { @vo.validate({}, {:one => false})}.should_not raise_error end it "should allow you to check what kind_of? thing an argument is with kind_of" do @@ -63,7 +63,7 @@ describe Chef::Mixin::ParamsValidate do } } ) - }.should_not raise_error(ArgumentError) + }.should_not raise_error lambda { @vo.validate( @@ -87,7 +87,7 @@ describe Chef::Mixin::ParamsValidate do } } ) - }.should_not raise_error(ArgumentError) + }.should_not raise_error lambda { @vo.validate( @@ -109,7 +109,7 @@ describe Chef::Mixin::ParamsValidate do } } ) - }.should_not raise_error(ArgumentError) + }.should_not raise_error end it "should allow you to specify whether an object has a method with respond_to" do @@ -122,7 +122,7 @@ describe Chef::Mixin::ParamsValidate do } } ) - }.should_not raise_error(ArgumentError) + }.should_not raise_error lambda { @vo.validate( @@ -146,7 +146,7 @@ describe Chef::Mixin::ParamsValidate do } } ) - }.should_not raise_error(ArgumentError) + }.should_not raise_error lambda { @vo.validate( @@ -180,7 +180,7 @@ describe Chef::Mixin::ParamsValidate do } } ) - }.should_not raise_error(ArgumentError) + }.should_not raise_error lambda { @vo.validate( @@ -208,7 +208,7 @@ describe Chef::Mixin::ParamsValidate do } } ) - }.should_not raise_error(ArgumentError) + }.should_not raise_error lambda { @vo.validate( @@ -250,7 +250,7 @@ describe Chef::Mixin::ParamsValidate do :three => { :default => "neato mosquito" } } ) - }.should_not raise_error(ArgumentError) + }.should_not raise_error args[:three].should == "neato mosquito" lambda { @vo.validate( @@ -292,7 +292,7 @@ describe Chef::Mixin::ParamsValidate do it "should accept keys that are strings in the options" do lambda { @vo.validate({ "one" => "two" }, { :one => { :regex => /^two$/ }}) - }.should_not raise_error(ArgumentError) + }.should_not raise_error end it "should allow an array to kind_of" do @@ -305,7 +305,7 @@ describe Chef::Mixin::ParamsValidate do } } ) - }.should_not raise_error(ArgumentError) + }.should_not raise_error lambda { @vo.validate( {:one => ["string"]}, @@ -315,7 +315,7 @@ describe Chef::Mixin::ParamsValidate do } } ) - }.should_not raise_error(ArgumentError) + }.should_not raise_error lambda { @vo.validate( {:one => Hash.new}, @@ -360,7 +360,7 @@ describe Chef::Mixin::ParamsValidate do it "should not raise an error when argument is nil and required is false" do lambda { @vo.set_or_return(:test, nil, { :required => false }) - }.should_not raise_error(ArgumentError) + }.should_not raise_error end it "should set and return @name, then return @name for foo when argument is nil" do diff --git a/spec/unit/mixin/securable_spec.rb b/spec/unit/mixin/securable_spec.rb index 0a2dba1ead..89916e0039 100644 --- a/spec/unit/mixin/securable_spec.rb +++ b/spec/unit/mixin/securable_spec.rb @@ -28,14 +28,14 @@ describe Chef::Mixin::Securable do end it "should accept a group name or id for group" do - lambda { @securable.group "root" }.should_not raise_error(ArgumentError) - lambda { @securable.group 123 }.should_not raise_error(ArgumentError) + lambda { @securable.group "root" }.should_not raise_error + lambda { @securable.group 123 }.should_not raise_error lambda { @securable.group "+bad:group" }.should raise_error(ArgumentError) end it "should accept a user name or id for owner" do - lambda { @securable.owner "root" }.should_not raise_error(ArgumentError) - lambda { @securable.owner 123 }.should_not raise_error(ArgumentError) + lambda { @securable.owner "root" }.should_not raise_error + lambda { @securable.owner 123 }.should_not raise_error lambda { @securable.owner "+bad:owner" }.should raise_error(ArgumentError) end @@ -55,30 +55,30 @@ describe Chef::Mixin::Securable do end it "should accept group/owner names with spaces and backslashes" do - lambda { @securable.group 'test\ group' }.should_not raise_error(ArgumentError) - lambda { @securable.owner 'test\ group' }.should_not raise_error(ArgumentError) + lambda { @securable.group 'test\ group' }.should_not raise_error + lambda { @securable.owner 'test\ group' }.should_not raise_error end it "should accept group/owner names that are a single character or digit" do - lambda { @securable.group 'v' }.should_not raise_error(ArgumentError) - lambda { @securable.group '1' }.should_not raise_error(ArgumentError) - lambda { @securable.owner 'v' }.should_not raise_error(ArgumentError) - lambda { @securable.owner '1' }.should_not raise_error(ArgumentError) + lambda { @securable.group 'v' }.should_not raise_error + lambda { @securable.group '1' }.should_not raise_error + lambda { @securable.owner 'v' }.should_not raise_error + lambda { @securable.owner '1' }.should_not raise_error end it "should not accept group/owner names starting with '-', '+', or '~'" do lambda { @securable.group '-test' }.should raise_error(ArgumentError) lambda { @securable.group '+test' }.should raise_error(ArgumentError) lambda { @securable.group '~test' }.should raise_error(ArgumentError) - lambda { @securable.group 'te-st' }.should_not raise_error(ArgumentError) - lambda { @securable.group 'te+st' }.should_not raise_error(ArgumentError) - lambda { @securable.group 'te~st' }.should_not raise_error(ArgumentError) + lambda { @securable.group 'te-st' }.should_not raise_error + lambda { @securable.group 'te+st' }.should_not raise_error + lambda { @securable.group 'te~st' }.should_not raise_error lambda { @securable.owner '-test' }.should raise_error(ArgumentError) lambda { @securable.owner '+test' }.should raise_error(ArgumentError) lambda { @securable.owner '~test' }.should raise_error(ArgumentError) - lambda { @securable.owner 'te-st' }.should_not raise_error(ArgumentError) - lambda { @securable.owner 'te+st' }.should_not raise_error(ArgumentError) - lambda { @securable.owner 'te~st' }.should_not raise_error(ArgumentError) + lambda { @securable.owner 'te-st' }.should_not raise_error + lambda { @securable.owner 'te+st' }.should_not raise_error + lambda { @securable.owner 'te~st' }.should_not raise_error end it "should not accept group/owner names containing ':', ',' or non-space whitespace" do @@ -109,11 +109,11 @@ describe Chef::Mixin::Securable do end it "should accept Active Directory-style domain names pulled in via LDAP (on unix hosts)" do - lambda { @securable.owner "domain\@user" }.should_not raise_error(ArgumentError) - lambda { @securable.owner "domain\\user" }.should_not raise_error(ArgumentError) - lambda { @securable.group "domain\@group" }.should_not raise_error(ArgumentError) - lambda { @securable.group "domain\\group" }.should_not raise_error(ArgumentError) - lambda { @securable.group "domain\\group^name" }.should_not raise_error(ArgumentError) + lambda { @securable.owner "domain\@user" }.should_not raise_error + lambda { @securable.owner "domain\\user" }.should_not raise_error + lambda { @securable.group "domain\@group" }.should_not raise_error + lambda { @securable.group "domain\\group" }.should_not raise_error + lambda { @securable.group "domain\\group^name" }.should_not raise_error end it "should not accept group/owner names containing embedded carriage returns" do @@ -125,22 +125,22 @@ describe Chef::Mixin::Securable do end it "should accept group/owner names in UTF-8" do - lambda { @securable.group 'tëst' }.should_not raise_error(ArgumentError) - lambda { @securable.group 'ë' }.should_not raise_error(ArgumentError) - lambda { @securable.owner 'tëst' }.should_not raise_error(ArgumentError) - lambda { @securable.owner 'ë' }.should_not raise_error(ArgumentError) + lambda { @securable.group 'tëst' }.should_not raise_error + lambda { @securable.group 'ë' }.should_not raise_error + lambda { @securable.owner 'tëst' }.should_not raise_error + lambda { @securable.owner 'ë' }.should_not raise_error end it "should accept a unix file mode in string form as an octal number" do - lambda { @securable.mode "0" }.should_not raise_error(ArgumentError) - lambda { @securable.mode "0000" }.should_not raise_error(ArgumentError) - lambda { @securable.mode "0111" }.should_not raise_error(ArgumentError) - lambda { @securable.mode "0444" }.should_not raise_error(ArgumentError) + lambda { @securable.mode "0" }.should_not raise_error + lambda { @securable.mode "0000" }.should_not raise_error + lambda { @securable.mode "0111" }.should_not raise_error + lambda { @securable.mode "0444" }.should_not raise_error - lambda { @securable.mode "111" }.should_not raise_error(ArgumentError) - lambda { @securable.mode "444" }.should_not raise_error(ArgumentError) - lambda { @securable.mode "7777" }.should_not raise_error(ArgumentError) - lambda { @securable.mode "07777" }.should_not raise_error(ArgumentError) + lambda { @securable.mode "111" }.should_not raise_error + lambda { @securable.mode "444" }.should_not raise_error + lambda { @securable.mode "7777" }.should_not raise_error + lambda { @securable.mode "07777" }.should_not raise_error lambda { @securable.mode "-01" }.should raise_error(ArgumentError) lambda { @securable.mode "010000" }.should raise_error(ArgumentError) @@ -156,17 +156,17 @@ describe Chef::Mixin::Securable do end it "should accept a unix file mode in numeric form as a ruby-interpreted integer" do - lambda { @securable.mode 0 }.should_not raise_error(ArgumentError) - lambda { @securable.mode 0000 }.should_not raise_error(ArgumentError) - lambda { @securable.mode 444 }.should_not raise_error(ArgumentError) - lambda { @securable.mode 0444 }.should_not raise_error(ArgumentError) - lambda { @securable.mode 07777 }.should_not raise_error(ArgumentError) + lambda { @securable.mode 0 }.should_not raise_error + lambda { @securable.mode 0000 }.should_not raise_error + lambda { @securable.mode 444 }.should_not raise_error + lambda { @securable.mode 0444 }.should_not raise_error + lambda { @securable.mode 07777 }.should_not raise_error - lambda { @securable.mode 292 }.should_not raise_error(ArgumentError) - lambda { @securable.mode 4095 }.should_not raise_error(ArgumentError) + lambda { @securable.mode 292 }.should_not raise_error + lambda { @securable.mode 4095 }.should_not raise_error - lambda { @securable.mode 0111 }.should_not raise_error(ArgumentError) - lambda { @securable.mode 73 }.should_not raise_error(ArgumentError) + lambda { @securable.mode 0111 }.should_not raise_error + lambda { @securable.mode 73 }.should_not raise_error lambda { @securable.mode -01 }.should raise_error(ArgumentError) lambda { @securable.mode 010000 }.should raise_error(ArgumentError) @@ -193,13 +193,13 @@ describe Chef::Mixin::Securable do end it "should accept a unix file mode in string form as an octal number" do - lambda { @securable.mode "0" }.should_not raise_error(ArgumentError) - lambda { @securable.mode "0000" }.should_not raise_error(ArgumentError) - lambda { @securable.mode "0111" }.should_not raise_error(ArgumentError) - lambda { @securable.mode "0444" }.should_not raise_error(ArgumentError) + lambda { @securable.mode "0" }.should_not raise_error + lambda { @securable.mode "0000" }.should_not raise_error + lambda { @securable.mode "0111" }.should_not raise_error + lambda { @securable.mode "0444" }.should_not raise_error - lambda { @securable.mode "111" }.should_not raise_error(ArgumentError) - lambda { @securable.mode "444" }.should_not raise_error(ArgumentError) + lambda { @securable.mode "111" }.should_not raise_error + lambda { @securable.mode "444" }.should_not raise_error lambda { @securable.mode "7777" }.should raise_error(ArgumentError) lambda { @securable.mode "07777" }.should raise_error(ArgumentError) @@ -217,17 +217,17 @@ describe Chef::Mixin::Securable do end it "should accept a unix file mode in numeric form as a ruby-interpreted integer" do - lambda { @securable.mode 0 }.should_not raise_error(ArgumentError) - lambda { @securable.mode 0000 }.should_not raise_error(ArgumentError) - lambda { @securable.mode 444 }.should_not raise_error(ArgumentError) - lambda { @securable.mode 0444 }.should_not raise_error(ArgumentError) + lambda { @securable.mode 0 }.should_not raise_error + lambda { @securable.mode 0000 }.should_not raise_error + lambda { @securable.mode 444 }.should_not raise_error + lambda { @securable.mode 0444 }.should_not raise_error lambda { @securable.mode 07777 }.should raise_error(ArgumentError) - lambda { @securable.mode 292 }.should_not raise_error(ArgumentError) + lambda { @securable.mode 292 }.should_not raise_error lambda { @securable.mode 4095 }.should raise_error(ArgumentError) - lambda { @securable.mode 0111 }.should_not raise_error(ArgumentError) - lambda { @securable.mode 73 }.should_not raise_error(ArgumentError) + lambda { @securable.mode 0111 }.should_not raise_error + lambda { @securable.mode 73 }.should_not raise_error lambda { @securable.mode -01 }.should raise_error(ArgumentError) lambda { @securable.mode 010000 }.should raise_error(ArgumentError) @@ -236,46 +236,46 @@ describe Chef::Mixin::Securable do end it "should allow you to specify :full_control, :modify, :read_execute, :read, and :write rights" do - lambda { @securable.rights :full_control, "The Dude" }.should_not raise_error(ArgumentError) - lambda { @securable.rights :modify, "The Dude" }.should_not raise_error(ArgumentError) - lambda { @securable.rights :read_execute, "The Dude" }.should_not raise_error(ArgumentError) - lambda { @securable.rights :read, "The Dude" }.should_not raise_error(ArgumentError) - lambda { @securable.rights :write, "The Dude" }.should_not raise_error(ArgumentError) + lambda { @securable.rights :full_control, "The Dude" }.should_not raise_error + lambda { @securable.rights :modify, "The Dude" }.should_not raise_error + lambda { @securable.rights :read_execute, "The Dude" }.should_not raise_error + lambda { @securable.rights :read, "The Dude" }.should_not raise_error + lambda { @securable.rights :write, "The Dude" }.should_not raise_error lambda { @securable.rights :to_party, "The Dude" }.should raise_error(ArgumentError) end it "should allow you to specify :full_control, :modify, :read_execute, :read, and :write deny_rights" do - lambda { @securable.deny_rights :full_control, "The Dude" }.should_not raise_error(ArgumentError) - lambda { @securable.deny_rights :modify, "The Dude" }.should_not raise_error(ArgumentError) - lambda { @securable.deny_rights :read_execute, "The Dude" }.should_not raise_error(ArgumentError) - lambda { @securable.deny_rights :read, "The Dude" }.should_not raise_error(ArgumentError) - lambda { @securable.deny_rights :write, "The Dude" }.should_not raise_error(ArgumentError) + lambda { @securable.deny_rights :full_control, "The Dude" }.should_not raise_error + lambda { @securable.deny_rights :modify, "The Dude" }.should_not raise_error + lambda { @securable.deny_rights :read_execute, "The Dude" }.should_not raise_error + lambda { @securable.deny_rights :read, "The Dude" }.should_not raise_error + lambda { @securable.deny_rights :write, "The Dude" }.should_not raise_error lambda { @securable.deny_rights :to_party, "The Dude" }.should raise_error(ArgumentError) end it "should accept a principal as a string or an array" do - lambda { @securable.rights :read, "The Dude" }.should_not raise_error(ArgumentError) - lambda { @securable.rights :read, ["The Dude","Donny"] }.should_not raise_error(ArgumentError) + lambda { @securable.rights :read, "The Dude" }.should_not raise_error + lambda { @securable.rights :read, ["The Dude","Donny"] }.should_not raise_error lambda { @securable.rights :read, 3 }.should raise_error(ArgumentError) end it "should allow you to specify whether the permissions applies_to_children with true/false/:containers_only/:objects_only" do - lambda { @securable.rights :read, "The Dude", :applies_to_children => false }.should_not raise_error(ArgumentError) - lambda { @securable.rights :read, "The Dude", :applies_to_children => true }.should_not raise_error(ArgumentError) - lambda { @securable.rights :read, "The Dude", :applies_to_children => :containers_only }.should_not raise_error(ArgumentError) - lambda { @securable.rights :read, "The Dude", :applies_to_children => :objects_only }.should_not raise_error(ArgumentError) + lambda { @securable.rights :read, "The Dude", :applies_to_children => false }.should_not raise_error + lambda { @securable.rights :read, "The Dude", :applies_to_children => true }.should_not raise_error + lambda { @securable.rights :read, "The Dude", :applies_to_children => :containers_only }.should_not raise_error + lambda { @securable.rights :read, "The Dude", :applies_to_children => :objects_only }.should_not raise_error lambda { @securable.rights :read, "The Dude", :applies_to_children => 'poop' }.should raise_error(ArgumentError) end it "should allow you to specify whether the permissions applies_to_self with true/false" do - lambda { @securable.rights :read, "The Dude", :applies_to_children => true, :applies_to_self => false }.should_not raise_error(ArgumentError) - lambda { @securable.rights :read, "The Dude", :applies_to_self => true }.should_not raise_error(ArgumentError) + lambda { @securable.rights :read, "The Dude", :applies_to_children => true, :applies_to_self => false }.should_not raise_error + lambda { @securable.rights :read, "The Dude", :applies_to_self => true }.should_not raise_error lambda { @securable.rights :read, "The Dude", :applies_to_self => 'poop' }.should raise_error(ArgumentError) end it "should allow you to specify whether the permissions applies one_level_deep with true/false" do - lambda { @securable.rights :read, "The Dude", :applies_to_children => true, :one_level_deep => false }.should_not raise_error(ArgumentError) - lambda { @securable.rights :read, "The Dude", :applies_to_children => true, :one_level_deep => true }.should_not raise_error(ArgumentError) + lambda { @securable.rights :read, "The Dude", :applies_to_children => true, :one_level_deep => false }.should_not raise_error + lambda { @securable.rights :read, "The Dude", :applies_to_children => true, :one_level_deep => true }.should_not raise_error lambda { @securable.rights :read, "The Dude", :applies_to_children => true, :one_level_deep => 'poop' }.should raise_error(ArgumentError) end @@ -290,26 +290,26 @@ describe Chef::Mixin::Securable do end it "should allow you to specify whether the permission applies_to_self only if you specified applies_to_children" do - lambda { @securable.rights :read, "The Dude", :applies_to_children => true, :applies_to_self => true }.should_not raise_error(ArgumentError) - lambda { @securable.rights :read, "The Dude", :applies_to_children => true, :applies_to_self => false }.should_not raise_error(ArgumentError) - lambda { @securable.rights :read, "The Dude", :applies_to_children => false, :applies_to_self => true }.should_not raise_error(ArgumentError) + lambda { @securable.rights :read, "The Dude", :applies_to_children => true, :applies_to_self => true }.should_not raise_error + lambda { @securable.rights :read, "The Dude", :applies_to_children => true, :applies_to_self => false }.should_not raise_error + lambda { @securable.rights :read, "The Dude", :applies_to_children => false, :applies_to_self => true }.should_not raise_error lambda { @securable.rights :read, "The Dude", :applies_to_children => false, :applies_to_self => false }.should raise_error(ArgumentError) - lambda { @securable.rights :read, "The Dude", :applies_to_self => true }.should_not raise_error(ArgumentError) - lambda { @securable.rights :read, "The Dude", :applies_to_self => false }.should_not raise_error(ArgumentError) + lambda { @securable.rights :read, "The Dude", :applies_to_self => true }.should_not raise_error + lambda { @securable.rights :read, "The Dude", :applies_to_self => false }.should_not raise_error end it "should allow you to specify whether the permission applies one_level_deep only if you specified applies_to_children" do - lambda { @securable.rights :read, "The Dude", :applies_to_children => true, :one_level_deep => true }.should_not raise_error(ArgumentError) - lambda { @securable.rights :read, "The Dude", :applies_to_children => true, :one_level_deep => false }.should_not raise_error(ArgumentError) + lambda { @securable.rights :read, "The Dude", :applies_to_children => true, :one_level_deep => true }.should_not raise_error + lambda { @securable.rights :read, "The Dude", :applies_to_children => true, :one_level_deep => false }.should_not raise_error lambda { @securable.rights :read, "The Dude", :applies_to_children => false, :one_level_deep => true }.should raise_error(ArgumentError) - lambda { @securable.rights :read, "The Dude", :applies_to_children => false, :one_level_deep => false }.should_not raise_error(ArgumentError) - lambda { @securable.rights :read, "The Dude", :one_level_deep => true }.should_not raise_error(ArgumentError) - lambda { @securable.rights :read, "The Dude", :one_level_deep => false }.should_not raise_error(ArgumentError) + lambda { @securable.rights :read, "The Dude", :applies_to_children => false, :one_level_deep => false }.should_not raise_error + lambda { @securable.rights :read, "The Dude", :one_level_deep => true }.should_not raise_error + lambda { @securable.rights :read, "The Dude", :one_level_deep => false }.should_not raise_error end it "should allow you to specify whether the permissions inherit with true/false" do - lambda { @securable.inherits true }.should_not raise_error(ArgumentError) - lambda { @securable.inherits false }.should_not raise_error(ArgumentError) + lambda { @securable.inherits true }.should_not raise_error + lambda { @securable.inherits false }.should_not raise_error lambda { @securable.inherits "monkey" }.should raise_error(ArgumentError) end end diff --git a/spec/unit/node/attribute_spec.rb b/spec/unit/node/attribute_spec.rb index 70905d334b..5a7c57807a 100644 --- a/spec/unit/node/attribute_spec.rb +++ b/spec/unit/node/attribute_spec.rb @@ -437,7 +437,7 @@ describe Chef::Node::Attribute do it "should let you set an attribute value when another hash has an intermediate value" do @attributes.normal["the_ghost"] = { "exterminate" => "the future" } - lambda { @attributes.normal["the_ghost"]["exterminate"]["tomorrow"] = false }.should_not raise_error(NoMethodError) + lambda { @attributes.normal["the_ghost"]["exterminate"]["tomorrow"] = false }.should_not raise_error end it "should set the attribute value" do @@ -597,7 +597,7 @@ describe Chef::Node::Attribute do end it "should not raise an exception if one of the hashes has a nil value on a deep lookup" do - lambda { @attributes.place.keys { |k| } }.should_not raise_error(NoMethodError) + lambda { @attributes.place.keys { |k| } }.should_not raise_error end end @@ -981,7 +981,7 @@ describe Chef::Node::Attribute do if RUBY_VERSION >= "1.8.7" it "should not raise a LocalJumpError if no block is given" do - lambda { @attributes.select }.should_not raise_error(LocalJumpError) + lambda { @attributes.select }.should_not raise_error end else it "should raise a LocalJumpError if no block is given" do diff --git a/spec/unit/provider/git_spec.rb b/spec/unit/provider/git_spec.rb index 416012f5fa..b18a2a8996 100644 --- a/spec/unit/provider/git_spec.rb +++ b/spec/unit/provider/git_spec.rb @@ -135,7 +135,7 @@ describe Chef::Provider::Git do @provider.action = :checkout ::File.stub(:directory?).with("/my/deploy").and_return(true) @provider.define_resource_requirements - lambda { @provider.process_resource_requirements }.should_not raise_error(RuntimeError) + lambda { @provider.process_resource_requirements }.should_not raise_error end it "gives the latest HEAD revision SHA if nothing is specified" do diff --git a/spec/unit/provider/group/dscl_spec.rb b/spec/unit/provider/group/dscl_spec.rb index 6eb85f7417..e29e24f9b2 100644 --- a/spec/unit/provider/group/dscl_spec.rb +++ b/spec/unit/provider/group/dscl_spec.rb @@ -247,7 +247,7 @@ describe Chef::Provider::Group::Dscl do it "doesn't raise an error if /usr/bin/dscl exists" do File.stub(:exists?).and_return(true) - lambda { @provider.process_resource_requirements }.should_not raise_error(Chef::Exceptions::Group) + lambda { @provider.process_resource_requirements }.should_not raise_error end end diff --git a/spec/unit/provider/group/gpasswd_spec.rb b/spec/unit/provider/group/gpasswd_spec.rb index 0436812501..7d71ecdb41 100644 --- a/spec/unit/provider/group/gpasswd_spec.rb +++ b/spec/unit/provider/group/gpasswd_spec.rb @@ -47,7 +47,7 @@ describe Chef::Provider::Group::Gpasswd, "modify_group_members" do it "shouldn't raise an error if the required binaries exist" do File.stub(:exists?).and_return(true) - lambda { @provider.process_resource_requirements }.should_not raise_error(Chef::Exceptions::Group) + lambda { @provider.process_resource_requirements }.should_not raise_error end end diff --git a/spec/unit/provider/group/groupmod_spec.rb b/spec/unit/provider/group/groupmod_spec.rb index 3d49f667d4..001f9c66e8 100644 --- a/spec/unit/provider/group/groupmod_spec.rb +++ b/spec/unit/provider/group/groupmod_spec.rb @@ -44,7 +44,7 @@ describe Chef::Provider::Group::Groupmod do it "shouldn't raise an error if the required binaries exist" do File.stub(:exists?).and_return(true) - lambda { @provider.load_current_resource }.should_not raise_error(Chef::Exceptions::Group) + lambda { @provider.load_current_resource }.should_not raise_error end end diff --git a/spec/unit/provider/group/pw_spec.rb b/spec/unit/provider/group/pw_spec.rb index 103bc33bd4..e622edbef3 100644 --- a/spec/unit/provider/group/pw_spec.rb +++ b/spec/unit/provider/group/pw_spec.rb @@ -131,7 +131,7 @@ describe Chef::Provider::Group::Pw do it "shouldn't raise an error if /usr/sbin/pw exists" do File.stub(:exists?).and_return(true) - lambda { @provider.process_resource_requirements }.should_not raise_error(Chef::Exceptions::Group) + lambda { @provider.process_resource_requirements }.should_not raise_error end end end diff --git a/spec/unit/provider/group/usermod_spec.rb b/spec/unit/provider/group/usermod_spec.rb index cc3a28fb74..45b6aad8aa 100644 --- a/spec/unit/provider/group/usermod_spec.rb +++ b/spec/unit/provider/group/usermod_spec.rb @@ -107,7 +107,7 @@ describe Chef::Provider::Group::Usermod do it "shouldn't raise an error if the required binaries exist" do File.stub(:exists?).and_return(true) - lambda { @provider.process_resource_requirements }.should_not raise_error(Chef::Exceptions::Group) + lambda { @provider.process_resource_requirements }.should_not raise_error end end end diff --git a/spec/unit/provider/package/pacman_spec.rb b/spec/unit/provider/package/pacman_spec.rb index 83f376431e..528f7097e8 100644 --- a/spec/unit/provider/package/pacman_spec.rb +++ b/spec/unit/provider/package/pacman_spec.rb @@ -139,7 +139,7 @@ PACMAN_CONF it "should not raise an exception if pacman succeeds" do @status.should_receive(:exitstatus).and_return(0) - lambda { @provider.load_current_resource }.should_not raise_error(Chef::Exceptions::Package) + lambda { @provider.load_current_resource }.should_not raise_error end it "should raise an exception if pacman does not return a candidate version" do diff --git a/spec/unit/provider/package/yum_spec.rb b/spec/unit/provider/package/yum_spec.rb index 8a947c2b2d..adbcd86722 100644 --- a/spec/unit/provider/package/yum_spec.rb +++ b/spec/unit/provider/package/yum_spec.rb @@ -1690,8 +1690,8 @@ EOF describe "installed_version" do it "should take one or two arguments" do - lambda { @yc.installed_version("zip") }.should_not raise_error(ArgumentError) - lambda { @yc.installed_version("zip", "i386") }.should_not raise_error(ArgumentError) + lambda { @yc.installed_version("zip") }.should_not raise_error + lambda { @yc.installed_version("zip", "i386") }.should_not raise_error lambda { @yc.installed_version("zip", "i386", "extra") }.should raise_error(ArgumentError) end @@ -1714,8 +1714,8 @@ EOF describe "available_version" do it "should take one or two arguments" do - lambda { @yc.available_version("zisofs-tools") }.should_not raise_error(ArgumentError) - lambda { @yc.available_version("zisofs-tools", "i386") }.should_not raise_error(ArgumentError) + lambda { @yc.available_version("zisofs-tools") }.should_not raise_error + lambda { @yc.available_version("zisofs-tools", "i386") }.should_not raise_error lambda { @yc.available_version("zisofs-tools", "i386", "extra") }.should raise_error(ArgumentError) end @@ -1739,8 +1739,8 @@ EOF describe "version_available?" do it "should take two or three arguments" do lambda { @yc.version_available?("zisofs-tools") }.should raise_error(ArgumentError) - lambda { @yc.version_available?("zisofs-tools", "1.0.6-3.2.2") }.should_not raise_error(ArgumentError) - lambda { @yc.version_available?("zisofs-tools", "1.0.6-3.2.2", "x86_64") }.should_not raise_error(ArgumentError) + lambda { @yc.version_available?("zisofs-tools", "1.0.6-3.2.2") }.should_not raise_error + lambda { @yc.version_available?("zisofs-tools", "1.0.6-3.2.2", "x86_64") }.should_not raise_error end it "should return true if our package-version-arch is available" do @@ -1768,8 +1768,8 @@ EOF describe "package_repository" do it "should take two or three arguments" do lambda { @yc.package_repository("zisofs-tools") }.should raise_error(ArgumentError) - lambda { @yc.package_repository("zisofs-tools", "1.0.6-3.2.2") }.should_not raise_error(ArgumentError) - lambda { @yc.package_repository("zisofs-tools", "1.0.6-3.2.2", "x86_64") }.should_not raise_error(ArgumentError) + lambda { @yc.package_repository("zisofs-tools", "1.0.6-3.2.2") }.should_not raise_error + lambda { @yc.package_repository("zisofs-tools", "1.0.6-3.2.2", "x86_64") }.should_not raise_error end it "should return repoid for package-version-arch" do diff --git a/spec/unit/provider/package/zypper_spec.rb b/spec/unit/provider/package/zypper_spec.rb index e63ac5160e..c437631309 100644 --- a/spec/unit/provider/package/zypper_spec.rb +++ b/spec/unit/provider/package/zypper_spec.rb @@ -82,7 +82,7 @@ describe Chef::Provider::Package::Zypper do it "should not raise an exception if zypper info succeeds" do @status.should_receive(:exitstatus).and_return(0) - lambda { @provider.load_current_resource }.should_not raise_error(Chef::Exceptions::Package) + lambda { @provider.load_current_resource }.should_not raise_error end it "should return the current resouce" do diff --git a/spec/unit/provider/service/freebsd_service_spec.rb b/spec/unit/provider/service/freebsd_service_spec.rb index 4ebfe12b49..820dfb8dc7 100644 --- a/spec/unit/provider/service/freebsd_service_spec.rb +++ b/spec/unit/provider/service/freebsd_service_spec.rb @@ -75,7 +75,7 @@ RC_SAMPLE it "should not raise an exception if the rcscript have a name variable" do @provider.load_current_resource - lambda { @provider.service_enable_variable_name }.should_not raise_error(Chef::Exceptions::Service) + lambda { @provider.service_enable_variable_name }.should_not raise_error end describe "when the service supports status" do @@ -294,7 +294,7 @@ RCVAR_SAMPLE it "should not raise an exception if the rcscript does not have a name variable" do @provider.load_current_resource - lambda { @provider.service_enable_variable_name }.should_not raise_error(Chef::Exceptions::Service) + lambda { @provider.service_enable_variable_name }.should_not raise_error end end @@ -323,7 +323,7 @@ RCVAR_SAMPLE @provider.action = action @provider.load_current_resource @provider.define_resource_requirements - lambda { @provider.process_resource_requirements }.should_not raise_error(Chef::Exceptions::Service) + lambda { @provider.process_resource_requirements }.should_not raise_error end end end diff --git a/spec/unit/provider/service/init_service_spec.rb b/spec/unit/provider/service/init_service_spec.rb index 9b0371a270..ad887c84a5 100644 --- a/spec/unit/provider/service/init_service_spec.rb +++ b/spec/unit/provider/service/init_service_spec.rb @@ -229,7 +229,7 @@ RUNNING_PS end it "should still pass all why run assertions" do - lambda { @provider.run_action(:start) }.should_not raise_error(Chef::Exceptions::Service) + lambda { @provider.run_action(:start) }.should_not raise_error end end end diff --git a/spec/unit/provider/user/dscl_spec.rb b/spec/unit/provider/user/dscl_spec.rb index 2e0de1364c..c7657aa6e5 100644 --- a/spec/unit/provider/user/dscl_spec.rb +++ b/spec/unit/provider/user/dscl_spec.rb @@ -325,7 +325,7 @@ describe Chef::Provider::User::Dscl do it "shouldn't raise an error if /usr/bin/dscl exists" do ::File.stub(:exists?).and_return(true) - lambda { @provider.load_current_resource }.should_not raise_error(Chef::Exceptions::User) + lambda { @provider.load_current_resource }.should_not raise_error end end diff --git a/spec/unit/provider/user/pw_spec.rb b/spec/unit/provider/user/pw_spec.rb index e5ebcb370a..1d5ad38c9c 100644 --- a/spec/unit/provider/user/pw_spec.rb +++ b/spec/unit/provider/user/pw_spec.rb @@ -212,7 +212,7 @@ describe Chef::Provider::User::Pw do it "should not raise an exception if pw usermod succeeds" do @status.should_receive(:exitstatus).and_return(0) - lambda { @provider.modify_password }.should_not raise_error(Chef::Exceptions::User) + lambda { @provider.modify_password }.should_not raise_error end end end @@ -229,7 +229,7 @@ describe Chef::Provider::User::Pw do it "shouldn't raise an error if /usr/sbin/pw exists" do File.stub(:exists?).and_return(true) - lambda { @provider.load_current_resource }.should_not raise_error(Chef::Exceptions::User) + lambda { @provider.load_current_resource }.should_not raise_error end end end diff --git a/spec/unit/recipe_spec.rb b/spec/unit/recipe_spec.rb index 3d79f33264..a2c6e4b4cb 100644 --- a/spec/unit/recipe_spec.rb +++ b/spec/unit/recipe_spec.rb @@ -46,7 +46,7 @@ describe Chef::Recipe do @recipe.zen_master "monkey" do peace true end - end.should_not raise_error(ArgumentError) + end.should_not raise_error end it "should load a one word (cat) resource" do @@ -54,7 +54,7 @@ describe Chef::Recipe do @recipe.cat "loulou" do pretty_kitty true end - end.should_not raise_error(ArgumentError) + end.should_not raise_error end it "should load a four word (one_two_three_four) resource" do @@ -62,7 +62,7 @@ describe Chef::Recipe do @recipe.one_two_three_four "numbers" do i_can_count true end - end.should_not raise_error(ArgumentError) + end.should_not raise_error end it "should throw an error if you access a resource that we can't find" do diff --git a/spec/unit/resource/cron_spec.rb b/spec/unit/resource/cron_spec.rb index 7f294fae11..355a7f09ba 100644 --- a/spec/unit/resource/cron_spec.rb +++ b/spec/unit/resource/cron_spec.rb @@ -39,8 +39,8 @@ describe Chef::Resource::Cron do end it "should accept create or delete for action" do - lambda { @resource.action :create }.should_not raise_error(ArgumentError) - lambda { @resource.action :delete }.should_not raise_error(ArgumentError) + lambda { @resource.action :create }.should_not raise_error + lambda { @resource.action :delete }.should_not raise_error lambda { @resource.action :lolcat }.should raise_error(ArgumentError) end diff --git a/spec/unit/resource/directory_spec.rb b/spec/unit/resource/directory_spec.rb index dc042c5a77..a42383c49e 100644 --- a/spec/unit/resource/directory_spec.rb +++ b/spec/unit/resource/directory_spec.rb @@ -39,8 +39,8 @@ describe Chef::Resource::Directory do end it "should accept create or delete for action" do - lambda { @resource.action :create }.should_not raise_error(ArgumentError) - lambda { @resource.action :delete }.should_not raise_error(ArgumentError) + lambda { @resource.action :create }.should_not raise_error + lambda { @resource.action :delete }.should_not raise_error lambda { @resource.action :blues }.should raise_error(ArgumentError) end @@ -49,14 +49,14 @@ describe Chef::Resource::Directory do end it "should accept a string as the path" do - lambda { @resource.path "/tmp" }.should_not raise_error(ArgumentError) + lambda { @resource.path "/tmp" }.should_not raise_error @resource.path.should eql("/tmp") lambda { @resource.path Hash.new }.should raise_error(ArgumentError) end it "should allow you to have specify whether the action is recursive with true/false" do - lambda { @resource.recursive true }.should_not raise_error(ArgumentError) - lambda { @resource.recursive false }.should_not raise_error(ArgumentError) + lambda { @resource.recursive true }.should_not raise_error + lambda { @resource.recursive false }.should_not raise_error lambda { @resource.recursive "monkey" }.should raise_error(ArgumentError) end diff --git a/spec/unit/resource/env_spec.rb b/spec/unit/resource/env_spec.rb index b53cbe478f..a1f599400b 100644 --- a/spec/unit/resource/env_spec.rb +++ b/spec/unit/resource/env_spec.rb @@ -43,7 +43,7 @@ describe Chef::Resource::Env do if bad_value lambda { @resource.action action }.should raise_error(ArgumentError) else - lambda { @resource.action action }.should_not raise_error(ArgumentError) + lambda { @resource.action action }.should_not raise_error end end end @@ -53,7 +53,7 @@ describe Chef::Resource::Env do end it "should accept a string as the env value via 'value'" do - lambda { @resource.value "bar" }.should_not raise_error(ArgumentError) + lambda { @resource.value "bar" }.should_not raise_error end it "should not accept a Hash for the env value via 'to'" do diff --git a/spec/unit/resource/erl_call_spec.rb b/spec/unit/resource/erl_call_spec.rb index 49df9639d1..3efbdca9a0 100644 --- a/spec/unit/resource/erl_call_spec.rb +++ b/spec/unit/resource/erl_call_spec.rb @@ -39,7 +39,7 @@ describe Chef::Resource::ErlCall do end it "should accept run as an action" do - lambda { @resource.action :run }.should_not raise_error(ArgumentError) + lambda { @resource.action :run }.should_not raise_error end it "should allow you to set the code attribute" do diff --git a/spec/unit/resource/file_spec.rb b/spec/unit/resource/file_spec.rb index f937d0035b..9c6365f6d3 100644 --- a/spec/unit/resource/file_spec.rb +++ b/spec/unit/resource/file_spec.rb @@ -44,25 +44,25 @@ describe Chef::Resource::File do lambda { @resource.content 5 }.should raise_error(ArgumentError) lambda { @resource.content :foo }.should raise_error(ArgumentError) lambda { @resource.content "hello" => "there" }.should raise_error(ArgumentError) - lambda { @resource.content "hi" }.should_not raise_error(ArgumentError) + lambda { @resource.content "hi" }.should_not raise_error end it "should only accept false or a number for backup" do lambda { @resource.backup true }.should raise_error(ArgumentError) - lambda { @resource.backup false }.should_not raise_error(ArgumentError) - lambda { @resource.backup 10 }.should_not raise_error(ArgumentError) + lambda { @resource.backup false }.should_not raise_error + lambda { @resource.backup 10 }.should_not raise_error lambda { @resource.backup "blues" }.should raise_error(ArgumentError) end it "should accept a sha256 for checksum" do - lambda { @resource.checksum "0fd012fdc96e96f8f7cf2046522a54aed0ce470224513e45da6bc1a17a4924aa" }.should_not raise_error(ArgumentError) + lambda { @resource.checksum "0fd012fdc96e96f8f7cf2046522a54aed0ce470224513e45da6bc1a17a4924aa" }.should_not raise_error lambda { @resource.checksum "monkey!" }.should raise_error(ArgumentError) end it "should accept create, delete or touch for action" do - lambda { @resource.action :create }.should_not raise_error(ArgumentError) - lambda { @resource.action :delete }.should_not raise_error(ArgumentError) - lambda { @resource.action :touch }.should_not raise_error(ArgumentError) + lambda { @resource.action :create }.should_not raise_error + lambda { @resource.action :delete }.should_not raise_error + lambda { @resource.action :touch }.should_not raise_error lambda { @resource.action :blues }.should raise_error(ArgumentError) end @@ -71,7 +71,7 @@ describe Chef::Resource::File do end it "should accept a string as the path" do - lambda { @resource.path "/tmp" }.should_not raise_error(ArgumentError) + lambda { @resource.path "/tmp" }.should_not raise_error @resource.path.should eql("/tmp") lambda { @resource.path Hash.new }.should raise_error(ArgumentError) end diff --git a/spec/unit/resource/group_spec.rb b/spec/unit/resource/group_spec.rb index df68c5691f..0c3cf4f67f 100644 --- a/spec/unit/resource/group_spec.rb +++ b/spec/unit/resource/group_spec.rb @@ -60,11 +60,11 @@ describe Chef::Resource::Group, "initialize" do end it "should accept domain groups (@ or \ separator) on non-windows" do - lambda { @resource.group_name "domain\@group" }.should_not raise_error(ArgumentError) + lambda { @resource.group_name "domain\@group" }.should_not raise_error @resource.group_name.should == "domain\@group" - lambda { @resource.group_name "domain\\group" }.should_not raise_error(ArgumentError) + lambda { @resource.group_name "domain\\group" }.should_not raise_error @resource.group_name.should == "domain\\group" - lambda { @resource.group_name "domain\\group^name" }.should_not raise_error(ArgumentError) + lambda { @resource.group_name "domain\\group^name" }.should_not raise_error @resource.group_name.should == "domain\\group^name" end end diff --git a/spec/unit/resource/mdadm_spec.rb b/spec/unit/resource/mdadm_spec.rb index 310f420659..daf10bcfea 100644 --- a/spec/unit/resource/mdadm_spec.rb +++ b/spec/unit/resource/mdadm_spec.rb @@ -39,9 +39,9 @@ describe Chef::Resource::Mdadm do end it "should accept create, assemble, stop as actions" do - lambda { @resource.action :create }.should_not raise_error(ArgumentError) - lambda { @resource.action :assemble }.should_not raise_error(ArgumentError) - lambda { @resource.action :stop }.should_not raise_error(ArgumentError) + lambda { @resource.action :create }.should_not raise_error + lambda { @resource.action :assemble }.should_not raise_error + lambda { @resource.action :stop }.should_not raise_error end it "should allow you to set the raid_device attribute" do diff --git a/spec/unit/resource/mount_spec.rb b/spec/unit/resource/mount_spec.rb index fb414018ba..c80f6971f1 100644 --- a/spec/unit/resource/mount_spec.rb +++ b/spec/unit/resource/mount_spec.rb @@ -42,9 +42,9 @@ describe Chef::Resource::Mount do end it "should accept mount, umount and remount as actions" do - lambda { @resource.action :mount }.should_not raise_error(ArgumentError) - lambda { @resource.action :umount }.should_not raise_error(ArgumentError) - lambda { @resource.action :remount }.should_not raise_error(ArgumentError) + lambda { @resource.action :mount }.should_not raise_error + lambda { @resource.action :umount }.should_not raise_error + lambda { @resource.action :remount }.should_not raise_error lambda { @resource.action :brooklyn }.should raise_error(ArgumentError) end diff --git a/spec/unit/resource/route_spec.rb b/spec/unit/resource/route_spec.rb index bca42f1101..4522438402 100644 --- a/spec/unit/resource/route_spec.rb +++ b/spec/unit/resource/route_spec.rb @@ -39,8 +39,8 @@ describe Chef::Resource::Route do end it "should accept add or delete for action" do - lambda { @resource.action :add }.should_not raise_error(ArgumentError) - lambda { @resource.action :delete }.should_not raise_error(ArgumentError) + lambda { @resource.action :add }.should_not raise_error + lambda { @resource.action :delete }.should_not raise_error lambda { @resource.action :lolcat }.should raise_error(ArgumentError) end diff --git a/spec/unit/resource/user_spec.rb b/spec/unit/resource/user_spec.rb index caf12aa416..9972ddbba1 100644 --- a/spec/unit/resource/user_spec.rb +++ b/spec/unit/resource/user_spec.rb @@ -61,9 +61,9 @@ describe Chef::Resource::User, "initialize" do end it "should accept domain users (@ or \ separator) on non-windows" do - lambda { @resource.username "domain\@user" }.should_not raise_error(ArgumentError) + lambda { @resource.username "domain\@user" }.should_not raise_error @resource.username.should == "domain\@user" - lambda { @resource.username "domain\\user" }.should_not raise_error(ArgumentError) + lambda { @resource.username "domain\\user" }.should_not raise_error @resource.username.should == "domain\\user" end end diff --git a/spec/unit/resource/yum_package_spec.rb b/spec/unit/resource/yum_package_spec.rb index 783a539eb2..57ab4dfcd9 100644 --- a/spec/unit/resource/yum_package_spec.rb +++ b/spec/unit/resource/yum_package_spec.rb @@ -78,8 +78,8 @@ describe Chef::Resource::YumPackage, "allow_downgrade" do end it "should allow you to specify whether allow_downgrade is true or false" do - lambda { @resource.allow_downgrade true }.should_not raise_error(ArgumentError) - lambda { @resource.allow_downgrade false }.should_not raise_error(ArgumentError) + lambda { @resource.allow_downgrade true }.should_not raise_error + lambda { @resource.allow_downgrade false }.should_not raise_error lambda { @resource.allow_downgrade "monkey" }.should raise_error(ArgumentError) end end diff --git a/spec/unit/resource_collection_spec.rb b/spec/unit/resource_collection_spec.rb index d8fc0db8e0..cf62f5ff40 100644 --- a/spec/unit/resource_collection_spec.rb +++ b/spec/unit/resource_collection_spec.rb @@ -118,7 +118,7 @@ describe Chef::ResourceCollection do @rc.each_index do |i| results << @rc[i].name end - }.should_not raise_error() + }.should_not raise_error results.each_index do |i| case i when 0 diff --git a/spec/unit/resource_definition_spec.rb b/spec/unit/resource_definition_spec.rb index abac4c1163..f24254cfce 100644 --- a/spec/unit/resource_definition_spec.rb +++ b/spec/unit/resource_definition_spec.rb @@ -58,7 +58,7 @@ describe Chef::ResourceDefinition do lambda { @def.define :smoke do end - }.should_not raise_error(ArgumentError) + }.should_not raise_error lambda { @def.define "george washington" do end @@ -70,7 +70,7 @@ describe Chef::ResourceDefinition do lambda { @def.define :smoke, :cigar => "cuban", :cigarette => "marlboro" do end - }.should_not raise_error(ArgumentError) + }.should_not raise_error end it "should expose the prototype hash params in the params hash" do diff --git a/spec/unit/resource_spec.rb b/spec/unit/resource_spec.rb index a75d1f0285..e9a60c9861 100644 --- a/spec/unit/resource_spec.rb +++ b/spec/unit/resource_spec.rb @@ -205,8 +205,8 @@ describe Chef::Resource do describe "noop" do it "should accept true or false for noop" do - lambda { @resource.noop true }.should_not raise_error(ArgumentError) - lambda { @resource.noop false }.should_not raise_error(ArgumentError) + lambda { @resource.noop true }.should_not raise_error + lambda { @resource.noop false }.should_not raise_error lambda { @resource.noop "eat it" }.should raise_error(ArgumentError) end end diff --git a/spec/unit/runner_spec.rb b/spec/unit/runner_spec.rb index 1e449bd1c0..68d8b0e011 100644 --- a/spec/unit/runner_spec.rb +++ b/spec/unit/runner_spec.rb @@ -135,7 +135,7 @@ describe Chef::Runner do provider = Chef::Provider::SnakeOil.new(@run_context.resource_collection[0], @run_context) Chef::Provider::SnakeOil.stub(:new).once.and_return(provider) provider.stub(:action_sell).once.and_raise(ArgumentError) - lambda { @runner.converge }.should_not raise_error(ArgumentError) + lambda { @runner.converge }.should_not raise_error end it "should retry with the specified delay if retries are specified" do diff --git a/spec/unit/search/query_spec.rb b/spec/unit/search/query_spec.rb index d880f49a4b..7463e3bb3c 100644 --- a/spec/unit/search/query_spec.rb +++ b/spec/unit/search/query_spec.rb @@ -42,8 +42,8 @@ describe Chef::Search::Query do end it "should accept a type as the first argument" do - lambda { @query.search("foo") }.should_not raise_error(ArgumentError) - lambda { @query.search(:foo) }.should_not raise_error(ArgumentError) + lambda { @query.search("foo") }.should_not raise_error + lambda { @query.search(:foo) }.should_not raise_error lambda { @query.search(Hash.new) }.should raise_error(ArgumentError) end |