From 38885408f0e935af86b5bee54f526f6d3ed926ba Mon Sep 17 00:00:00 2001 From: Daniel DeLeo Date: Wed, 21 Dec 2011 18:52:14 -0800 Subject: [PATCH] allow owner to be specified as user --- chef/lib/chef/mixin/securable.rb | 2 ++ chef/spec/unit/mixin/securable_spec.rb | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/chef/lib/chef/mixin/securable.rb b/chef/lib/chef/mixin/securable.rb index 494f7c7cea2..3aa321717cf 100644 --- a/chef/lib/chef/mixin/securable.rb +++ b/chef/lib/chef/mixin/securable.rb @@ -28,6 +28,8 @@ def owner(arg=nil) ) end + alias :user :owner + def group(arg=nil) set_or_return( :group, diff --git a/chef/spec/unit/mixin/securable_spec.rb b/chef/spec/unit/mixin/securable_spec.rb index 710002ee9d3..892e1880346 100644 --- a/chef/spec/unit/mixin/securable_spec.rb +++ b/chef/spec/unit/mixin/securable_spec.rb @@ -87,5 +87,9 @@ lambda { @securable.owner 123 }.should_not raise_error(ArgumentError) lambda { @securable.owner "root*goo" }.should raise_error(ArgumentError) end + + it "allows the owner to be specified as #user" do + @securable.should respond_to(:user) + end end end