summaryrefslogtreecommitdiff
path: root/spec/functional
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2019-07-05 13:26:53 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2019-07-05 13:26:53 -0700
commit3b10f9ca503dcbce747241281b9151d3d010f9ef (patch)
tree2e90f78a6910a4c673e19045a7f0627f1fc49382 /spec/functional
parent2a4916b7f01940d1199c35645c1b2172f5bd74b2 (diff)
downloadchef-3b10f9ca503dcbce747241281b9151d3d010f9ef.tar.gz
Style/SymbolProc
enforce pretzels. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'spec/functional')
-rw-r--r--spec/functional/resource/cookbook_file_spec.rb4
-rw-r--r--spec/functional/resource/dsc_script_spec.rb8
-rw-r--r--spec/functional/resource/template_spec.rb2
3 files changed, 4 insertions, 10 deletions
diff --git a/spec/functional/resource/cookbook_file_spec.rb b/spec/functional/resource/cookbook_file_spec.rb
index d127413c73..6e964a6499 100644
--- a/spec/functional/resource/cookbook_file_spec.rb
+++ b/spec/functional/resource/cookbook_file_spec.rb
@@ -25,9 +25,7 @@ describe Chef::Resource::CookbookFile do
let(:source) { "java.response" }
let(:cookbook_name) { "java" }
let(:expected_content) do
- content = File.open(File.join(CHEF_SPEC_DATA, "cookbooks", "java", "files", "default", "java.response"), "rb") do |f|
- f.read
- end
+ content = File.open(File.join(CHEF_SPEC_DATA, "cookbooks", "java", "files", "default", "java.response"), "rb", &:read)
content.force_encoding(Encoding::BINARY) if content.respond_to?(:force_encoding)
content
end
diff --git a/spec/functional/resource/dsc_script_spec.rb b/spec/functional/resource/dsc_script_spec.rb
index 8488fe09ed..224141c0f8 100644
--- a/spec/functional/resource/dsc_script_spec.rb
+++ b/spec/functional/resource/dsc_script_spec.rb
@@ -349,9 +349,7 @@ describe Chef::Resource::DscScript, :windows_powershell_dsc_only do
let(:config_param_section) { config_params }
let(:config_flags) { { "#{dsc_user_prefix_param_name}": (dsc_user_prefix).to_s, "#{dsc_user_suffix_param_name}": (dsc_user_suffix).to_s } }
it "does not directly contain the user name" do
- configuration_script_content = ::File.open(dsc_test_resource.command) do |file|
- file.read
- end
+ configuration_script_content = ::File.open(dsc_test_resource.command, &:read)
expect(configuration_script_content.include?(dsc_user)).to be(false)
end
it_behaves_like "a dsc_script with configuration data"
@@ -361,9 +359,7 @@ describe Chef::Resource::DscScript, :windows_powershell_dsc_only do
let(:dsc_user_code) { dsc_user_env_code }
it "does not directly contain the user name" do
- configuration_script_content = ::File.open(dsc_test_resource.command) do |file|
- file.read
- end
+ configuration_script_content = ::File.open(dsc_test_resource.command, &:read)
expect(configuration_script_content.include?(dsc_user)).to be(false)
end
it_behaves_like "a dsc_script with configuration data"
diff --git a/spec/functional/resource/template_spec.rb b/spec/functional/resource/template_spec.rb
index 679ffe661a..feef97dd27 100644
--- a/spec/functional/resource/template_spec.rb
+++ b/spec/functional/resource/template_spec.rb
@@ -21,7 +21,7 @@ require "spec_helper"
describe Chef::Resource::Template do
def binread(file)
- File.open(file, "rb") { |f| f.read }
+ File.open(file, "rb", &:read)
end
include_context Chef::Resource::File