diff options
-rw-r--r-- | lib/chef/resource.rb | 2 | ||||
-rw-r--r-- | spec/unit/resource_spec.rb | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/chef/resource.rb b/lib/chef/resource.rb index e419801311..478637ff4e 100644 --- a/lib/chef/resource.rb +++ b/lib/chef/resource.rb @@ -1171,7 +1171,7 @@ class Chef # @param value [nil, Boolean] If nil, get the current value. If not nil, set # the value of the flag. # @return [Boolean] - def self.preview_resource(value=nil) + def self.preview_resource(value = nil) @preview_resource = false unless defined?(@preview_resource) @preview_resource = value unless value.nil? @preview_resource diff --git a/spec/unit/resource_spec.rb b/spec/unit/resource_spec.rb index 7dc2c83c5d..26660c9415 100644 --- a/spec/unit/resource_spec.rb +++ b/spec/unit/resource_spec.rb @@ -1162,18 +1162,18 @@ end end it "does not affect provides by default" do - expect(Chef.resource_handler_map).to receive(:set).with(:test_resource, klass, {canonical: true}) + expect(Chef.resource_handler_map).to receive(:set).with(:test_resource, klass, { canonical: true }) klass.resource_name(:test_resource) end it "adds allow_cookbook_override when true" do - expect(Chef.resource_handler_map).to receive(:set).with(:test_resource, klass, {canonical: true, allow_cookbook_override: true}) + expect(Chef.resource_handler_map).to receive(:set).with(:test_resource, klass, { canonical: true, allow_cookbook_override: true }) klass.preview_resource(true) klass.resource_name(:test_resource) end it "allows manually overriding back to false" do - expect(Chef.resource_handler_map).to receive(:set).with(:test_resource, klass, {allow_cookbook_override: false}) + expect(Chef.resource_handler_map).to receive(:set).with(:test_resource, klass, { allow_cookbook_override: false }) klass.preview_resource(true) klass.provides(:test_resource, allow_cookbook_override: false) end |