diff options
-rw-r--r-- | lib/chef/org.rb | 5 | ||||
-rw-r--r-- | spec/unit/org_spec.rb | 5 |
2 files changed, 4 insertions, 6 deletions
diff --git a/lib/chef/org.rb b/lib/chef/org.rb index 9a4f7d93ac..2868b36952 100644 --- a/lib/chef/org.rb +++ b/lib/chef/org.rb @@ -7,7 +7,7 @@ class Chef include Chef::Mixin::ParamsValidate - def initialize(name='') + def initialize(name) @name = name @full_name = '' # The Chef API returns the private key of the validator @@ -95,8 +95,7 @@ class Chef # Class methods def self.from_hash(org_hash) - org = Chef::Org.new - org.name org_hash['name'] + org = Chef::Org.new(org_hash['name']) org.full_name org_hash['full_name'] org.private_key org_hash['private_key'] if org_hash.key?('private_key') org.guid org_hash['guid'] if org_hash.key?('guid') diff --git a/spec/unit/org_spec.rb b/spec/unit/org_spec.rb index 81d9bda020..1ba0492dd8 100644 --- a/spec/unit/org_spec.rb +++ b/spec/unit/org_spec.rb @@ -23,7 +23,7 @@ require 'tempfile' describe Chef::Org do before(:each) do - @org = Chef::Org.new + @org = Chef::Org.new("an_org") end describe "initialize" do @@ -139,8 +139,7 @@ describe Chef::Org do Chef::Config[:chef_server_root] = "http://www.example.com" @rest = double('rest') allow(Chef::REST).to receive(:new).and_return(@rest) - @org = Chef::Org.new - @org.name "foobar" + @org = Chef::Org.new("foobar") @org.full_name "foo bar bat" end |