diff options
author | Adam Jacob <adam@hjksolutions.com> | 2008-04-28 00:31:20 -0700 |
---|---|---|
committer | Adam Jacob <adam@hjksolutions.com> | 2008-04-28 00:31:20 -0700 |
commit | 21cc606e60acc25d8741757eacc2c5459cdd1472 (patch) | |
tree | 53319a768a0a9d9c5f06e715ab75597e422c372a /spec | |
parent | bab9b3459fe41849970e50cb9b96ea62370fbad0 (diff) | |
download | chef-21cc606e60acc25d8741757eacc2c5459cdd1472.tar.gz |
Got set_or_return to work properly
Diffstat (limited to 'spec')
-rw-r--r-- | spec/spec.opts | 2 | ||||
-rw-r--r-- | spec/unit/mixin/params_validate_spec.rb | 1 | ||||
-rw-r--r-- | spec/unit/recipe_spec.rb | 2 | ||||
-rw-r--r-- | spec/unit/resource/directory_spec.rb | 3 | ||||
-rw-r--r-- | spec/unit/resource/file_spec.rb | 5 |
5 files changed, 7 insertions, 6 deletions
diff --git a/spec/spec.opts b/spec/spec.opts index 3725faa2b2..c9c9b4ddf0 100644 --- a/spec/spec.opts +++ b/spec/spec.opts @@ -1,5 +1,3 @@ --color ---format -specdoc --loadby mtime diff --git a/spec/unit/mixin/params_validate_spec.rb b/spec/unit/mixin/params_validate_spec.rb index 2790f2b14a..027945a296 100644 --- a/spec/unit/mixin/params_validate_spec.rb +++ b/spec/unit/mixin/params_validate_spec.rb @@ -328,4 +328,5 @@ describe Chef::Mixin::ParamsValidate do ) }.should raise_error(ArgumentError) end + end
\ No newline at end of file diff --git a/spec/unit/recipe_spec.rb b/spec/unit/recipe_spec.rb index 92434eac3d..9ef73a99a5 100644 --- a/spec/unit/recipe_spec.rb +++ b/spec/unit/recipe_spec.rb @@ -114,7 +114,7 @@ CODE @recipe.from_file(File.join(File.dirname(__FILE__), "..", "data", "recipes", "test.rb")) res = @recipe.resources(:file => "/etc/nsswitch.conf") res.name.should eql("/etc/nsswitch.conf") - res.action.should eql("create") + res.action.should eql(:create) res.owner.should eql("root") res.group.should eql("root") res.mode.should eql(0644) diff --git a/spec/unit/resource/directory_spec.rb b/spec/unit/resource/directory_spec.rb index 18fffb01ff..9a15712e89 100644 --- a/spec/unit/resource/directory_spec.rb +++ b/spec/unit/resource/directory_spec.rb @@ -27,7 +27,6 @@ describe Chef::Resource::Directory do it "should create a new Chef::Resource::Directory" do @resource.should be_a_kind_of(Chef::Resource) - @resource.should be_a_kind_of(Chef::Resource::File) @resource.should be_a_kind_of(Chef::Resource::Directory) end @@ -36,7 +35,7 @@ describe Chef::Resource::Directory do end it "should have a default action of 'create'" do - @resource.action.should eql("create") + @resource.action.should eql(:create) end it "should accept create or delete for action" do diff --git a/spec/unit/resource/file_spec.rb b/spec/unit/resource/file_spec.rb index bffb4e43f8..68839edceb 100644 --- a/spec/unit/resource/file_spec.rb +++ b/spec/unit/resource/file_spec.rb @@ -54,9 +54,10 @@ describe Chef::Resource::File do lambda { @resource.checksum "monkey!" }.should raise_error(ArgumentError) end - it "should accept create or delete for action" do + 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 "blues" }.should raise_error(ArgumentError) end @@ -68,6 +69,7 @@ describe Chef::Resource::File do it "should accept a valid unix file mode" do lambda { @resource.mode 0444 }.should_not raise_error(ArgumentError) + @resource.mode.should eql(0444) lambda { @resource.mode 444 }.should_not raise_error(ArgumentError) lambda { @resource.mode 4 }.should raise_error(ArgumentError) end @@ -84,6 +86,7 @@ describe Chef::Resource::File do it "should accept a string as the path" do lambda { @resource.path "/tmp" }.should_not raise_error(ArgumentError) + @resource.path.should eql("/tmp") lambda { @resource.path Hash.new }.should raise_error(ArgumentError) end |