summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoah Kantrowitz <noah@coderanger.net>2018-06-05 21:43:32 -0700
committerNoah Kantrowitz <noah@coderanger.net>2018-06-05 21:43:32 -0700
commit05f63cac5c5f7b302ad60fb2fec6a328e7a1ae1c (patch)
tree34f09731611269f35ef4444867dc1d73325dc282
parent10f56708961275efda83018d1177a9c47f315970 (diff)
downloadchef-05f63cac5c5f7b302ad60fb2fec6a328e7a1ae1c.tar.gz
Feed the rubocop.
Signed-off-by: Noah Kantrowitz <noah@coderanger.net>
-rw-r--r--lib/chef/resource.rb2
-rw-r--r--spec/unit/resource_spec.rb6
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