summaryrefslogtreecommitdiff
path: root/spec/unit
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit')
-rw-r--r--spec/unit/audit/audit_reporter_spec.rb16
-rw-r--r--spec/unit/client_spec.rb8
-rw-r--r--spec/unit/formatters/error_description_spec.rb84
-rw-r--r--spec/unit/formatters/error_inspectors/compile_error_inspector_spec.rb32
-rw-r--r--spec/unit/http/authenticator_spec.rb20
-rw-r--r--spec/unit/key_spec.rb20
-rw-r--r--spec/unit/knife/cookbook_upload_spec.rb20
-rw-r--r--spec/unit/knife/core/bootstrap_context_spec.rb12
-rw-r--r--spec/unit/knife/core/ui_spec.rb104
-rw-r--r--spec/unit/knife/ssl_check_spec.rb16
-rw-r--r--spec/unit/knife/ssl_fetch_spec.rb22
-rw-r--r--spec/unit/knife_spec.rb10
-rw-r--r--spec/unit/provider/apt_repository_spec.rb30
-rw-r--r--spec/unit/provider/cron/unix_spec.rb14
-rw-r--r--spec/unit/provider/cron_spec.rb670
-rw-r--r--spec/unit/provider/git_spec.rb30
-rw-r--r--spec/unit/provider/group/dscl_spec.rb26
-rw-r--r--spec/unit/provider/ifconfig/aix_spec.rb20
-rw-r--r--spec/unit/provider/ifconfig/debian_spec.rb32
-rw-r--r--spec/unit/provider/ifconfig_spec.rb6
-rw-r--r--spec/unit/provider/launchd_spec.rb96
-rw-r--r--spec/unit/provider/mount/aix_spec.rb68
-rw-r--r--spec/unit/provider/package/apt_spec.rb162
-rw-r--r--spec/unit/provider/package/cab_spec.rb112
-rw-r--r--spec/unit/provider/package/chocolatey_spec.rb22
-rw-r--r--spec/unit/provider/package/dpkg_spec.rb42
-rw-r--r--spec/unit/provider/package/ips_spec.rb138
-rw-r--r--spec/unit/provider/package/macports_spec.rb6
-rw-r--r--spec/unit/provider/package/msu_spec.rb96
-rw-r--r--spec/unit/provider/package/pacman_spec.rb76
-rw-r--r--spec/unit/provider/package/paludis_spec.rb40
-rw-r--r--spec/unit/provider/package/portage_spec.rb12
-rw-r--r--spec/unit/provider/package/rubygems_spec.rb104
-rw-r--r--spec/unit/provider/package/solaris_spec.rb24
-rw-r--r--spec/unit/provider/service/arch_service_spec.rb14
-rw-r--r--spec/unit/provider/service/freebsd_service_spec.rb40
-rw-r--r--spec/unit/provider/service/init_service_spec.rb14
-rw-r--r--spec/unit/provider/service/invokercd_service_spec.rb14
-rw-r--r--spec/unit/provider/service/macosx_spec.rb76
-rw-r--r--spec/unit/provider/service/simple_service_spec.rb14
-rw-r--r--spec/unit/provider/template/content_spec.rb30
-rw-r--r--spec/unit/provider/zypper_repository_spec.rb14
-rw-r--r--spec/unit/resource_inspector_spec.rb6
-rw-r--r--spec/unit/resource_spec.rb16
-rw-r--r--spec/unit/role_spec.rb6
-rw-r--r--spec/unit/runner_spec.rb8
-rw-r--r--spec/unit/util/dsc/lcm_output_parser_spec.rb210
-rw-r--r--spec/unit/util/dsc/local_configuration_manager_spec.rb28
-rw-r--r--spec/unit/util/file_edit_spec.rb76
49 files changed, 1378 insertions, 1378 deletions
diff --git a/spec/unit/audit/audit_reporter_spec.rb b/spec/unit/audit/audit_reporter_spec.rb
index f6707825cf..9f74ba93e1 100644
--- a/spec/unit/audit/audit_reporter_spec.rb
+++ b/spec/unit/audit/audit_reporter_spec.rb
@@ -99,10 +99,10 @@ describe Chef::Audit::AuditReporter do
reporter.run_completed(node)
expect(run_data).to have_key(:error)
expect(run_data).to have_key(:error)
- expect(run_data[:error]).to eq <<-EOM.strip!
-Chef::Exceptions::AuditError: Audit phase failed with error message: derpderpderp
-/path/recipe.rb:57
-/path/library.rb:106
+ expect(run_data[:error]).to eq <<~EOM.strip!
+ Chef::Exceptions::AuditError: Audit phase failed with error message: derpderpderp
+ /path/recipe.rb:57
+ /path/library.rb:106
EOM
end
@@ -269,10 +269,10 @@ EOM
expect(rest).to receive(:post)
reporter.run_failed(run_error)
expect(run_data).to have_key(:error)
- expect(run_data[:error]).to eq <<-EOM.strip!
-Chef::Exceptions::AuditError: Audit phase failed with error message: derpderpderp
-/path/recipe.rb:57
-/path/library.rb:106
+ expect(run_data[:error]).to eq <<~EOM.strip!
+ Chef::Exceptions::AuditError: Audit phase failed with error message: derpderpderp
+ /path/recipe.rb:57
+ /path/library.rb:106
EOM
end
end
diff --git a/spec/unit/client_spec.rb b/spec/unit/client_spec.rb
index 0e72a285af..6d94e87e21 100644
--- a/spec/unit/client_spec.rb
+++ b/spec/unit/client_spec.rb
@@ -410,8 +410,8 @@ describe Chef::Client do
let(:run_context) { double("Chef::RunContext") }
let(:recipe) { double("Chef::Recipe (required recipe)") }
let(:required_recipe) do
- <<EOM
-fake_recipe_variable = "for reals"
+ <<~EOM
+ fake_recipe_variable = "for reals"
EOM
end
@@ -429,8 +429,8 @@ EOM
context "when the required_recipe has bad contents" do
let(:required_recipe) do
- <<EOM
-this is not a recipe
+ <<~EOM
+ this is not a recipe
EOM
end
it "should not raise an error" do
diff --git a/spec/unit/formatters/error_description_spec.rb b/spec/unit/formatters/error_description_spec.rb
index cf6372ed49..a09d295c9b 100644
--- a/spec/unit/formatters/error_description_spec.rb
+++ b/spec/unit/formatters/error_description_spec.rb
@@ -69,18 +69,18 @@ describe Chef::Formatters::ErrorDescription do
context "when no sections have been added" do
it "should output only the title and the Platform section" do
subject.display(out)
- expect(out.out.string).to eq <<-END
-================================================================================
-test title
-================================================================================
-
-System Info:
-------------
-chef_version=1.2.3
-ruby=ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin15]
-program_name=chef-client
-executable=/test/bin/chef-client
-
+ expect(out.out.string).to eq <<~END
+ ================================================================================
+ test title
+ ================================================================================
+
+ System Info:
+ ------------
+ chef_version=1.2.3
+ ruby=ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin15]
+ program_name=chef-client
+ executable=/test/bin/chef-client
+
END
end
end
@@ -92,22 +92,22 @@ executable=/test/bin/chef-client
it "should output the expected sections" do
subject.display(out)
- expect(out.out.string).to eq <<-END
-================================================================================
-test title
-================================================================================
-
-test heading
-------------
-test text
-
-System Info:
-------------
-chef_version=1.2.3
-ruby=ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin15]
-program_name=chef-client
-executable=/test/bin/chef-client
-
+ expect(out.out.string).to eq <<~END
+ ================================================================================
+ test title
+ ================================================================================
+
+ test heading
+ ------------
+ test text
+
+ System Info:
+ ------------
+ chef_version=1.2.3
+ ruby=ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin15]
+ program_name=chef-client
+ executable=/test/bin/chef-client
+
END
end
@@ -119,20 +119,20 @@ executable=/test/bin/chef-client
# reset on global values.
Chef.set_node({ "platform" => "openvms", "platform_version" => "8.4-2L1" })
subject.display(out)
- expect(out.out.string).to eq <<-END
-================================================================================
-test title
-================================================================================
-
-System Info:
-------------
-chef_version=1.2.3
-platform=openvms
-platform_version=8.4-2L1
-ruby=ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin15]
-program_name=chef-client
-executable=/test/bin/chef-client
-
+ expect(out.out.string).to eq <<~END
+ ================================================================================
+ test title
+ ================================================================================
+
+ System Info:
+ ------------
+ chef_version=1.2.3
+ platform=openvms
+ platform_version=8.4-2L1
+ ruby=ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin15]
+ program_name=chef-client
+ executable=/test/bin/chef-client
+
END
end
diff --git a/spec/unit/formatters/error_inspectors/compile_error_inspector_spec.rb b/spec/unit/formatters/error_inspectors/compile_error_inspector_spec.rb
index 2c1da7345b..9ec2c8d567 100644
--- a/spec/unit/formatters/error_inspectors/compile_error_inspector_spec.rb
+++ b/spec/unit/formatters/error_inspectors/compile_error_inspector_spec.rb
@@ -18,22 +18,22 @@
require "spec_helper"
-BAD_RECIPE = <<-E
-#
-# Cookbook Name:: syntax-err
-# Recipe:: default
-#
-# Copyright 2012-2016, YOUR_COMPANY_NAME
-#
-# All rights reserved - Do Not Redistribute
-#
-
-
-file "/tmp/explode-me" do
- mode 0655
- owner "root"
- this_is_not_a_valid_method
-end
+BAD_RECIPE = <<~E
+ #
+ # Cookbook Name:: syntax-err
+ # Recipe:: default
+ #
+ # Copyright 2012-2016, YOUR_COMPANY_NAME
+ #
+ # All rights reserved - Do Not Redistribute
+ #
+
+
+ file "/tmp/explode-me" do
+ mode 0655
+ owner "root"
+ this_is_not_a_valid_method
+ end
E
describe Chef::Formatters::ErrorInspectors::CompileErrorInspector do
diff --git a/spec/unit/http/authenticator_spec.rb b/spec/unit/http/authenticator_spec.rb
index c50a2c0481..4502bb651c 100644
--- a/spec/unit/http/authenticator_spec.rb
+++ b/spec/unit/http/authenticator_spec.rb
@@ -98,16 +98,16 @@ describe Chef::HTTP::Authenticator do
end
context "when ssh_agent_signing" do
- let(:public_key) { <<-EOH }
------BEGIN PUBLIC KEY-----
-MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA49TA0y81ps0zxkOpmf5V
-4/c4IeR5yVyQFpX3JpxO4TquwnRh8VSUhrw8kkTLmB3cS39Db+3HadvhoqCEbqPE
-6915kXSuk/cWIcNozujLK7tkuPEyYVsyTioQAddSdfe+8EhQVf3oHxaKmUd6waXr
-WqYCnhxgOjxocenREYNhZ/OETIeiPbOku47vB4nJK/0GhKBytL2XnsRgfKgDxf42
-BqAi1jglIdeq8lAWZNF9TbNBU21AO1iuT7Pm6LyQujhggPznR5FJhXKRUARXBJZa
-wxpGV4dGtdcahwXNE4601aXPra+xPcRd2puCNoEDBzgVuTSsLYeKBDMSfs173W1Q
-YwIDAQAB
------END PUBLIC KEY-----
+ let(:public_key) { <<~EOH }
+ -----BEGIN PUBLIC KEY-----
+ MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA49TA0y81ps0zxkOpmf5V
+ 4/c4IeR5yVyQFpX3JpxO4TquwnRh8VSUhrw8kkTLmB3cS39Db+3HadvhoqCEbqPE
+ 6915kXSuk/cWIcNozujLK7tkuPEyYVsyTioQAddSdfe+8EhQVf3oHxaKmUd6waXr
+ WqYCnhxgOjxocenREYNhZ/OETIeiPbOku47vB4nJK/0GhKBytL2XnsRgfKgDxf42
+ BqAi1jglIdeq8lAWZNF9TbNBU21AO1iuT7Pm6LyQujhggPznR5FJhXKRUARXBJZa
+ wxpGV4dGtdcahwXNE4601aXPra+xPcRd2puCNoEDBzgVuTSsLYeKBDMSfs173W1Q
+ YwIDAQAB
+ -----END PUBLIC KEY-----
EOH
let(:class_instance) { Chef::HTTP::Authenticator.new(client_name: "test", raw_key: public_key, ssh_agent_signing: true) }
diff --git a/spec/unit/key_spec.rb b/spec/unit/key_spec.rb
index 4af506d227..0809483577 100644
--- a/spec/unit/key_spec.rb
+++ b/spec/unit/key_spec.rb
@@ -24,16 +24,16 @@ describe Chef::Key do
# whether user or client irrelevent to these tests
let(:key) { Chef::Key.new("original_actor", "user") }
let(:public_key_string) do
- <<EOS
------BEGIN PUBLIC KEY-----
-MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvPo+oNPB7uuNkws0fC02
-KxSwdyqPLu0fhI1pOweNKAZeEIiEz2PkybathHWy8snSXGNxsITkf3eyvIIKa8OZ
-WrlqpI3yv/5DOP8HTMCxnFuMJQtDwMcevlqebX4bCxcByuBpNYDcAHjjfLGSfMjn
-E5lZpgYWwnpic4kSjYcL9ORK9nYvlWV9P/kCYmRhIjB4AhtpWRiOfY/TKi3P2LxT
-IjSmiN/ihHtlhV/VSnBJ5PzT/lRknlrJ4kACoz7Pq9jv+aAx5ft/xE9yDa2DYs0q
-Tfuc9dUYsFjptWYrV6pfEQ+bgo1OGBXORBFcFL+2D7u9JYquKrMgosznHoEkQNLo
-0wIDAQAB
------END PUBLIC KEY-----
+ <<~EOS
+ -----BEGIN PUBLIC KEY-----
+ MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvPo+oNPB7uuNkws0fC02
+ KxSwdyqPLu0fhI1pOweNKAZeEIiEz2PkybathHWy8snSXGNxsITkf3eyvIIKa8OZ
+ WrlqpI3yv/5DOP8HTMCxnFuMJQtDwMcevlqebX4bCxcByuBpNYDcAHjjfLGSfMjn
+ E5lZpgYWwnpic4kSjYcL9ORK9nYvlWV9P/kCYmRhIjB4AhtpWRiOfY/TKi3P2LxT
+ IjSmiN/ihHtlhV/VSnBJ5PzT/lRknlrJ4kACoz7Pq9jv+aAx5ft/xE9yDa2DYs0q
+ Tfuc9dUYsFjptWYrV6pfEQ+bgo1OGBXORBFcFL+2D7u9JYquKrMgosznHoEkQNLo
+ 0wIDAQAB
+ -----END PUBLIC KEY-----
EOS
end
diff --git a/spec/unit/knife/cookbook_upload_spec.rb b/spec/unit/knife/cookbook_upload_spec.rb
index 95ebe95fe7..7f890534bc 100644
--- a/spec/unit/knife/cookbook_upload_spec.rb
+++ b/spec/unit/knife/cookbook_upload_spec.rb
@@ -112,16 +112,16 @@ describe Chef::Knife::CookbookUpload do
it "emits a warning" do
knife.run
- expected_message = <<-E
-WARNING: The cookbooks: test_cookbook exist in multiple places in your cookbook_path.
-A composite version of these cookbooks has been compiled for uploading.
-
-IMPORTANT: In a future version of Chef, this behavior will be removed and you will no longer
-be able to have the same version of a cookbook in multiple places in your cookbook_path.
-WARNING: The affected cookbooks are located:
-test_cookbook:
- /path/one/test_cookbook
- /path/two/test_cookbook
+ expected_message = <<~E
+ WARNING: The cookbooks: test_cookbook exist in multiple places in your cookbook_path.
+ A composite version of these cookbooks has been compiled for uploading.
+
+ IMPORTANT: In a future version of Chef, this behavior will be removed and you will no longer
+ be able to have the same version of a cookbook in multiple places in your cookbook_path.
+ WARNING: The affected cookbooks are located:
+ test_cookbook:
+ /path/one/test_cookbook
+ /path/two/test_cookbook
E
expect(output.string).to include(expected_message)
end
diff --git a/spec/unit/knife/core/bootstrap_context_spec.rb b/spec/unit/knife/core/bootstrap_context_spec.rb
index 7ee177a7d1..bd48709a93 100644
--- a/spec/unit/knife/core/bootstrap_context_spec.rb
+++ b/spec/unit/knife/core/bootstrap_context_spec.rb
@@ -69,12 +69,12 @@ describe Chef::Knife::Core::BootstrapContext do
end
it "generates the config file data" do
- expected = <<-EXPECTED
-chef_server_url "http://chef.example.com:4444"
-validation_client_name "chef-validator-testing"
-log_level :info
-log_location "/tmp/log"
-# Using default node name (fqdn)
+ expected = <<~EXPECTED
+ chef_server_url "http://chef.example.com:4444"
+ validation_client_name "chef-validator-testing"
+ log_level :info
+ log_location "/tmp/log"
+ # Using default node name (fqdn)
EXPECTED
expect(bootstrap_context.config_content).to eq expected
end
diff --git a/spec/unit/knife/core/ui_spec.rb b/spec/unit/knife/core/ui_spec.rb
index c2b87cca38..65463005c9 100644
--- a/spec/unit/knife/core/ui_spec.rb
+++ b/spec/unit/knife/core/ui_spec.rb
@@ -211,9 +211,9 @@ describe Chef::Knife::UI do
it "formats hashes appropriately" do
@ui.output({ "hi" => "a", "lo" => "b" })
- expect(@out.string).to eq <<EOM
-hi: a
-lo: b
+ expect(@out.string).to eq <<~EOM
+ hi: a
+ lo: b
EOM
end
@@ -224,9 +224,9 @@ EOM
it "formats arrays appropriately" do
@ui.output(%w{a b})
- expect(@out.string).to eq <<EOM
-a
-b
+ expect(@out.string).to eq <<~EOM
+ a
+ b
EOM
end
@@ -247,74 +247,74 @@ EOM
it "formats nested arrays appropriately" do
@ui.output([ %w{a b}, %w{c d}])
- expect(@out.string).to eq <<EOM
-a
-b
-
-c
-d
+ expect(@out.string).to eq <<~EOM
+ a
+ b
+
+ c
+ d
EOM
end
it "formats nested arrays with single- and empty subarrays appropriately" do
@ui.output([ %w{a b}, [ "c" ], [], %w{d e}])
- expect(@out.string).to eq <<EOM
-a
-b
-
-c
-
-
-d
-e
+ expect(@out.string).to eq <<~EOM
+ a
+ b
+
+ c
+
+
+ d
+ e
EOM
end
it "formats arrays of hashes with extra lines in between for readability" do
@ui.output([ { "a" => "b", "c" => "d" }, { "x" => "y" }, { "m" => "n", "o" => "p" }])
- expect(@out.string).to eq <<EOM
-a: b
-c: d
-
-x: y
-
-m: n
-o: p
+ expect(@out.string).to eq <<~EOM
+ a: b
+ c: d
+
+ x: y
+
+ m: n
+ o: p
EOM
end
it "formats hashes with empty array members appropriately" do
@ui.output({ "a" => [], "b" => "c" })
- expect(@out.string).to eq <<EOM
-a:
-b: c
+ expect(@out.string).to eq <<~EOM
+ a:
+ b: c
EOM
end
it "formats hashes with single-member array values appropriately" do
@ui.output({ "a" => [ "foo" ], "b" => "c" })
- expect(@out.string).to eq <<EOM
-a: foo
-b: c
+ expect(@out.string).to eq <<~EOM
+ a: foo
+ b: c
EOM
end
it "formats hashes with array members appropriately" do
@ui.output({ "a" => %w{foo bar}, "b" => "c" })
- expect(@out.string).to eq <<EOM
-a:
- foo
- bar
-b: c
+ expect(@out.string).to eq <<~EOM
+ a:
+ foo
+ bar
+ b: c
EOM
end
it "formats hashes with single-member nested array values appropriately" do
@ui.output({ "a" => [ [ "foo" ] ], "b" => "c" })
- expect(@out.string).to eq <<EOM
-a:
- foo
-b: c
+ expect(@out.string).to eq <<~EOM
+ a:
+ foo
+ b: c
EOM
end
@@ -327,19 +327,19 @@ EOM
it "formats hashes with hash values appropriately" do
@ui.output({ "a" => { "aa" => "bb", "cc" => "dd" }, "b" => "c" })
- expect(@out.string).to eq <<EOM
-a:
- aa: bb
- cc: dd
-b: c
+ expect(@out.string).to eq <<~EOM
+ a:
+ aa: bb
+ cc: dd
+ b: c
EOM
end
it "formats hashes with empty hash values appropriately" do
@ui.output({ "a" => {}, "b" => "c" })
- expect(@out.string).to eq <<EOM
-a:
-b: c
+ expect(@out.string).to eq <<~EOM
+ a:
+ b: c
EOM
end
end
diff --git a/spec/unit/knife/ssl_check_spec.rb b/spec/unit/knife/ssl_check_spec.rb
index 8aa18c3abc..9f0c191323 100644
--- a/spec/unit/knife/ssl_check_spec.rb
+++ b/spec/unit/knife/ssl_check_spec.rb
@@ -67,11 +67,11 @@ describe Chef::Knife::SslCheck do
it "prints an error and exits" do
expect { ssl_check.run }.to raise_error(SystemExit)
- expected_stdout = <<-E
-USAGE: knife ssl check [URL] (options)
+ expected_stdout = <<~E
+ USAGE: knife ssl check [URL] (options)
E
- expected_stderr = <<-E
-ERROR: Given URI: `foo.test' is invalid
+ expected_stderr = <<~E
+ ERROR: Given URI: `foo.test' is invalid
E
expect(stdout_io.string).to eq(expected_stdout)
expect(stderr_io.string).to eq(expected_stderr)
@@ -83,11 +83,11 @@ E
it "prints an error and exits" do
expect { ssl_check.run }.to raise_error(SystemExit)
- expected_stdout = <<-E
-USAGE: knife ssl check [URL] (options)
+ expected_stdout = <<~E
+ USAGE: knife ssl check [URL] (options)
E
- expected_stderr = <<-E
-ERROR: Given URI: `#{name_args[0]}' is invalid
+ expected_stderr = <<~E
+ ERROR: Given URI: `#{name_args[0]}' is invalid
E
expect(stdout_io.string).to eq(expected_stdout)
expect(stderr_io.string).to eq(expected_stderr)
diff --git a/spec/unit/knife/ssl_fetch_spec.rb b/spec/unit/knife/ssl_fetch_spec.rb
index bc49c40241..45dd27ceec 100644
--- a/spec/unit/knife/ssl_fetch_spec.rb
+++ b/spec/unit/knife/ssl_fetch_spec.rb
@@ -68,11 +68,11 @@ describe Chef::Knife::SslFetch do
it "prints an error and exits" do
expect { ssl_fetch.run }.to raise_error(SystemExit)
- expected_stdout = <<-E
-USAGE: knife ssl fetch [URL] (options)
+ expected_stdout = <<~E
+ USAGE: knife ssl fetch [URL] (options)
E
- expected_stderr = <<-E
-ERROR: Given URI: `foo.test' is invalid
+ expected_stderr = <<~E
+ ERROR: Given URI: `foo.test' is invalid
E
expect(stdout_io.string).to eq(expected_stdout)
expect(stderr_io.string).to eq(expected_stderr)
@@ -84,11 +84,11 @@ E
it "prints an error and exits" do
expect { ssl_fetch.run }.to raise_error(SystemExit)
- expected_stdout = <<-E
-USAGE: knife ssl fetch [URL] (options)
+ expected_stdout = <<~E
+ USAGE: knife ssl fetch [URL] (options)
E
- expected_stderr = <<-E
-ERROR: Given URI: `#{name_args[0]}' is invalid
+ expected_stderr = <<~E
+ ERROR: Given URI: `#{name_args[0]}' is invalid
E
expect(stdout_io.string).to eq(expected_stdout)
expect(stderr_io.string).to eq(expected_stderr)
@@ -187,9 +187,9 @@ E
end
it "tells the user their URL is for a non-ssl service" do
- expected_error_text = <<-ERROR_TEXT
-ERROR: The service at the given URI (http://foo.example.com) does not accept SSL connections
-ERROR: Perhaps you meant to connect to 'https://foo.example.com'?
+ expected_error_text = <<~ERROR_TEXT
+ ERROR: The service at the given URI (http://foo.example.com) does not accept SSL connections
+ ERROR: Perhaps you meant to connect to 'https://foo.example.com'?
ERROR_TEXT
run
diff --git a/spec/unit/knife_spec.rb b/spec/unit/knife_spec.rb
index 86fe59ca58..443e21659e 100644
--- a/spec/unit/knife_spec.rb
+++ b/spec/unit/knife_spec.rb
@@ -571,11 +571,11 @@ describe Chef::Knife do
knife.run_with_pretty_exceptions
- expected_message = <<-MSG
-ERROR: Could not establish a secure connection to the server.
-Use `knife ssl check` to troubleshoot your SSL configuration.
-If your Chef Server uses a self-signed certificate, you can use
-`knife ssl fetch` to make knife trust the server's certificates.
+ expected_message = <<~MSG
+ ERROR: Could not establish a secure connection to the server.
+ Use `knife ssl check` to troubleshoot your SSL configuration.
+ If your Chef Server uses a self-signed certificate, you can use
+ `knife ssl fetch` to make knife trust the server's certificates.
MSG
expect(stderr.string).to include(expected_message)
end
diff --git a/spec/unit/provider/apt_repository_spec.rb b/spec/unit/provider/apt_repository_spec.rb
index 54f1f2df66..8ea2b9b823 100644
--- a/spec/unit/provider/apt_repository_spec.rb
+++ b/spec/unit/provider/apt_repository_spec.rb
@@ -23,25 +23,25 @@ require "spec_helper"
#
# Output of the command:
# => apt-key adv --list-public-keys --with-fingerprint --with-colons
-APT_KEY_FINGER = <<-EOF
-tru:t:1:1488924856:0:3:1:5
-pub:-:1024:17:40976EAF437D05B5:2004-09-12:::-:Ubuntu Archive Automatic Signing Key <ftpmaster@ubuntu.com>::scESC:
-fpr:::::::::630239CC130E1A7FD81A27B140976EAF437D05B5:
-sub:-:2048:16:251BEFF479164387:2004-09-12::::::e:
-pub:-:1024:17:46181433FBB75451:2004-12-30:::-:Ubuntu CD Image Automatic Signing Key <cdimage@ubuntu.com>::scSC:
-fpr:::::::::C5986B4F1257FFA86632CBA746181433FBB75451:
-pub:-:4096:1:3B4FE6ACC0B21F32:2012-05-11:::-:Ubuntu Archive Automatic Signing Key (2012) <ftpmaster@ubuntu.com>::scSC:
-fpr:::::::::790BC7277767219C42C86F933B4FE6ACC0B21F32:
-pub:-:4096:1:D94AA3F0EFE21092:2012-05-11:::-:Ubuntu CD Image Automatic Signing Key (2012) <cdimage@ubuntu.com>::scSC:
-fpr:::::::::843938DF228D22F7B3742BC0D94AA3F0EFE21092:
+APT_KEY_FINGER = <<~EOF
+ tru:t:1:1488924856:0:3:1:5
+ pub:-:1024:17:40976EAF437D05B5:2004-09-12:::-:Ubuntu Archive Automatic Signing Key <ftpmaster@ubuntu.com>::scESC:
+ fpr:::::::::630239CC130E1A7FD81A27B140976EAF437D05B5:
+ sub:-:2048:16:251BEFF479164387:2004-09-12::::::e:
+ pub:-:1024:17:46181433FBB75451:2004-12-30:::-:Ubuntu CD Image Automatic Signing Key <cdimage@ubuntu.com>::scSC:
+ fpr:::::::::C5986B4F1257FFA86632CBA746181433FBB75451:
+ pub:-:4096:1:3B4FE6ACC0B21F32:2012-05-11:::-:Ubuntu Archive Automatic Signing Key (2012) <ftpmaster@ubuntu.com>::scSC:
+ fpr:::::::::790BC7277767219C42C86F933B4FE6ACC0B21F32:
+ pub:-:4096:1:D94AA3F0EFE21092:2012-05-11:::-:Ubuntu CD Image Automatic Signing Key (2012) <cdimage@ubuntu.com>::scSC:
+ fpr:::::::::843938DF228D22F7B3742BC0D94AA3F0EFE21092:
EOF
# Output of the command:
# => gpg --with-fingerprint --with-colons [FILE]
-GPG_FINGER = <<-EOF
-pub:-:1024:17:327574EE02A818DD:2009-04-22:::-:Cloudera Apt Repository:
-fpr:::::::::F36A89E33CC1BD0F71079007327574EE02A818DD:
-sub:-:2048:16:84080586D1CA74A1:2009-04-22::::
+GPG_FINGER = <<~EOF
+ pub:-:1024:17:327574EE02A818DD:2009-04-22:::-:Cloudera Apt Repository:
+ fpr:::::::::F36A89E33CC1BD0F71079007327574EE02A818DD:
+ sub:-:2048:16:84080586D1CA74A1:2009-04-22::::
EOF
describe Chef::Provider::AptRepository do
diff --git a/spec/unit/provider/cron/unix_spec.rb b/spec/unit/provider/cron/unix_spec.rb
index 843f3f3d8c..6c4caa4656 100644
--- a/spec/unit/provider/cron/unix_spec.rb
+++ b/spec/unit/provider/cron/unix_spec.rb
@@ -53,13 +53,13 @@ describe Chef::Provider::Cron::Unix do
describe "read_crontab" do
let(:stderr) { "" }
let(:stdout) do
- String.new(<<-CRONTAB)
-0 2 * * * /some/other/command
-
-# Chef Name: something else
-* 5 * * * /bin/true
-
-# Another comment
+ String.new(<<~CRONTAB)
+ 0 2 * * * /some/other/command
+
+ # Chef Name: something else
+ * 5 * * * /bin/true
+
+ # Another comment
CRONTAB
end
diff --git a/spec/unit/provider/cron_spec.rb b/spec/unit/provider/cron_spec.rb
index 5673ecc317..50ebff779d 100644
--- a/spec/unit/provider/cron_spec.rb
+++ b/spec/unit/provider/cron_spec.rb
@@ -42,15 +42,15 @@ describe Chef::Provider::Cron do
context "with a matching entry in the user's crontab" do
before :each do
- allow(@provider).to receive(:read_crontab).and_return(<<-CRONTAB)
-0 2 * * * /some/other/command
-
-# Chef Name: cronhole some stuff
-@reboot /bin/true param1 param2
-# Chef Name: something else
-2 * 1 * * /bin/false
-
-# Another comment
+ allow(@provider).to receive(:read_crontab).and_return(<<~CRONTAB)
+ 0 2 * * * /some/other/command
+
+ # Chef Name: cronhole some stuff
+ @reboot /bin/true param1 param2
+ # Chef Name: something else
+ 2 * 1 * * /bin/false
+
+ # Another comment
CRONTAB
end
@@ -67,19 +67,19 @@ CRONTAB
end
it "should pull env vars out" do
- allow(@provider).to receive(:read_crontab).and_return(<<-CRONTAB)
-0 2 * * * /some/other/command
-
-# Chef Name: cronhole some stuff
-MAILTO=foo@example.com
-SHELL=/bin/foosh
-PATH=/bin:/foo
-HOME=/home/foo
-@reboot /bin/true param1 param2
-# Chef Name: something else
-2 * 1 * * /bin/false
-
-# Another comment
+ allow(@provider).to receive(:read_crontab).and_return(<<~CRONTAB)
+ 0 2 * * * /some/other/command
+
+ # Chef Name: cronhole some stuff
+ MAILTO=foo@example.com
+ SHELL=/bin/foosh
+ PATH=/bin:/foo
+ HOME=/home/foo
+ @reboot /bin/true param1 param2
+ # Chef Name: something else
+ 2 * 1 * * /bin/false
+
+ # Another comment
CRONTAB
cron = @provider.load_current_resource
expect(cron.mailto).to eq("foo@example.com")
@@ -91,12 +91,12 @@ CRONTAB
end
it "should parse and load generic and standard environment variables from cron entry" do
- allow(@provider).to receive(:read_crontab).and_return(<<-CRONTAB)
-# Chef Name: cronhole some stuff
-MAILTO=warn@example.com
-TEST=lol
-FLAG=1
-@reboot /bin/true
+ allow(@provider).to receive(:read_crontab).and_return(<<~CRONTAB)
+ # Chef Name: cronhole some stuff
+ MAILTO=warn@example.com
+ TEST=lol
+ FLAG=1
+ @reboot /bin/true
CRONTAB
cron = @provider.load_current_resource
@@ -105,13 +105,13 @@ CRONTAB
end
it "should not break with variables that match the cron resource internals" do
- allow(@provider).to receive(:read_crontab).and_return(<<-CRONTAB)
-# Chef Name: cronhole some stuff
-MINUTE=40
-REBOOT=midnight
-TEST=lol
-ENVIRONMENT=production
-@reboot /bin/true
+ allow(@provider).to receive(:read_crontab).and_return(<<~CRONTAB)
+ # Chef Name: cronhole some stuff
+ MINUTE=40
+ REBOOT=midnight
+ TEST=lol
+ ENVIRONMENT=production
+ @reboot /bin/true
CRONTAB
cron = @provider.load_current_resource
@@ -137,9 +137,9 @@ CRONTAB
end
it "should create a crontab with the entry" do
- expect(@provider).to receive(:write_crontab).with(<<-ENDCRON)
-# Chef Name: cronhole some stuff
-@reboot /bin/true
+ expect(@provider).to receive(:write_crontab).with(<<~ENDCRON)
+ # Chef Name: cronhole some stuff
+ @reboot /bin/true
ENDCRON
@provider.run_action(:create)
end
@@ -168,13 +168,13 @@ CRONTAB
context "with no matching entry in the user's crontab" do
before :each do
- allow(@provider).to receive(:read_crontab).and_return(<<-CRONTAB)
-0 2 * * * /some/other/command
-
-# Chef Name: something else
-* 5 * * * /bin/true
-
-# Another comment
+ allow(@provider).to receive(:read_crontab).and_return(<<~CRONTAB)
+ 0 2 * * * /some/other/command
+
+ # Chef Name: something else
+ * 5 * * * /bin/true
+
+ # Another comment
CRONTAB
end
@@ -190,9 +190,9 @@ CRONTAB
end
it "should not fail if there's an existing cron with a numerical argument" do
- allow(@provider).to receive(:read_crontab).and_return(<<-CRONTAB)
-# Chef Name: foo[bar] (baz)
-21 */4 * * * some_prog 1234567
+ allow(@provider).to receive(:read_crontab).and_return(<<~CRONTAB)
+ # Chef Name: foo[bar] (baz)
+ 21 */4 * * * some_prog 1234567
CRONTAB
expect do
@provider.load_current_resource
@@ -202,15 +202,15 @@ CRONTAB
context "with a matching entry in the user's crontab" do
before :each do
- allow(@provider).to receive(:read_crontab).and_return(<<-CRONTAB)
-0 2 * * * /some/other/command
-
-# Chef Name: cronhole some stuff
-* 5 * 1 * /bin/true param1 param2
-# Chef Name: something else
-2 * 1 * * /bin/false
-
-# Another comment
+ allow(@provider).to receive(:read_crontab).and_return(<<~CRONTAB)
+ 0 2 * * * /some/other/command
+
+ # Chef Name: cronhole some stuff
+ * 5 * 1 * /bin/true param1 param2
+ # Chef Name: something else
+ 2 * 1 * * /bin/false
+
+ # Another comment
CRONTAB
end
@@ -232,19 +232,19 @@ CRONTAB
end
it "should pull env vars out" do
- allow(@provider).to receive(:read_crontab).and_return(<<-CRONTAB)
-0 2 * * * /some/other/command
-
-# Chef Name: cronhole some stuff
-MAILTO=foo@example.com
-SHELL=/bin/foosh
-PATH=/bin:/foo
-HOME=/home/foo
-* 5 * 1 * /bin/true param1 param2
-# Chef Name: something else
-2 * 1 * * /bin/false
-
-# Another comment
+ allow(@provider).to receive(:read_crontab).and_return(<<~CRONTAB)
+ 0 2 * * * /some/other/command
+
+ # Chef Name: cronhole some stuff
+ MAILTO=foo@example.com
+ SHELL=/bin/foosh
+ PATH=/bin:/foo
+ HOME=/home/foo
+ * 5 * 1 * /bin/true param1 param2
+ # Chef Name: something else
+ 2 * 1 * * /bin/false
+
+ # Another comment
CRONTAB
cron = @provider.load_current_resource
expect(cron.mailto).to eq("foo@example.com")
@@ -261,12 +261,12 @@ CRONTAB
end
it "should parse and load generic and standard environment variables from cron entry" do
- allow(@provider).to receive(:read_crontab).and_return(<<-CRONTAB)
-# Chef Name: cronhole some stuff
-MAILTO=warn@example.com
-TEST=lol
-FLAG=1
-* 5 * * * /bin/true
+ allow(@provider).to receive(:read_crontab).and_return(<<~CRONTAB)
+ # Chef Name: cronhole some stuff
+ MAILTO=warn@example.com
+ TEST=lol
+ FLAG=1
+ * 5 * * * /bin/true
CRONTAB
cron = @provider.load_current_resource
@@ -275,13 +275,13 @@ CRONTAB
end
it "should not break with variabels that match the cron resource internals" do
- allow(@provider).to receive(:read_crontab).and_return(<<-CRONTAB)
-# Chef Name: cronhole some stuff
-MINUTE=40
-HOUR=midnight
-TEST=lol
-ENVIRONMENT=production
-* 5 * * * /bin/true
+ allow(@provider).to receive(:read_crontab).and_return(<<~CRONTAB)
+ # Chef Name: cronhole some stuff
+ MINUTE=40
+ HOUR=midnight
+ TEST=lol
+ ENVIRONMENT=production
+ * 5 * * * /bin/true
CRONTAB
cron = @provider.load_current_resource
@@ -298,15 +298,15 @@ CRONTAB
context "with a matching entry in the user's crontab using month names and weekday names (#CHEF-3178)" do
before :each do
- allow(@provider).to receive(:read_crontab).and_return(<<-CRONTAB)
-0 2 * * * /some/other/command
-
-# Chef Name: cronhole some stuff
-* 5 * Jan Mon /bin/true param1 param2
-# Chef Name: something else
-2 * 1 * * /bin/false
-
-# Another comment
+ allow(@provider).to receive(:read_crontab).and_return(<<~CRONTAB)
+ 0 2 * * * /some/other/command
+
+ # Chef Name: cronhole some stuff
+ * 5 * Jan Mon /bin/true param1 param2
+ # Chef Name: something else
+ 2 * 1 * * /bin/false
+
+ # Another comment
CRONTAB
end
@@ -334,10 +334,10 @@ CRONTAB
context "with a matching entry without a crontab line" do
it "should set cron_exists and leave current_resource values at defaults" do
- allow(@provider).to receive(:read_crontab).and_return(<<-CRONTAB)
-0 2 * * * /some/other/command
-
-# Chef Name: cronhole some stuff
+ allow(@provider).to receive(:read_crontab).and_return(<<~CRONTAB)
+ 0 2 * * * /some/other/command
+
+ # Chef Name: cronhole some stuff
CRONTAB
cron = @provider.load_current_resource
expect(@provider.cron_exists).to eq(true)
@@ -351,11 +351,11 @@ CRONTAB
end
it "should not pick up a commented out crontab line" do
- allow(@provider).to receive(:read_crontab).and_return(<<-CRONTAB)
-0 2 * * * /some/other/command
-
-# Chef Name: cronhole some stuff
-#* 5 * 1 * /bin/true param1 param2
+ allow(@provider).to receive(:read_crontab).and_return(<<~CRONTAB)
+ 0 2 * * * /some/other/command
+
+ # Chef Name: cronhole some stuff
+ #* 5 * 1 * /bin/true param1 param2
CRONTAB
cron = @provider.load_current_resource
expect(@provider.cron_exists).to eq(true)
@@ -369,15 +369,15 @@ CRONTAB
end
it "should not pick up a later crontab entry" do
- allow(@provider).to receive(:read_crontab).and_return(<<-CRONTAB)
-0 2 * * * /some/other/command
-
-# Chef Name: cronhole some stuff
-#* 5 * 1 * /bin/true param1 param2
-# Chef Name: something else
-2 * 1 * * /bin/false
-
-# Another comment
+ allow(@provider).to receive(:read_crontab).and_return(<<~CRONTAB)
+ 0 2 * * * /some/other/command
+
+ # Chef Name: cronhole some stuff
+ #* 5 * 1 * /bin/true param1 param2
+ # Chef Name: something else
+ 2 * 1 * * /bin/false
+
+ # Another comment
CRONTAB
cron = @provider.load_current_resource
expect(@provider.cron_exists).to eq(true)
@@ -442,9 +442,9 @@ CRONTAB
end
it "should create a crontab with the entry" do
- expect(@provider).to receive(:write_crontab).with(<<-ENDCRON)
-# Chef Name: cronhole some stuff
-30 * * * * /bin/true
+ expect(@provider).to receive(:write_crontab).with(<<~ENDCRON)
+ # Chef Name: cronhole some stuff
+ 30 * * * * /bin/true
ENDCRON
@provider.run_action(:create)
end
@@ -455,14 +455,14 @@ CRONTAB
@new_resource.shell "/bin/foosh"
@new_resource.home "/home/foo"
@new_resource.environment "TEST" => "LOL"
- expect(@provider).to receive(:write_crontab).with(<<-ENDCRON)
-# Chef Name: cronhole some stuff
-MAILTO="foo@example.com"
-PATH="/usr/bin:/my/custom/path"
-SHELL="/bin/foosh"
-HOME="/home/foo"
-TEST=LOL
-30 * * * * /bin/true
+ expect(@provider).to receive(:write_crontab).with(<<~ENDCRON)
+ # Chef Name: cronhole some stuff
+ MAILTO="foo@example.com"
+ PATH="/usr/bin:/my/custom/path"
+ SHELL="/bin/foosh"
+ HOME="/home/foo"
+ TEST=LOL
+ 30 * * * * /bin/true
ENDCRON
@provider.run_action(:create)
end
@@ -481,26 +481,26 @@ TEST=LOL
context "when there is a crontab with no matching section" do
before :each do
@provider.cron_exists = false
- allow(@provider).to receive(:read_crontab).and_return(<<-CRONTAB)
-0 2 * * * /some/other/command
-
-# Chef Name: something else
-2 * 1 * * /bin/false
-
-# Another comment
+ allow(@provider).to receive(:read_crontab).and_return(<<~CRONTAB)
+ 0 2 * * * /some/other/command
+
+ # Chef Name: something else
+ 2 * 1 * * /bin/false
+
+ # Another comment
CRONTAB
end
it "should add the entry to the crontab" do
- expect(@provider).to receive(:write_crontab).with(<<-ENDCRON)
-0 2 * * * /some/other/command
-
-# Chef Name: something else
-2 * 1 * * /bin/false
-
-# Another comment
-# Chef Name: cronhole some stuff
-30 * * * * /bin/true
+ expect(@provider).to receive(:write_crontab).with(<<~ENDCRON)
+ 0 2 * * * /some/other/command
+
+ # Chef Name: something else
+ 2 * 1 * * /bin/false
+
+ # Another comment
+ # Chef Name: cronhole some stuff
+ 30 * * * * /bin/true
ENDCRON
@provider.run_action(:create)
end
@@ -511,20 +511,20 @@ TEST=LOL
@new_resource.shell "/bin/foosh"
@new_resource.home "/home/foo"
@new_resource.environment "TEST" => "LOL"
- expect(@provider).to receive(:write_crontab).with(<<-ENDCRON)
-0 2 * * * /some/other/command
-
-# Chef Name: something else
-2 * 1 * * /bin/false
-
-# Another comment
-# Chef Name: cronhole some stuff
-MAILTO="foo@example.com"
-PATH="/usr/bin:/my/custom/path"
-SHELL="/bin/foosh"
-HOME="/home/foo"
-TEST=LOL
-30 * * * * /bin/true
+ expect(@provider).to receive(:write_crontab).with(<<~ENDCRON)
+ 0 2 * * * /some/other/command
+
+ # Chef Name: something else
+ 2 * 1 * * /bin/false
+
+ # Another comment
+ # Chef Name: cronhole some stuff
+ MAILTO="foo@example.com"
+ PATH="/usr/bin:/my/custom/path"
+ SHELL="/bin/foosh"
+ HOME="/home/foo"
+ TEST=LOL
+ 30 * * * * /bin/true
ENDCRON
@provider.run_action(:create)
end
@@ -544,28 +544,28 @@ TEST=LOL
before :each do
@provider.cron_exists = true
allow(@provider).to receive(:cron_different?).and_return(true)
- allow(@provider).to receive(:read_crontab).and_return(<<-CRONTAB)
-0 2 * * * /some/other/command
-
-# Chef Name: cronhole some stuff
-30 * * 3 * /bin/true
-# Chef Name: something else
-2 * 1 * * /bin/false
-
-# Another comment
+ allow(@provider).to receive(:read_crontab).and_return(<<~CRONTAB)
+ 0 2 * * * /some/other/command
+
+ # Chef Name: cronhole some stuff
+ 30 * * 3 * /bin/true
+ # Chef Name: something else
+ 2 * 1 * * /bin/false
+
+ # Another comment
CRONTAB
end
it "should update the crontab entry" do
- expect(@provider).to receive(:write_crontab).with(<<-ENDCRON)
-0 2 * * * /some/other/command
-
-# Chef Name: cronhole some stuff
-30 * * * * /bin/true
-# Chef Name: something else
-2 * 1 * * /bin/false
-
-# Another comment
+ expect(@provider).to receive(:write_crontab).with(<<~ENDCRON)
+ 0 2 * * * /some/other/command
+
+ # Chef Name: cronhole some stuff
+ 30 * * * * /bin/true
+ # Chef Name: something else
+ 2 * 1 * * /bin/false
+
+ # Another comment
ENDCRON
@provider.run_action(:create)
end
@@ -576,20 +576,20 @@ TEST=LOL
@new_resource.shell "/bin/foosh"
@new_resource.home "/home/foo"
@new_resource.environment "TEST" => "LOL"
- expect(@provider).to receive(:write_crontab).with(<<-ENDCRON)
-0 2 * * * /some/other/command
-
-# Chef Name: cronhole some stuff
-MAILTO="foo@example.com"
-PATH="/usr/bin:/my/custom/path"
-SHELL="/bin/foosh"
-HOME="/home/foo"
-TEST=LOL
-30 * * * * /bin/true
-# Chef Name: something else
-2 * 1 * * /bin/false
-
-# Another comment
+ expect(@provider).to receive(:write_crontab).with(<<~ENDCRON)
+ 0 2 * * * /some/other/command
+
+ # Chef Name: cronhole some stuff
+ MAILTO="foo@example.com"
+ PATH="/usr/bin:/my/custom/path"
+ SHELL="/bin/foosh"
+ HOME="/home/foo"
+ TEST=LOL
+ 30 * * * * /bin/true
+ # Chef Name: something else
+ 2 * 1 * * /bin/false
+
+ # Another comment
ENDCRON
@provider.run_action(:create)
end
@@ -612,78 +612,78 @@ TEST=LOL
end
it "should add the crontab to the entry" do
- allow(@provider).to receive(:read_crontab).and_return(<<-CRONTAB)
-0 2 * * * /some/other/command
-
-# Chef Name: cronhole some stuff
+ allow(@provider).to receive(:read_crontab).and_return(<<~CRONTAB)
+ 0 2 * * * /some/other/command
+
+ # Chef Name: cronhole some stuff
CRONTAB
- expect(@provider).to receive(:write_crontab).with(<<-ENDCRON)
-0 2 * * * /some/other/command
-
-# Chef Name: cronhole some stuff
-30 * * * * /bin/true
+ expect(@provider).to receive(:write_crontab).with(<<~ENDCRON)
+ 0 2 * * * /some/other/command
+
+ # Chef Name: cronhole some stuff
+ 30 * * * * /bin/true
ENDCRON
@provider.run_action(:create)
end
it "should not blat any following entries" do
- allow(@provider).to receive(:read_crontab).and_return(<<-CRONTAB)
-0 2 * * * /some/other/command
-
-# Chef Name: cronhole some stuff
-#30 * * * * /bin/true
-# Chef Name: something else
-2 * 1 * * /bin/false
-
-# Another comment
+ allow(@provider).to receive(:read_crontab).and_return(<<~CRONTAB)
+ 0 2 * * * /some/other/command
+
+ # Chef Name: cronhole some stuff
+ #30 * * * * /bin/true
+ # Chef Name: something else
+ 2 * 1 * * /bin/false
+
+ # Another comment
CRONTAB
- expect(@provider).to receive(:write_crontab).with(<<-ENDCRON)
-0 2 * * * /some/other/command
-
-# Chef Name: cronhole some stuff
-30 * * * * /bin/true
-#30 * * * * /bin/true
-# Chef Name: something else
-2 * 1 * * /bin/false
-
-# Another comment
+ expect(@provider).to receive(:write_crontab).with(<<~ENDCRON)
+ 0 2 * * * /some/other/command
+
+ # Chef Name: cronhole some stuff
+ 30 * * * * /bin/true
+ #30 * * * * /bin/true
+ # Chef Name: something else
+ 2 * 1 * * /bin/false
+
+ # Another comment
ENDCRON
@provider.run_action(:create)
end
it "should handle env vars with no crontab" do
- allow(@provider).to receive(:read_crontab).and_return(<<-CRONTAB)
-0 2 * * * /some/other/command
-
-# Chef Name: cronhole some stuff
-MAILTO=bar@example.com
-PATH=/usr/bin:/my/custom/path
-SHELL=/bin/barsh
-HOME=/home/foo
-
-# Chef Name: something else
-2 * 1 * * /bin/false
-
-# Another comment
+ allow(@provider).to receive(:read_crontab).and_return(<<~CRONTAB)
+ 0 2 * * * /some/other/command
+
+ # Chef Name: cronhole some stuff
+ MAILTO=bar@example.com
+ PATH=/usr/bin:/my/custom/path
+ SHELL=/bin/barsh
+ HOME=/home/foo
+
+ # Chef Name: something else
+ 2 * 1 * * /bin/false
+
+ # Another comment
CRONTAB
@new_resource.mailto "foo@example.com"
@new_resource.path "/usr/bin:/my/custom/path"
@new_resource.shell "/bin/foosh"
@new_resource.home "/home/foo"
- expect(@provider).to receive(:write_crontab).with(<<-ENDCRON)
-0 2 * * * /some/other/command
-
-# Chef Name: cronhole some stuff
-MAILTO="foo@example.com"
-PATH="/usr/bin:/my/custom/path"
-SHELL="/bin/foosh"
-HOME="/home/foo"
-30 * * * * /bin/true
-
-# Chef Name: something else
-2 * 1 * * /bin/false
-
-# Another comment
+ expect(@provider).to receive(:write_crontab).with(<<~ENDCRON)
+ 0 2 * * * /some/other/command
+
+ # Chef Name: cronhole some stuff
+ MAILTO="foo@example.com"
+ PATH="/usr/bin:/my/custom/path"
+ SHELL="/bin/foosh"
+ HOME="/home/foo"
+ 30 * * * * /bin/true
+
+ # Chef Name: something else
+ 2 * 1 * * /bin/false
+
+ # Another comment
ENDCRON
@provider.run_action(:create)
end
@@ -693,13 +693,13 @@ HOME="/home/foo"
before :each do
@provider.cron_exists = true
allow(@provider).to receive(:cron_different?).and_return(false)
- allow(@provider).to receive(:read_crontab).and_return(<<-CRONTAB)
-0 2 * * * /some/other/command
-
-# Chef Name: cronhole some stuff
-* 5 * * * /bin/true
-
-# Another comment
+ allow(@provider).to receive(:read_crontab).and_return(<<~CRONTAB)
+ 0 2 * * * /some/other/command
+
+ # Chef Name: cronhole some stuff
+ * 5 * * * /bin/true
+
+ # Another comment
CRONTAB
end
@@ -747,50 +747,50 @@ CRONTAB
context "when the user has a crontab with a matching section" do
before :each do
@provider.cron_exists = true
- allow(@provider).to receive(:read_crontab).and_return(<<-CRONTAB)
-0 2 * * * /some/other/command
-
-# Chef Name: cronhole some stuff
-30 * * 3 * /bin/true
-# Chef Name: something else
-2 * 1 * * /bin/false
-
-# Another comment
+ allow(@provider).to receive(:read_crontab).and_return(<<~CRONTAB)
+ 0 2 * * * /some/other/command
+
+ # Chef Name: cronhole some stuff
+ 30 * * 3 * /bin/true
+ # Chef Name: something else
+ 2 * 1 * * /bin/false
+
+ # Another comment
CRONTAB
end
it "should remove the entry" do
- expect(@provider).to receive(:write_crontab).with(<<-ENDCRON)
-0 2 * * * /some/other/command
-
-# Chef Name: something else
-2 * 1 * * /bin/false
-
-# Another comment
+ expect(@provider).to receive(:write_crontab).with(<<~ENDCRON)
+ 0 2 * * * /some/other/command
+
+ # Chef Name: something else
+ 2 * 1 * * /bin/false
+
+ # Another comment
ENDCRON
@provider.run_action(:delete)
end
it "should remove any env vars with the entry" do
- allow(@provider).to receive(:read_crontab).and_return(<<-CRONTAB)
-0 2 * * * /some/other/command
-
-# Chef Name: cronhole some stuff
-MAILTO=foo@example.com
-FOO=test
-30 * * 3 * /bin/true
-# Chef Name: something else
-2 * 1 * * /bin/false
-
-# Another comment
+ allow(@provider).to receive(:read_crontab).and_return(<<~CRONTAB)
+ 0 2 * * * /some/other/command
+
+ # Chef Name: cronhole some stuff
+ MAILTO=foo@example.com
+ FOO=test
+ 30 * * 3 * /bin/true
+ # Chef Name: something else
+ 2 * 1 * * /bin/false
+
+ # Another comment
CRONTAB
- expect(@provider).to receive(:write_crontab).with(<<-ENDCRON)
-0 2 * * * /some/other/command
-
-# Chef Name: something else
-2 * 1 * * /bin/false
-
-# Another comment
+ expect(@provider).to receive(:write_crontab).with(<<~ENDCRON)
+ 0 2 * * * /some/other/command
+
+ # Chef Name: something else
+ 2 * 1 * * /bin/false
+
+ # Another comment
ENDCRON
@provider.run_action(:delete)
end
@@ -812,61 +812,61 @@ FOO=test
end
it "should remove the section" do
- allow(@provider).to receive(:read_crontab).and_return(<<-CRONTAB)
-0 2 * * * /some/other/command
-
-# Chef Name: cronhole some stuff
+ allow(@provider).to receive(:read_crontab).and_return(<<~CRONTAB)
+ 0 2 * * * /some/other/command
+
+ # Chef Name: cronhole some stuff
CRONTAB
- expect(@provider).to receive(:write_crontab).with(<<-ENDCRON)
-0 2 * * * /some/other/command
-
+ expect(@provider).to receive(:write_crontab).with(<<~ENDCRON)
+ 0 2 * * * /some/other/command
+
ENDCRON
@provider.run_action(:delete)
end
it "should not blat following sections" do
- allow(@provider).to receive(:read_crontab).and_return(<<-CRONTAB)
-0 2 * * * /some/other/command
-
-# Chef Name: cronhole some stuff
-#30 * * 3 * /bin/true
-# Chef Name: something else
-2 * 1 * * /bin/false
-
-# Another comment
+ allow(@provider).to receive(:read_crontab).and_return(<<~CRONTAB)
+ 0 2 * * * /some/other/command
+
+ # Chef Name: cronhole some stuff
+ #30 * * 3 * /bin/true
+ # Chef Name: something else
+ 2 * 1 * * /bin/false
+
+ # Another comment
CRONTAB
- expect(@provider).to receive(:write_crontab).with(<<-ENDCRON)
-0 2 * * * /some/other/command
-
-#30 * * 3 * /bin/true
-# Chef Name: something else
-2 * 1 * * /bin/false
-
-# Another comment
+ expect(@provider).to receive(:write_crontab).with(<<~ENDCRON)
+ 0 2 * * * /some/other/command
+
+ #30 * * 3 * /bin/true
+ # Chef Name: something else
+ 2 * 1 * * /bin/false
+
+ # Another comment
ENDCRON
@provider.run_action(:delete)
end
it "should remove any envvars with the section" do
- allow(@provider).to receive(:read_crontab).and_return(<<-CRONTAB)
-0 2 * * * /some/other/command
-
-# Chef Name: cronhole some stuff
-MAILTO=foo@example.com
-#30 * * 3 * /bin/true
-# Chef Name: something else
-2 * 1 * * /bin/false
-
-# Another comment
+ allow(@provider).to receive(:read_crontab).and_return(<<~CRONTAB)
+ 0 2 * * * /some/other/command
+
+ # Chef Name: cronhole some stuff
+ MAILTO=foo@example.com
+ #30 * * 3 * /bin/true
+ # Chef Name: something else
+ 2 * 1 * * /bin/false
+
+ # Another comment
CRONTAB
- expect(@provider).to receive(:write_crontab).with(<<-ENDCRON)
-0 2 * * * /some/other/command
-
-#30 * * 3 * /bin/true
-# Chef Name: something else
-2 * 1 * * /bin/false
-
-# Another comment
+ expect(@provider).to receive(:write_crontab).with(<<~ENDCRON)
+ 0 2 * * * /some/other/command
+
+ #30 * * 3 * /bin/true
+ # Chef Name: something else
+ 2 * 1 * * /bin/false
+
+ # Another comment
ENDCRON
@provider.run_action(:delete)
end
@@ -875,13 +875,13 @@ MAILTO=foo@example.com
describe "read_crontab" do
before :each do
- @stdout = <<-CRONTAB
-0 2 * * * /some/other/command
-
-# Chef Name: something else
-* 5 * * * /bin/true
-
-# Another comment
+ @stdout = <<~CRONTAB
+ 0 2 * * * /some/other/command
+
+ # Chef Name: something else
+ * 5 * * * /bin/true
+
+ # Another comment
CRONTAB
@status = double("Status", exitstatus: 0, stdout: @stdout)
allow(@provider).to receive(:shell_out!).and_return(@status)
@@ -894,13 +894,13 @@ MAILTO=foo@example.com
it "should return the contents of the crontab" do
crontab = @provider.send(:read_crontab)
- expect(crontab).to eq <<-CRONTAB
-0 2 * * * /some/other/command
-
-# Chef Name: something else
-* 5 * * * /bin/true
-
-# Another comment
+ expect(crontab).to eq <<~CRONTAB
+ 0 2 * * * /some/other/command
+
+ # Chef Name: something else
+ * 5 * * * /bin/true
+
+ # Another comment
CRONTAB
end
diff --git a/spec/unit/provider/git_spec.rb b/spec/unit/provider/git_spec.rb
index fafb83f548..b1b556db1c 100644
--- a/spec/unit/provider/git_spec.rb
+++ b/spec/unit/provider/git_spec.rb
@@ -244,21 +244,21 @@ describe Chef::Provider::Git do
end
it "gives the latest HEAD revision SHA if nothing is specified" do
- @stdout = <<-SHAS
-28af684d8460ba4793eda3e7ac238c864a5d029a\tHEAD
-503c22a5e41f5ae3193460cca044ed1435029f53\trefs/heads/0.8-alpha
-28af684d8460ba4793eda3e7ac238c864a5d029a\trefs/heads/master
-c44fe79bb5e36941ce799cee6b9de3a2ef89afee\trefs/tags/0.5.2
-14534f0e0bf133dc9ff6dbe74f8a0c863ff3ac6d\trefs/tags/0.5.4
-d36fddb4291341a1ff2ecc3c560494e398881354\trefs/tags/0.5.6
-9e5ce9031cbee81015de680d010b603bce2dd15f\trefs/tags/0.6.0
-9b4d8dc38dd471246e7cfb1c3c1ad14b0f2bee13\trefs/tags/0.6.2
-014a69af1cdce619de82afaf6cdb4e6ac658fede\trefs/tags/0.7.0
-fa8097ff666af3ce64761d8e1f1c2aa292a11378\trefs/tags/0.7.2
-44f9be0b33ba5c10027ddb030a5b2f0faa3eeb8d\trefs/tags/0.7.4
-d7b9957f67236fa54e660cc3ab45ffecd6e0ba38\trefs/tags/0.7.8
-b7d19519a1c15f1c1a324e2683bd728b6198ce5a\trefs/tags/0.7.8^{}
-ebc1b392fe7e8f0fbabc305c299b4d365d2b4d9b\trefs/tags/chef-server-package
+ @stdout = <<~SHAS
+ 28af684d8460ba4793eda3e7ac238c864a5d029a\tHEAD
+ 503c22a5e41f5ae3193460cca044ed1435029f53\trefs/heads/0.8-alpha
+ 28af684d8460ba4793eda3e7ac238c864a5d029a\trefs/heads/master
+ c44fe79bb5e36941ce799cee6b9de3a2ef89afee\trefs/tags/0.5.2
+ 14534f0e0bf133dc9ff6dbe74f8a0c863ff3ac6d\trefs/tags/0.5.4
+ d36fddb4291341a1ff2ecc3c560494e398881354\trefs/tags/0.5.6
+ 9e5ce9031cbee81015de680d010b603bce2dd15f\trefs/tags/0.6.0
+ 9b4d8dc38dd471246e7cfb1c3c1ad14b0f2bee13\trefs/tags/0.6.2
+ 014a69af1cdce619de82afaf6cdb4e6ac658fede\trefs/tags/0.7.0
+ fa8097ff666af3ce64761d8e1f1c2aa292a11378\trefs/tags/0.7.2
+ 44f9be0b33ba5c10027ddb030a5b2f0faa3eeb8d\trefs/tags/0.7.4
+ d7b9957f67236fa54e660cc3ab45ffecd6e0ba38\trefs/tags/0.7.8
+ b7d19519a1c15f1c1a324e2683bd728b6198ce5a\trefs/tags/0.7.8^{}
+ ebc1b392fe7e8f0fbabc305c299b4d365d2b4d9b\trefs/tags/chef-server-package
SHAS
@resource.revision ""
expect(@provider).to receive(:shell_out!).with(@git_ls_remote + "\"HEAD\"", { log_tag: "git[web2.0 app]" }).and_return(double("ShellOut result", stdout: @stdout))
diff --git a/spec/unit/provider/group/dscl_spec.rb b/spec/unit/provider/group/dscl_spec.rb
index b6748fd5f8..4d18a8c2b0 100644
--- a/spec/unit/provider/group/dscl_spec.rb
+++ b/spec/unit/provider/group/dscl_spec.rb
@@ -309,19 +309,19 @@ describe "Test DSCL loading" do
@new_resource = Chef::Resource::Group.new("group name aj")
@new_resource.group_name("aj")
@provider = Chef::Provider::Group::Dscl.new(@new_resource, @run_context)
- @output = <<-EOF
-AppleMetaNodeLocation: /Local/Default
-Comment:
- Test Group
-GeneratedUID: AAAAAAAA-AAAA-AAAA-AAAA-AAAAAAAAAAAA
-NestedGroups: AAAAAAAA-AAAA-AAAA-AAAA-AAAAAAAAAAAB
-Password: *
-PrimaryGroupID: 999
-RealName:
- TestGroup
-RecordName: com.apple.aj
-RecordType: dsRecTypeStandard:Groups
-GroupMembership: waka bar
+ @output = <<~EOF
+ AppleMetaNodeLocation: /Local/Default
+ Comment:
+ Test Group
+ GeneratedUID: AAAAAAAA-AAAA-AAAA-AAAA-AAAAAAAAAAAA
+ NestedGroups: AAAAAAAA-AAAA-AAAA-AAAA-AAAAAAAAAAAB
+ Password: *
+ PrimaryGroupID: 999
+ RealName:
+ TestGroup
+ RecordName: com.apple.aj
+ RecordType: dsRecTypeStandard:Groups
+ GroupMembership: waka bar
EOF
allow(@provider).to receive(:safe_dscl).with(*"read /Groups/aj".split(" ")).and_return(@output)
@current_resource = @provider.load_current_resource
diff --git a/spec/unit/provider/ifconfig/aix_spec.rb b/spec/unit/provider/ifconfig/aix_spec.rb
index 3eb4228c51..654b08b2c9 100644
--- a/spec/unit/provider/ifconfig/aix_spec.rb
+++ b/spec/unit/provider/ifconfig/aix_spec.rb
@@ -22,16 +22,16 @@ require "chef/exceptions"
describe Chef::Provider::Ifconfig::Aix do
before(:all) do
- @ifconfig_output = <<-IFCONFIG
-en1: flags=1e080863,480<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT,CHECKSUM_OFFLOAD(ACTIVE),CHAIN>
- inet 10.153.11.59 netmask 0xffff0000 broadcast 10.153.255.255
- tcp_sendspace 262144 tcp_recvspace 262144 rfc1323 1
-en0: flags=1e080863,480<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT,CHECKSUM_OFFLOAD(ACTIVE),CHAIN> metric 1
- inet 172.29.174.58 netmask 0xffffc000 broadcast 172.29.191.255
- tcp_sendspace 262144 tcp_recvspace 262144 rfc1323 1
-lo0: flags=e08084b,c0<UP,BROADCAST,LOOPBACK,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT,LARGESEND,CHAIN>
- inet 127.0.0.1 netmask 0xff000000 broadcast 127.255.255.255
- inet6 ::1%1/0
+ @ifconfig_output = <<~IFCONFIG
+ en1: flags=1e080863,480<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT,CHECKSUM_OFFLOAD(ACTIVE),CHAIN>
+ inet 10.153.11.59 netmask 0xffff0000 broadcast 10.153.255.255
+ tcp_sendspace 262144 tcp_recvspace 262144 rfc1323 1
+ en0: flags=1e080863,480<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT,CHECKSUM_OFFLOAD(ACTIVE),CHAIN> metric 1
+ inet 172.29.174.58 netmask 0xffffc000 broadcast 172.29.191.255
+ tcp_sendspace 262144 tcp_recvspace 262144 rfc1323 1
+ lo0: flags=e08084b,c0<UP,BROADCAST,LOOPBACK,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT,LARGESEND,CHAIN>
+ inet 127.0.0.1 netmask 0xff000000 broadcast 127.255.255.255
+ inet6 ::1%1/0
IFCONFIG
end
diff --git a/spec/unit/provider/ifconfig/debian_spec.rb b/spec/unit/provider/ifconfig/debian_spec.rb
index 9a90dc1e0a..93b0008e8b 100644
--- a/spec/unit/provider/ifconfig/debian_spec.rb
+++ b/spec/unit/provider/ifconfig/debian_spec.rb
@@ -119,10 +119,10 @@ describe Chef::Provider::Ifconfig::Debian do
context "when the /etc/network/interfaces file has the source line" do
let(:expected_string) do
- <<-EOF
-a line
-source #{tempdir_path}/*
-another line
+ <<~EOF
+ a line
+ source #{tempdir_path}/*
+ another line
EOF
end
@@ -142,10 +142,10 @@ EOF
context "when the /etc/network/interfaces file does not have the source line" do
let(:expected_string) do
- <<-EOF
-a line
-another line
-source #{tempdir_path}/*
+ <<~EOF
+ a line
+ another line
+ source #{tempdir_path}/*
EOF
end
@@ -246,10 +246,10 @@ EOF
context "when the /etc/network/interfaces file has the source line" do
let(:expected_string) do
- <<-EOF
-a line
-source #{tempdir_path}/*
-another line
+ <<~EOF
+ a line
+ source #{tempdir_path}/*
+ another line
EOF
end
@@ -267,10 +267,10 @@ another line
context "when the /etc/network/interfaces file does not have the source line" do
let(:expected_string) do
- <<-EOF
-a line
-another line
-source #{tempdir_path}/*
+ <<~EOF
+ a line
+ another line
+ source #{tempdir_path}/*
EOF
end
diff --git a/spec/unit/provider/ifconfig_spec.rb b/spec/unit/provider/ifconfig_spec.rb
index 748b4d897e..0b8db90428 100644
--- a/spec/unit/provider/ifconfig_spec.rb
+++ b/spec/unit/provider/ifconfig_spec.rb
@@ -41,9 +41,9 @@ describe Chef::Provider::Ifconfig do
end
describe Chef::Provider::Ifconfig, "load_current_resource" do
- let(:net_tools_version) { StringIO.new <<-EOS }
-net-tools 1.60
-ifconfig 1.42 (2001-04-13)
+ let(:net_tools_version) { StringIO.new <<~EOS }
+ net-tools 1.60
+ ifconfig 1.42 (2001-04-13)
EOS
before do
diff --git a/spec/unit/provider/launchd_spec.rb b/spec/unit/provider/launchd_spec.rb
index 693801f99b..97883fc04c 100644
--- a/spec/unit/provider/launchd_spec.rb
+++ b/spec/unit/provider/launchd_spec.rb
@@ -29,55 +29,55 @@ describe Chef::Provider::Launchd do
let(:label) { "call.mom.weekly" }
let(:new_resource) { Chef::Resource::Launchd.new(label) }
let!(:current_resource) { Chef::Resource::Launchd.new(label) }
- let(:test_plist) { String.new <<-XML }
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-\t<key>Label</key>
-\t<string>call.mom.weekly</string>
-\t<key>Program</key>
-\t<string>/Library/scripts/call_mom.sh</string>
-\t<key>StartCalendarInterval</key>
-\t<dict>
-\t\t<key>Hour</key>
-\t\t<integer>10</integer>
-\t\t<key>Weekday</key>
-\t\t<integer>7</integer>
-\t</dict>
-\t<key>TimeOut</key>
-\t<integer>300</integer>
-</dict>
-</plist>
+ let(:test_plist) { String.new <<~XML }
+ <?xml version="1.0" encoding="UTF-8"?>
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+ <plist version="1.0">
+ <dict>
+ \t<key>Label</key>
+ \t<string>call.mom.weekly</string>
+ \t<key>Program</key>
+ \t<string>/Library/scripts/call_mom.sh</string>
+ \t<key>StartCalendarInterval</key>
+ \t<dict>
+ \t\t<key>Hour</key>
+ \t\t<integer>10</integer>
+ \t\t<key>Weekday</key>
+ \t\t<integer>7</integer>
+ \t</dict>
+ \t<key>TimeOut</key>
+ \t<integer>300</integer>
+ </dict>
+ </plist>
XML
- let(:test_plist_multiple_intervals) { String.new <<-XML }
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-\t<key>Label</key>
-\t<string>call.mom.weekly</string>
-\t<key>Program</key>
-\t<string>/Library/scripts/call_mom.sh</string>
-\t<key>StartCalendarInterval</key>
-\t<array>
-\t\t<dict>
-\t\t\t<key>Hour</key>
-\t\t\t<integer>11</integer>
-\t\t\t<key>Weekday</key>
-\t\t\t<integer>1</integer>
-\t\t</dict>
-\t\t<dict>
-\t\t\t<key>Hour</key>
-\t\t\t<integer>12</integer>
-\t\t\t<key>Weekday</key>
-\t\t\t<integer>2</integer>
-\t\t</dict>
-\t</array>
-\t<key>TimeOut</key>
-\t<integer>300</integer>
-</dict>
-</plist>
+ let(:test_plist_multiple_intervals) { String.new <<~XML }
+ <?xml version="1.0" encoding="UTF-8"?>
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+ <plist version="1.0">
+ <dict>
+ \t<key>Label</key>
+ \t<string>call.mom.weekly</string>
+ \t<key>Program</key>
+ \t<string>/Library/scripts/call_mom.sh</string>
+ \t<key>StartCalendarInterval</key>
+ \t<array>
+ \t\t<dict>
+ \t\t\t<key>Hour</key>
+ \t\t\t<integer>11</integer>
+ \t\t\t<key>Weekday</key>
+ \t\t\t<integer>1</integer>
+ \t\t</dict>
+ \t\t<dict>
+ \t\t\t<key>Hour</key>
+ \t\t\t<integer>12</integer>
+ \t\t\t<key>Weekday</key>
+ \t\t\t<integer>2</integer>
+ \t\t</dict>
+ \t</array>
+ \t<key>TimeOut</key>
+ \t<integer>300</integer>
+ </dict>
+ </plist>
XML
let(:test_hash) do
diff --git a/spec/unit/provider/mount/aix_spec.rb b/spec/unit/provider/mount/aix_spec.rb
index d807409d05..409bd46ecc 100644
--- a/spec/unit/provider/mount/aix_spec.rb
+++ b/spec/unit/provider/mount/aix_spec.rb
@@ -22,32 +22,32 @@ require "ostruct"
describe Chef::Provider::Mount::Aix do
before(:all) do
- @mounted_output = <<-MOUNT
- node mounted mounted over vfs date options
--------- --------------- --------------- ------ ------------ ---------------
- /dev/sdz1 /tmp/foo jfs2 Jul 17 13:22 rw,log=/dev/hd8
+ @mounted_output = <<~MOUNT
+ node mounted mounted over vfs date options
+ -------- --------------- --------------- ------ ------------ ---------------
+ /dev/sdz1 /tmp/foo jfs2 Jul 17 13:22 rw,log=/dev/hd8
MOUNT
- @unmounted_output = <<-UNMOUNTED
- node mounted mounted over vfs date options
--------- --------------- --------------- ------ ------------ ---------------
- /dev/sdz2 / jfs2 Jul 17 13:22 rw,log=/dev/hd8
+ @unmounted_output = <<~UNMOUNTED
+ node mounted mounted over vfs date options
+ -------- --------------- --------------- ------ ------------ ---------------
+ /dev/sdz2 / jfs2 Jul 17 13:22 rw,log=/dev/hd8
UNMOUNTED
- @conflict_mounted_output = <<-MOUNT
- node mounted mounted over vfs date options
--------- --------------- --------------- ------ ------------ ---------------
- /dev/sdz3 /tmp/foo jfs2 Jul 17 13:22 rw,log=/dev/hd8
+ @conflict_mounted_output = <<~MOUNT
+ node mounted mounted over vfs date options
+ -------- --------------- --------------- ------ ------------ ---------------
+ /dev/sdz3 /tmp/foo jfs2 Jul 17 13:22 rw,log=/dev/hd8
MOUNT
- @enabled_output = <<-ENABLED
-#MountPoint:Device:Vfs:Nodename:Type:Size:Options:AutoMount:Acct
-/tmp/foo:/dev/sdz1:jfs2::bootfs:10485760:rw:yes:no
+ @enabled_output = <<~ENABLED
+ #MountPoint:Device:Vfs:Nodename:Type:Size:Options:AutoMount:Acct
+ /tmp/foo:/dev/sdz1:jfs2::bootfs:10485760:rw:yes:no
ENABLED
- @test_wrong_output = <<-WRONG
-#MountPoint:Device:Vfs:Nodename:Type:Size:Options:AutoMount:Acct
-/tmp/foo::/dev/sdz1:jfs2:bootfs:10485760:rw:yes:no
+ @test_wrong_output = <<~WRONG
+ #MountPoint:Device:Vfs:Nodename:Type:Size:Options:AutoMount:Acct
+ /tmp/foo::/dev/sdz1:jfs2:bootfs:10485760:rw:yes:no
WRONG
end
@@ -232,22 +232,22 @@ WRONG
it "should disable mount if it is mounted and enabled" do
stub_mounted_enabled(@provider, @mounted_output, @enabled_output)
- allow(::File).to receive(:open).with("/etc/filesystems", "r").and_return(<<-ETCFILESYSTEMS)
-/tmp/foo:
- dev = /dev/sdz1
- vfs = jfs2
- log = /dev/hd8
- mount = true
- check = true
- vol = /opt
- free = false
- quota = no
-
-/tmp/abc:
- dev = /dev/sdz2
- vfs = jfs2
- mount = true
- options = rw
+ allow(::File).to receive(:open).with("/etc/filesystems", "r").and_return(<<~ETCFILESYSTEMS)
+ /tmp/foo:
+ dev = /dev/sdz1
+ vfs = jfs2
+ log = /dev/hd8
+ mount = true
+ check = true
+ vol = /opt
+ free = false
+ quota = no
+
+ /tmp/abc:
+ dev = /dev/sdz2
+ vfs = jfs2
+ mount = true
+ options = rw
ETCFILESYSTEMS
filesystems = StringIO.new
diff --git a/spec/unit/provider/package/apt_spec.rb b/spec/unit/provider/package/apt_spec.rb
index 1047534f98..97eda1d774 100644
--- a/spec/unit/provider/package/apt_spec.rb
+++ b/spec/unit/provider/package/apt_spec.rb
@@ -34,13 +34,13 @@ describe Chef::Provider::Package::Apt do
@status = double("Status", exitstatus: 0)
@provider = Chef::Provider::Package::Apt.new(@new_resource, @run_context)
@stdin = StringIO.new
- @stdout = <<-PKG_STATUS
-irssi:
- Installed: (none)
- Candidate: 0.8.14-1ubuntu4
- Version table:
- 0.8.14-1ubuntu4 0
- 500 http://us.archive.ubuntu.com/ubuntu/ lucid/main Packages
+ @stdout = <<~PKG_STATUS
+ irssi:
+ Installed: (none)
+ Candidate: 0.8.14-1ubuntu4
+ Version table:
+ 0.8.14-1ubuntu4 0
+ 500 http://us.archive.ubuntu.com/ubuntu/ lucid/main Packages
PKG_STATUS
@stderr = ""
@shell_out = OpenStruct.new(stdout: @stdout, stdin: @stdin, stderr: @stderr, status: @status, exitstatus: 0)
@@ -65,17 +65,17 @@ irssi:
end
it "should set the installed version if package has one" do
- @stdout.replace(<<-INSTALLED)
-sudo:
- Installed: 1.7.2p1-1ubuntu5.3
- Candidate: 1.7.2p1-1ubuntu5.3
- Version table:
- *** 1.7.2p1-1ubuntu5.3 0
- 500 http://us.archive.ubuntu.com/ubuntu/ lucid-updates/main Packages
- 500 http://security.ubuntu.com/ubuntu/ lucid-security/main Packages
- 100 /var/lib/dpkg/status
- 1.7.2p1-1ubuntu5 0
- 500 http://us.archive.ubuntu.com/ubuntu/ lucid/main Packages
+ @stdout.replace(<<~INSTALLED)
+ sudo:
+ Installed: 1.7.2p1-1ubuntu5.3
+ Candidate: 1.7.2p1-1ubuntu5.3
+ Version table:
+ *** 1.7.2p1-1ubuntu5.3 0
+ 500 http://us.archive.ubuntu.com/ubuntu/ lucid-updates/main Packages
+ 500 http://security.ubuntu.com/ubuntu/ lucid-security/main Packages
+ 100 /var/lib/dpkg/status
+ 1.7.2p1-1ubuntu5 0
+ 500 http://us.archive.ubuntu.com/ubuntu/ lucid/main Packages
INSTALLED
expect(@provider).to receive(:shell_out_compacted!).and_return(@shell_out)
@provider.load_current_resource
@@ -86,8 +86,8 @@ sudo:
# it is the superclasses responsibility to throw most exceptions
it "if the package does not exist in the cache sets installed + candidate version to nil" do
@new_resource.package_name("conic-smarms")
- policy_out = <<-POLICY_STDOUT
-N: Unable to locate package conic-smarms
+ policy_out = <<~POLICY_STDOUT
+ N: Unable to locate package conic-smarms
POLICY_STDOUT
policy = double(stdout: policy_out, exitstatus: 0)
expect(@provider).to receive(:shell_out_compacted!).with(
@@ -95,8 +95,8 @@ N: Unable to locate package conic-smarms
env: { "DEBIAN_FRONTEND" => "noninteractive" },
timeout: @timeout
).and_return(policy)
- showpkg_out = <<-SHOWPKG_STDOUT
-N: Unable to locate package conic-smarms
+ showpkg_out = <<~SHOWPKG_STDOUT
+ N: Unable to locate package conic-smarms
SHOWPKG_STDOUT
showpkg = double(stdout: showpkg_out, exitstatus: 0)
expect(@provider).to receive(:shell_out_compacted!).with(
@@ -111,11 +111,11 @@ N: Unable to locate package conic-smarms
# list of virtual packages: http://www.debian.org/doc/packaging-manuals/virtual-package-names-list.txt
it "should not install the virtual package there is a single provider package and it is installed" do
@new_resource.package_name("libmysqlclient15-dev")
- virtual_package_out = <<-VPKG_STDOUT
-libmysqlclient15-dev:
- Installed: (none)
- Candidate: (none)
- Version table:
+ virtual_package_out = <<~VPKG_STDOUT
+ libmysqlclient15-dev:
+ Installed: (none)
+ Candidate: (none)
+ Version table:
VPKG_STDOUT
virtual_package = double(stdout: virtual_package_out, exitstatus: 0)
expect(@provider).to receive(:shell_out_compacted!).with(
@@ -123,23 +123,23 @@ libmysqlclient15-dev:
env: { "DEBIAN_FRONTEND" => "noninteractive" },
timeout: @timeout
).and_return(virtual_package)
- showpkg_out = <<-SHOWPKG_STDOUT
-Package: libmysqlclient15-dev
-Versions:
-
-Reverse Depends:
- libmysqlclient-dev,libmysqlclient15-dev
- libmysqlclient-dev,libmysqlclient15-dev
- libmysqlclient-dev,libmysqlclient15-dev
- libmysqlclient-dev,libmysqlclient15-dev
- libmysqlclient-dev,libmysqlclient15-dev
- libmysqlclient-dev,libmysqlclient15-dev
-Dependencies:
-Provides:
-Reverse Provides:
-libmysqlclient-dev 5.1.41-3ubuntu12.7
-libmysqlclient-dev 5.1.41-3ubuntu12.10
-libmysqlclient-dev 5.1.41-3ubuntu12
+ showpkg_out = <<~SHOWPKG_STDOUT
+ Package: libmysqlclient15-dev
+ Versions:
+
+ Reverse Depends:
+ libmysqlclient-dev,libmysqlclient15-dev
+ libmysqlclient-dev,libmysqlclient15-dev
+ libmysqlclient-dev,libmysqlclient15-dev
+ libmysqlclient-dev,libmysqlclient15-dev
+ libmysqlclient-dev,libmysqlclient15-dev
+ libmysqlclient-dev,libmysqlclient15-dev
+ Dependencies:
+ Provides:
+ Reverse Provides:
+ libmysqlclient-dev 5.1.41-3ubuntu12.7
+ libmysqlclient-dev 5.1.41-3ubuntu12.10
+ libmysqlclient-dev 5.1.41-3ubuntu12
SHOWPKG_STDOUT
showpkg = double(stdout: showpkg_out, exitstatus: 0)
expect(@provider).to receive(:shell_out_compacted!).with(
@@ -147,18 +147,18 @@ libmysqlclient-dev 5.1.41-3ubuntu12
env: { "DEBIAN_FRONTEND" => "noninteractive" },
timeout: @timeout
).and_return(showpkg)
- real_package_out = <<-RPKG_STDOUT
-libmysqlclient-dev:
- Installed: 5.1.41-3ubuntu12.10
- Candidate: 5.1.41-3ubuntu12.10
- Version table:
- *** 5.1.41-3ubuntu12.10 0
- 500 http://us.archive.ubuntu.com/ubuntu/ lucid-updates/main Packages
- 100 /var/lib/dpkg/status
- 5.1.41-3ubuntu12.7 0
- 500 http://security.ubuntu.com/ubuntu/ lucid-security/main Packages
- 5.1.41-3ubuntu12 0
- 500 http://us.archive.ubuntu.com/ubuntu/ lucid/main Packages
+ real_package_out = <<~RPKG_STDOUT
+ libmysqlclient-dev:
+ Installed: 5.1.41-3ubuntu12.10
+ Candidate: 5.1.41-3ubuntu12.10
+ Version table:
+ *** 5.1.41-3ubuntu12.10 0
+ 500 http://us.archive.ubuntu.com/ubuntu/ lucid-updates/main Packages
+ 100 /var/lib/dpkg/status
+ 5.1.41-3ubuntu12.7 0
+ 500 http://security.ubuntu.com/ubuntu/ lucid-security/main Packages
+ 5.1.41-3ubuntu12 0
+ 500 http://us.archive.ubuntu.com/ubuntu/ lucid/main Packages
RPKG_STDOUT
real_package = double(stdout: real_package_out, exitstatus: 0)
expect(@provider).to receive(:shell_out_compacted!).with(
@@ -171,11 +171,11 @@ libmysqlclient-dev:
it "should raise an exception if you specify a virtual package with multiple provider packages" do
@new_resource.package_name("mp3-decoder")
- virtual_package_out = <<-VPKG_STDOUT
-mp3-decoder:
- Installed: (none)
- Candidate: (none)
- Version table:
+ virtual_package_out = <<~VPKG_STDOUT
+ mp3-decoder:
+ Installed: (none)
+ Candidate: (none)
+ Version table:
VPKG_STDOUT
virtual_package = double(stdout: virtual_package_out, exitstatus: 0)
expect(@provider).to receive(:shell_out_compacted!).with(
@@ -183,26 +183,26 @@ mp3-decoder:
env: { "DEBIAN_FRONTEND" => "noninteractive" },
timeout: @timeout
).and_return(virtual_package)
- showpkg_out = <<-SHOWPKG_STDOUT
-Package: mp3-decoder
-Versions:
-
-Reverse Depends:
- nautilus,mp3-decoder
- vux,mp3-decoder
- plait,mp3-decoder
- ecasound,mp3-decoder
- nautilus,mp3-decoder
-Dependencies:
-Provides:
-Reverse Provides:
-vlc-nox 1.0.6-1ubuntu1.8
-vlc 1.0.6-1ubuntu1.8
-vlc-nox 1.0.6-1ubuntu1
-vlc 1.0.6-1ubuntu1
-opencubicplayer 1:0.1.17-2
-mpg321 0.2.10.6
-mpg123 1.12.1-0ubuntu1
+ showpkg_out = <<~SHOWPKG_STDOUT
+ Package: mp3-decoder
+ Versions:
+
+ Reverse Depends:
+ nautilus,mp3-decoder
+ vux,mp3-decoder
+ plait,mp3-decoder
+ ecasound,mp3-decoder
+ nautilus,mp3-decoder
+ Dependencies:
+ Provides:
+ Reverse Provides:
+ vlc-nox 1.0.6-1ubuntu1.8
+ vlc 1.0.6-1ubuntu1.8
+ vlc-nox 1.0.6-1ubuntu1
+ vlc 1.0.6-1ubuntu1
+ opencubicplayer 1:0.1.17-2
+ mpg321 0.2.10.6
+ mpg123 1.12.1-0ubuntu1
SHOWPKG_STDOUT
showpkg = double(stdout: showpkg_out, exitstatus: 0)
expect(@provider).to receive(:shell_out_compacted!).with(
diff --git a/spec/unit/provider/package/cab_spec.rb b/spec/unit/provider/package/cab_spec.rb
index 5c86f781f3..bdfcd06be3 100644
--- a/spec/unit/provider/package/cab_spec.rb
+++ b/spec/unit/provider/package/cab_spec.rb
@@ -31,20 +31,20 @@ describe Chef::Provider::Package::Cab do
end
let(:installed_package_list_stdout) do
- <<-EOF
-Packages listing:
-Package Identity : Package_for_KB2999486~31bf3856ad364e35~amd64~~6.1.9768.0
-Package Identity : Package_for_KB2994825~31bf3856ad364e35~amd64~~6.1.7601.0
+ <<~EOF
+ Packages listing:
+ Package Identity : Package_for_KB2999486~31bf3856ad364e35~amd64~~6.1.9768.0
+ Package Identity : Package_for_KB2994825~31bf3856ad364e35~amd64~~6.1.7601.0
EOF
end
let(:package_version_stdout) do
- <<-EOF
-Package information:
-Package Identity : Package_for_KB2664825~31bf3856ad364e35~amd64~~6.1.3.0
-State : Installed
-Dependency : Language Pack
-The operation completed successfully
+ <<~EOF
+ Package information:
+ Package Identity : Package_for_KB2664825~31bf3856ad364e35~amd64~~6.1.3.0
+ State : Installed
+ Dependency : Language Pack
+ The operation completed successfully
EOF
end
@@ -57,20 +57,20 @@ The operation completed successfully
end
def allow_package_info(package_path = nil, package_name = nil)
- get_package_info_stdout = <<-EOF
-Deployment Image Servicing and Management tool
-Version: 6.1.7600.16385
-
-Image Version: 6.1.7600.16385
-
-Package information:
-Package Identity : Package_for_KB2664825~31bf3856ad364e35~amd64~~6.1.3.0
-Applicable : Yes
-Copyright : Microsoft Corporation
-Company : Microsoft Corporation
-State : Installed
-Dependency : Language Pack
-The operation completed successfully
+ get_package_info_stdout = <<~EOF
+ Deployment Image Servicing and Management tool
+ Version: 6.1.7600.16385
+
+ Image Version: 6.1.7600.16385
+
+ Package information:
+ Package Identity : Package_for_KB2664825~31bf3856ad364e35~amd64~~6.1.3.0
+ Applicable : Yes
+ Copyright : Microsoft Corporation
+ Company : Microsoft Corporation
+ State : Installed
+ Dependency : Language Pack
+ The operation completed successfully
EOF
get_package_info_obj = double(stdout: get_package_info_stdout)
if package_path
@@ -81,30 +81,30 @@ The operation completed successfully
end
def allow_get_packages
- get_packages_stdout = <<-EOF
-Deployment Image Servicing and Management tool
-Version: 6.1.7600.16385
-
-Image Version: 6.1.7600.16385
-
-Packages listing:
-
-Package Identity : Package_for_KB2999486~31bf3856ad364e35~amd64~~6.1.9768.0
-State : Installed
-Release Type : Language Pack
-Install Time : 2/11/2015 11:33 PM
-
-Package Identity : Package_for_KB2994825~31bf3856ad364e35~amd64~~6.1.7601.0
-State : Installed
-Release Type : Language Pack
-Install Time : 2/11/2015 11:33 PM
-
-Package Identity : Package_for_KB2664825~31bf3856ad364e35~amd64~~6.1.3.0
-State : Installed
-Release Type : Feature Pack
-Install Time : 11/21/2010 3:40 AM
-
-The operation completed successfully.
+ get_packages_stdout = <<~EOF
+ Deployment Image Servicing and Management tool
+ Version: 6.1.7600.16385
+
+ Image Version: 6.1.7600.16385
+
+ Packages listing:
+
+ Package Identity : Package_for_KB2999486~31bf3856ad364e35~amd64~~6.1.9768.0
+ State : Installed
+ Release Type : Language Pack
+ Install Time : 2/11/2015 11:33 PM
+
+ Package Identity : Package_for_KB2994825~31bf3856ad364e35~amd64~~6.1.7601.0
+ State : Installed
+ Release Type : Language Pack
+ Install Time : 2/11/2015 11:33 PM
+
+ Package Identity : Package_for_KB2664825~31bf3856ad364e35~amd64~~6.1.3.0
+ State : Installed
+ Release Type : Feature Pack
+ Install Time : 11/21/2010 3:40 AM
+
+ The operation completed successfully.
EOF
get_packages_obj = double(stdout: get_packages_stdout)
allow(provider).to receive(:dism_command).with("/Get-Packages").and_return(get_packages_obj)
@@ -248,14 +248,14 @@ The operation completed successfully.
context "Invalid package source" do
def package_version_stdout
- package_version_stdout = <<-EOF
-Deployment Image Servicing and Management tool
-Version: 6.1.7600.16385
-Image Version: 6.1.7600.16385
-An error occurred trying to open - c:\\temp\\test6.1-KB2664825-v3-x64.cab Error: 0x80070003
-Error: 3
-The system cannot find the path specified.
-The DISM log file can be found at C:\\Windows\\Logs\\DISM\\dism.log.
+ package_version_stdout = <<~EOF
+ Deployment Image Servicing and Management tool
+ Version: 6.1.7600.16385
+ Image Version: 6.1.7600.16385
+ An error occurred trying to open - c:\\temp\\test6.1-KB2664825-v3-x64.cab Error: 0x80070003
+ Error: 3
+ The system cannot find the path specified.
+ The DISM log file can be found at C:\\Windows\\Logs\\DISM\\dism.log.
EOF
end
diff --git a/spec/unit/provider/package/chocolatey_spec.rb b/spec/unit/provider/package/chocolatey_spec.rb
index 40fca821d9..48f8a562de 100644
--- a/spec/unit/provider/package/chocolatey_spec.rb
+++ b/spec/unit/provider/package/chocolatey_spec.rb
@@ -35,10 +35,10 @@ describe Chef::Provider::Package::Chocolatey do
# installed packages (ConEmu is upgradable)
let(:local_list_stdout) do
- <<-EOF
-Chocolatey v0.9.9.11
-chocolatey|0.9.9.11
-ConEmu|15.10.25.0
+ <<~EOF
+ Chocolatey v0.9.9.11
+ chocolatey|0.9.9.11
+ ConEmu|15.10.25.0
EOF
end
@@ -50,13 +50,13 @@ ConEmu|15.10.25.0
end
def allow_remote_list(package_names, args = nil)
- remote_list_stdout = <<-EOF
-Chocolatey v0.9.9.11
-chocolatey|0.9.9.11
-ConEmu|15.10.25.1
-Git|2.6.1
-Git|2.6.2
-munin-node|1.6.1.20130823
+ remote_list_stdout = <<~EOF
+ Chocolatey v0.9.9.11
+ chocolatey|0.9.9.11
+ ConEmu|15.10.25.1
+ Git|2.6.1
+ Git|2.6.2
+ munin-node|1.6.1.20130823
EOF
remote_list_obj = double(stdout: remote_list_stdout)
package_names.each do |pkg|
diff --git a/spec/unit/provider/package/dpkg_spec.rb b/spec/unit/provider/package/dpkg_spec.rb
index cf8f5097f0..9df19f0f1b 100644
--- a/spec/unit/provider/package/dpkg_spec.rb
+++ b/spec/unit/provider/package/dpkg_spec.rb
@@ -34,18 +34,18 @@ describe Chef::Provider::Package::Dpkg do
let(:dpkg_deb_status) { status = double(stdout: "#{package}\t#{dpkg_deb_version}", exitstatus: 0) }
let(:dpkg_s_version) { "1.11.4-1ubuntu1" }
let(:dpkg_s_status) do
- stdout = <<-DPKG_S
-Package: #{package}
-Status: install ok installed
-Priority: important
-Section: web
-Installed-Size: 1944
-Maintainer: Ubuntu Core developers <ubuntu-devel-discuss@lists.ubuntu.com>
-Architecture: amd64
-Version: #{dpkg_s_version}
-Config-Version: #{dpkg_s_version}
-Depends: libc6 (>= 2.8~20080505), libssl0.9.8 (>= 0.9.8f-5)
-Conflicts: wget-ssl
+ stdout = <<~DPKG_S
+ Package: #{package}
+ Status: install ok installed
+ Priority: important
+ Section: web
+ Installed-Size: 1944
+ Maintainer: Ubuntu Core developers <ubuntu-devel-discuss@lists.ubuntu.com>
+ Architecture: amd64
+ Version: #{dpkg_s_version}
+ Config-Version: #{dpkg_s_version}
+ Depends: libc6 (>= 2.8~20080505), libssl0.9.8 (>= 0.9.8f-5)
+ Conflicts: wget-ssl
DPKG_S
status = double(stdout: stdout, exitstatus: 1)
end
@@ -172,10 +172,10 @@ Conflicts: wget-ssl
it "on new debian/ubuntu we get an exit(1) and no stdout from dpkg -s for uninstalled" do
dpkg_s_status = double(
- exitstatus: 1, stdout: "", stderr: <<-EOF
-dpkg-query: package '#{package}' is not installed and no information is available
-Use dpkg --info (= dpkg-deb --info) to examine archive files,
-and dpkg --contents (= dpkg-deb --contents) to list their contents.
+ exitstatus: 1, stdout: "", stderr: <<~EOF
+ dpkg-query: package '#{package}' is not installed and no information is available
+ Use dpkg --info (= dpkg-deb --info) to examine archive files,
+ and dpkg --contents (= dpkg-deb --contents) to list their contents.
EOF
)
expect(provider).to receive(:shell_out_compacted!).with("dpkg", "-s", package, returns: [0, 1], timeout: 900).and_return(dpkg_s_status)
@@ -185,11 +185,11 @@ and dpkg --contents (= dpkg-deb --contents) to list their contents.
it "on old debian/ubuntu we get an exit(0) and we get info on stdout from dpkg -s for uninstalled" do
dpkg_s_status = double(
- exitstatus: 0, stderr: "", stdout: <<-EOF
-Package: #{package}
-Status: unknown ok not-installed
-Priority: extra
-Section: ruby
+ exitstatus: 0, stderr: "", stdout: <<~EOF
+ Package: #{package}
+ Status: unknown ok not-installed
+ Priority: extra
+ Section: ruby
EOF
)
expect(provider).to receive(:shell_out_compacted!).with("dpkg", "-s", package, returns: [0, 1], timeout: 900).and_return(dpkg_s_status)
diff --git a/spec/unit/provider/package/ips_spec.rb b/spec/unit/provider/package/ips_spec.rb
index 46f0c72399..b5fb05f7ec 100644
--- a/spec/unit/provider/package/ips_spec.rb
+++ b/spec/unit/provider/package/ips_spec.rb
@@ -35,27 +35,27 @@ describe Chef::Provider::Package::Ips do
def local_output
stdin = StringIO.new
stdout = ""
- stderr = <<-PKG_STATUS
-pkg: info: no packages matching the following patterns you specified are
-installed on the system. Try specifying -r to query remotely:
-
- crypto/gnupg
+ stderr = <<~PKG_STATUS
+ pkg: info: no packages matching the following patterns you specified are
+ installed on the system. Try specifying -r to query remotely:
+
+ crypto/gnupg
PKG_STATUS
OpenStruct.new(stdout: stdout, stdin: stdin, stderr: stderr, status: @status, exitstatus: 1)
end
def remote_output
- stdout = <<-PKG_STATUS
- Name: security/sudo
- Summary: sudo - authority delegation tool
- State: Not Installed
- Publisher: omnios
- Version: 1.8.4.1 (1.8.4p1)
- Build Release: 5.11
- Branch: 0.151002
-Packaging Date: April 1, 2012 05:55:52 PM
- Size: 2.57 MB
- FMRI: pkg://omnios/security/sudo@1.8.4.1,5.11-0.151002:20120401T175552Z
+ stdout = <<~PKG_STATUS
+ Name: security/sudo
+ Summary: sudo - authority delegation tool
+ State: Not Installed
+ Publisher: omnios
+ Version: 1.8.4.1 (1.8.4p1)
+ Build Release: 5.11
+ Branch: 0.151002
+ Packaging Date: April 1, 2012 05:55:52 PM
+ Size: 2.57 MB
+ FMRI: pkg://omnios/security/sudo@1.8.4.1,5.11-0.151002:20120401T175552Z
PKG_STATUS
stdin = StringIO.new
stderr = ""
@@ -92,20 +92,20 @@ PKG_STATUS
it "should set the installed version if package has one" do
local = local_output
- local.stdout = <<-INSTALLED
- Name: crypto/gnupg
- Summary: GNU Privacy Guard
- Description: A complete and free implementation of the OpenPGP Standard as
- defined by RFC4880.
- Category: Applications/System Utilities
- State: Installed
- Publisher: solaris
- Version: 2.0.17
- Build Release: 5.11
- Branch: 0.175.0.0.0.2.537
-Packaging Date: October 19, 2011 09:14:50 AM
- Size: 8.07 MB
- FMRI: pkg://solaris/crypto/gnupg@2.0.17,5.11-0.175.0.0.0.2.537:20111019T091450Z
+ local.stdout = <<~INSTALLED
+ Name: crypto/gnupg
+ Summary: GNU Privacy Guard
+ Description: A complete and free implementation of the OpenPGP Standard as
+ defined by RFC4880.
+ Category: Applications/System Utilities
+ State: Installed
+ Publisher: solaris
+ Version: 2.0.17
+ Build Release: 5.11
+ Branch: 0.175.0.0.0.2.537
+ Packaging Date: October 19, 2011 09:14:50 AM
+ Size: 8.07 MB
+ FMRI: pkg://solaris/crypto/gnupg@2.0.17,5.11-0.175.0.0.0.2.537:20111019T091450Z
INSTALLED
expect(@provider).to receive(:shell_out_compacted).with("pkg", "info", @new_resource.package_name, timeout: 900).and_return(local)
expect(@provider).to receive(:shell_out_compacted!).with("pkg", "info", "-r", @new_resource.package_name, timeout: 900).and_return(remote_output)
@@ -140,17 +140,17 @@ INSTALLED
it "should not include the human-readable version in the candidate_version" do
remote = remote_output
- remote.stdout = <<-PKG_STATUS
- Name: security/sudo
- Summary: sudo - authority delegation tool
- State: Not Installed
- Publisher: omnios
- Version: 1.8.4.1 (1.8.4p1)
- Build Release: 5.11
- Branch: 0.151002
-Packaging Date: April 1, 2012 05:55:52 PM
- Size: 2.57 MB
- FMRI: pkg://omnios/security/sudo@1.8.4.1,5.11-0.151002:20120401T175552Z
+ remote.stdout = <<~PKG_STATUS
+ Name: security/sudo
+ Summary: sudo - authority delegation tool
+ State: Not Installed
+ Publisher: omnios
+ Version: 1.8.4.1 (1.8.4p1)
+ Build Release: 5.11
+ Branch: 0.151002
+ Packaging Date: April 1, 2012 05:55:52 PM
+ Size: 2.57 MB
+ FMRI: pkg://omnios/security/sudo@1.8.4.1,5.11-0.151002:20120401T175552Z
PKG_STATUS
expect(@provider).to receive(:shell_out_compacted).with("pkg", "info", @new_resource.package_name, timeout: 900).and_return(local_output)
expect(@provider).to receive(:shell_out_compacted!).with("pkg", "info", "-r", @new_resource.package_name, timeout: 900).and_return(remote)
@@ -161,36 +161,36 @@ PKG_STATUS
it "should not upgrade the package if it is already installed" do
local = local_output
- local.stdout = <<-INSTALLED
- Name: crypto/gnupg
- Summary: GNU Privacy Guard
- Description: A complete and free implementation of the OpenPGP Standard as
- defined by RFC4880.
- Category: Applications/System Utilities
- State: Installed
- Publisher: solaris
- Version: 2.0.17
- Build Release: 5.11
- Branch: 0.175.0.0.0.2.537
-Packaging Date: October 19, 2011 09:14:50 AM
- Size: 8.07 MB
- FMRI: pkg://solaris/crypto/gnupg@2.0.17,5.11-0.175.0.0.0.2.537:20111019T091450Z
+ local.stdout = <<~INSTALLED
+ Name: crypto/gnupg
+ Summary: GNU Privacy Guard
+ Description: A complete and free implementation of the OpenPGP Standard as
+ defined by RFC4880.
+ Category: Applications/System Utilities
+ State: Installed
+ Publisher: solaris
+ Version: 2.0.17
+ Build Release: 5.11
+ Branch: 0.175.0.0.0.2.537
+ Packaging Date: October 19, 2011 09:14:50 AM
+ Size: 8.07 MB
+ FMRI: pkg://solaris/crypto/gnupg@2.0.17,5.11-0.175.0.0.0.2.537:20111019T091450Z
INSTALLED
remote = remote_output
- remote.stdout = <<-REMOTE
- Name: crypto/gnupg
- Summary: GNU Privacy Guard
- Description: A complete and free implementation of the OpenPGP Standard as
- defined by RFC4880.
- Category: Applications/System Utilities
- State: Not Installed
- Publisher: solaris
- Version: 2.0.18
- Build Release: 5.11
- Branch: 0.175.0.0.0.2.537
-Packaging Date: October 19, 2011 09:14:50 AM
- Size: 8.07 MB
- FMRI: pkg://solaris/crypto/gnupg@2.0.18,5.11-0.175.0.0.0.2.537:20111019T091450Z
+ remote.stdout = <<~REMOTE
+ Name: crypto/gnupg
+ Summary: GNU Privacy Guard
+ Description: A complete and free implementation of the OpenPGP Standard as
+ defined by RFC4880.
+ Category: Applications/System Utilities
+ State: Not Installed
+ Publisher: solaris
+ Version: 2.0.18
+ Build Release: 5.11
+ Branch: 0.175.0.0.0.2.537
+ Packaging Date: October 19, 2011 09:14:50 AM
+ Size: 8.07 MB
+ FMRI: pkg://solaris/crypto/gnupg@2.0.18,5.11-0.175.0.0.0.2.537:20111019T091450Z
REMOTE
expect(@provider).to receive(:shell_out_compacted).with("pkg", "info", @new_resource.package_name, timeout: 900).and_return(local)
diff --git a/spec/unit/provider/package/macports_spec.rb b/spec/unit/provider/package/macports_spec.rb
index 54c5340d72..8b75e40d72 100644
--- a/spec/unit/provider/package/macports_spec.rb
+++ b/spec/unit/provider/package/macports_spec.rb
@@ -70,9 +70,9 @@ describe Chef::Provider::Package::Macports do
describe "current_installed_version" do
it "should return the current version if the package is installed" do
- stdout = <<EOF
-The following ports are currently installed:
- openssl @0.9.8k_0 (active)
+ stdout = <<~EOF
+ The following ports are currently installed:
+ openssl @0.9.8k_0 (active)
EOF
status = double(stdout: stdout, exitstatus: 0)
diff --git a/spec/unit/provider/package/msu_spec.rb b/spec/unit/provider/package/msu_spec.rb
index de805fcb39..49b723e572 100644
--- a/spec/unit/provider/package/msu_spec.rb
+++ b/spec/unit/provider/package/msu_spec.rb
@@ -31,66 +31,66 @@ describe Chef::Provider::Package::Msu, :windows_only do
end
let(:installed_package_list_stdout) do
- <<-EOF
-Packages listing:
-Package Identity : Package_for_KB2999486~31bf3856ad364e35~amd64~~6.1.9768.0
-Package Identity : Package_for_KB2994825~31bf3856ad364e35~amd64~~6.1.7601.0
+ <<~EOF
+ Packages listing:
+ Package Identity : Package_for_KB2999486~31bf3856ad364e35~amd64~~6.1.9768.0
+ Package Identity : Package_for_KB2994825~31bf3856ad364e35~amd64~~6.1.7601.0
EOF
end
let(:package_version_stdout) do
- <<-EOF
-Package information:
-Package Identity : Package_for_KB2664825~31bf3856ad364e35~amd64~~6.1.3.0
-State : Installed
-Dependency : Language Pack
-The operation completed successfully
+ <<~EOF
+ Package information:
+ Package Identity : Package_for_KB2664825~31bf3856ad364e35~amd64~~6.1.3.0
+ State : Installed
+ Dependency : Language Pack
+ The operation completed successfully
EOF
end
let(:get_package_info_stdout) do
- <<-EOF
-Deployment Image Servicing and Management tool
-Version: 6.1.7600.16385
-
-Image Version: 6.1.7600.16385
-
-Package information:
-Package Identity : Package_for_KB2664825~31bf3856ad364e35~amd64~~6.1.3.0
-Applicable : Yes
-Copyright : Microsoft Corporation
-Company : Microsoft Corporation
-State : Installed
-Dependency : Language Pack
-The operation completed successfully
+ <<~EOF
+ Deployment Image Servicing and Management tool
+ Version: 6.1.7600.16385
+
+ Image Version: 6.1.7600.16385
+
+ Package information:
+ Package Identity : Package_for_KB2664825~31bf3856ad364e35~amd64~~6.1.3.0
+ Applicable : Yes
+ Copyright : Microsoft Corporation
+ Company : Microsoft Corporation
+ State : Installed
+ Dependency : Language Pack
+ The operation completed successfully
EOF
end
def allow_get_packages
- get_packages_stdout = <<-EOF
-Deployment Image Servicing and Management tool
-Version: 6.1.7600.16385
-
-Image Version: 6.1.7600.16385
-
-Packages listing:
-
-Package Identity : Package_for_KB2999486~31bf3856ad364e35~amd64~~6.1.9768.0
-State : Installed
-Release Type : Language Pack
-Install Time : 2/11/2015 11:33 PM
-
-Package Identity : Package_for_KB2994825~31bf3856ad364e35~amd64~~6.1.7601.0
-State : Installed
-Release Type : Language Pack
-Install Time : 2/11/2015 11:33 PM
-
-Package Identity : Package_for_KB2664825~31bf3856ad364e35~amd64~~6.1.3.0
-State : Installed
-Release Type : Feature Pack
-Install Time : 11/21/2010 3:40 AM
-
-The operation completed successfully.
+ get_packages_stdout = <<~EOF
+ Deployment Image Servicing and Management tool
+ Version: 6.1.7600.16385
+
+ Image Version: 6.1.7600.16385
+
+ Packages listing:
+
+ Package Identity : Package_for_KB2999486~31bf3856ad364e35~amd64~~6.1.9768.0
+ State : Installed
+ Release Type : Language Pack
+ Install Time : 2/11/2015 11:33 PM
+
+ Package Identity : Package_for_KB2994825~31bf3856ad364e35~amd64~~6.1.7601.0
+ State : Installed
+ Release Type : Language Pack
+ Install Time : 2/11/2015 11:33 PM
+
+ Package Identity : Package_for_KB2664825~31bf3856ad364e35~amd64~~6.1.3.0
+ State : Installed
+ Release Type : Feature Pack
+ Install Time : 11/21/2010 3:40 AM
+
+ The operation completed successfully.
EOF
get_packages_obj = double(stdout: get_packages_stdout)
allow_any_instance_of(Chef::Provider::Package::Cab).to receive(:dism_command).with("/Get-Packages").and_return(get_packages_obj)
diff --git a/spec/unit/provider/package/pacman_spec.rb b/spec/unit/provider/package/pacman_spec.rb
index 9fbba202f5..a07c3b236d 100644
--- a/spec/unit/provider/package/pacman_spec.rb
+++ b/spec/unit/provider/package/pacman_spec.rb
@@ -32,8 +32,8 @@ describe Chef::Provider::Package::Pacman do
allow(@provider).to receive(:shell_out_compacted).and_return(@status)
@stdin = StringIO.new
- @stdout = StringIO.new(<<-ERR)
-error: package "nano" not found
+ @stdout = StringIO.new(<<~ERR)
+ error: package "nano" not found
ERR
@stderr = StringIO.new
@pid = 2342
@@ -66,26 +66,26 @@ ERR
end
it "should set the installed version if pacman has one" do
- stdout = <<-PACMAN
-Name : nano
-Version : 2.2.2-1
-URL : http://www.nano-editor.org
-Licenses : GPL
-Groups : base
-Provides : None
-Depends On : glibc ncurses
-Optional Deps : None
-Required By : None
-Conflicts With : None
-Replaces : None
-Installed Size : 1496.00 K
-Packager : Andreas Radke <andyrtr@archlinux.org>
-Architecture : i686
-Build Date : Mon 18 Jan 2010 06:16:16 PM CET
-Install Date : Mon 01 Feb 2010 10:06:30 PM CET
-Install Reason : Explicitly installed
-Install Script : Yes
-Description : Pico editor clone with enhancements
+ stdout = <<~PACMAN
+ Name : nano
+ Version : 2.2.2-1
+ URL : http://www.nano-editor.org
+ Licenses : GPL
+ Groups : base
+ Provides : None
+ Depends On : glibc ncurses
+ Optional Deps : None
+ Required By : None
+ Conflicts With : None
+ Replaces : None
+ Installed Size : 1496.00 K
+ Packager : Andreas Radke <andyrtr@archlinux.org>
+ Architecture : i686
+ Build Date : Mon 18 Jan 2010 06:16:16 PM CET
+ Install Date : Mon 01 Feb 2010 10:06:30 PM CET
+ Install Reason : Explicitly installed
+ Install Script : Yes
+ Description : Pico editor clone with enhancements
PACMAN
status = double(stdout: stdout, exitstatus: 0)
@@ -102,22 +102,22 @@ PACMAN
end
it "should use pacman.conf to determine valid repo names for package versions" do
- @pacman_conf = <<-PACMAN_CONF
-[options]
-HoldPkg = pacman glibc
-Architecture = auto
-
-[customrepo]
-Server = https://my.custom.repo
-
-[core]
-Include = /etc/pacman.d/mirrorlist
-
-[extra]
-Include = /etc/pacman.d/mirrorlist
-
-[community]
-Include = /etc/pacman.d/mirrorlist
+ @pacman_conf = <<~PACMAN_CONF
+ [options]
+ HoldPkg = pacman glibc
+ Architecture = auto
+
+ [customrepo]
+ Server = https://my.custom.repo
+
+ [core]
+ Include = /etc/pacman.d/mirrorlist
+
+ [extra]
+ Include = /etc/pacman.d/mirrorlist
+
+ [community]
+ Include = /etc/pacman.d/mirrorlist
PACMAN_CONF
status = double(stdout: "customrepo nano 1.2.3-4", exitstatus: 0)
diff --git a/spec/unit/provider/package/paludis_spec.rb b/spec/unit/provider/package/paludis_spec.rb
index a9ae5bf9d3..10c0d0f7e8 100644
--- a/spec/unit/provider/package/paludis_spec.rb
+++ b/spec/unit/provider/package/paludis_spec.rb
@@ -33,13 +33,13 @@ describe Chef::Provider::Package::Paludis do
@stdin = StringIO.new
@stderr = StringIO.new
- @stdout = <<-PKG_STATUS
-group/ntp 0 accounts
-group/ntp 0 installed-accounts
-net/ntp 4.2.6_p5-r2 arbor
-user/ntp 0 accounts
-user/ntp 0 installed-accounts
-net/ntp 4.2.6_p5-r1 installed
+ @stdout = <<~PKG_STATUS
+ group/ntp 0 accounts
+ group/ntp 0 installed-accounts
+ net/ntp 4.2.6_p5-r2 arbor
+ user/ntp 0 accounts
+ user/ntp 0 installed-accounts
+ net/ntp 4.2.6_p5-r1 installed
PKG_STATUS
@pid = 12345
@shell_out = OpenStruct.new(stdout: @stdout, stdin: @stdin, stderr: @stderr, status: @status, exitstatus: 0)
@@ -64,13 +64,13 @@ PKG_STATUS
end
it "should return new version if package is installed" do
- @stdout.replace(<<-INSTALLED)
-group/ntp 0 accounts
-group/ntp 0 installed-accounts
-net/ntp 4.2.6_p5-r2 arbor
-user/ntp 0 accounts
-user/ntp 0 installed-accounts
-net/ntp 4.2.6_p5-r1 installed
+ @stdout.replace(<<~INSTALLED)
+ group/ntp 0 accounts
+ group/ntp 0 installed-accounts
+ net/ntp 4.2.6_p5-r2 arbor
+ user/ntp 0 accounts
+ user/ntp 0 installed-accounts
+ net/ntp 4.2.6_p5-r1 installed
INSTALLED
expect(@provider).to receive(:shell_out_compacted!).and_return(@shell_out)
@provider.load_current_resource
@@ -97,18 +97,18 @@ INSTALLED
end
it "should not contain invalid characters for the version string" do
- @stdout.replace(<<-PKG_STATUS)
-sys-process/lsof 4.87 arbor
-sys-process/lsof 4.87 x86_64
+ @stdout.replace(<<~PKG_STATUS)
+ sys-process/lsof 4.87 arbor
+ sys-process/lsof 4.87 x86_64
PKG_STATUS
expect(@provider).to receive(:shell_out_compacted!).with("cave", "-L", "warning", "resolve", "-x", "=sys-process/lsof-4.87", { timeout: @new_resource.timeout || 900 })
@provider.install_package("sys-process/lsof", "4.87")
end
it "should not include the human-readable version in the candidate_version" do
- @stdout.replace(<<-PKG_STATUS)
-sys-process/lsof 4.87 arbor
-sys-process/lsof 4.87 x86_64
+ @stdout.replace(<<~PKG_STATUS)
+ sys-process/lsof 4.87 arbor
+ sys-process/lsof 4.87 x86_64
PKG_STATUS
expect(@provider).to receive(:shell_out_compacted!).and_return(@shell_out)
@provider.load_current_resource
diff --git a/spec/unit/provider/package/portage_spec.rb b/spec/unit/provider/package/portage_spec.rb
index 889053e826..08d80d3a7d 100644
--- a/spec/unit/provider/package/portage_spec.rb
+++ b/spec/unit/provider/package/portage_spec.rb
@@ -132,12 +132,12 @@ describe Chef::Provider::Package::Portage, "load_current_resource" do
end
it "should throw an exception if a category is not specified and there are duplicates" do
- stderr_output = <<EOF
-You specified an unqualified atom that matched multiple packages:
-* app-misc/sphinx
-* dev-python/sphinx
-
-Please use a more specific atom.
+ stderr_output = <<~EOF
+ You specified an unqualified atom that matched multiple packages:
+ * app-misc/sphinx
+ * dev-python/sphinx
+
+ Please use a more specific atom.
EOF
status = double(stdout: "", stderr: stderr_output, exitstatus: 1)
@provider = Chef::Provider::Package::Portage.new(@new_resource_without_category, @run_context)
diff --git a/spec/unit/provider/package/rubygems_spec.rb b/spec/unit/provider/package/rubygems_spec.rb
index 3b1a13e49c..6b33ab97f9 100644
--- a/spec/unit/provider/package/rubygems_spec.rb
+++ b/spec/unit/provider/package/rubygems_spec.rb
@@ -253,32 +253,32 @@ describe Chef::Provider::Package::Rubygems::AlternateGemEnvironment do
end
it "detects when the target gem environment is the jruby platform" do
- gem_env_out = <<-JRUBY_GEM_ENV
-RubyGems Environment:
- - RUBYGEMS VERSION: 1.3.6
- - RUBY VERSION: 1.8.7 (2010-05-12 patchlevel 249) [java]
- - INSTALLATION DIRECTORY: /Users/you/.rvm/gems/jruby-1.5.0
- - RUBY EXECUTABLE: /Users/you/.rvm/rubies/jruby-1.5.0/bin/jruby
- - EXECUTABLE DIRECTORY: /Users/you/.rvm/gems/jruby-1.5.0/bin
- - RUBYGEMS PLATFORMS:
- - ruby
- - universal-java-1.6
- - GEM PATHS:
- - /Users/you/.rvm/gems/jruby-1.5.0
- - /Users/you/.rvm/gems/jruby-1.5.0@global
- - GEM CONFIGURATION:
- - :update_sources => true
- - :verbose => true
- - :benchmark => false
- - :backtrace => false
- - :bulk_threshold => 1000
- - "install" => "--env-shebang"
- - "update" => "--env-shebang"
- - "gem" => "--no-rdoc --no-ri"
- - :sources => ["https://rubygems.org/", "http://gems.github.com/"]
- - REMOTE SOURCES:
- - https://rubygems.org/
- - http://gems.github.com/
+ gem_env_out = <<~JRUBY_GEM_ENV
+ RubyGems Environment:
+ - RUBYGEMS VERSION: 1.3.6
+ - RUBY VERSION: 1.8.7 (2010-05-12 patchlevel 249) [java]
+ - INSTALLATION DIRECTORY: /Users/you/.rvm/gems/jruby-1.5.0
+ - RUBY EXECUTABLE: /Users/you/.rvm/rubies/jruby-1.5.0/bin/jruby
+ - EXECUTABLE DIRECTORY: /Users/you/.rvm/gems/jruby-1.5.0/bin
+ - RUBYGEMS PLATFORMS:
+ - ruby
+ - universal-java-1.6
+ - GEM PATHS:
+ - /Users/you/.rvm/gems/jruby-1.5.0
+ - /Users/you/.rvm/gems/jruby-1.5.0@global
+ - GEM CONFIGURATION:
+ - :update_sources => true
+ - :verbose => true
+ - :benchmark => false
+ - :backtrace => false
+ - :bulk_threshold => 1000
+ - "install" => "--env-shebang"
+ - "update" => "--env-shebang"
+ - "gem" => "--no-rdoc --no-ri"
+ - :sources => ["https://rubygems.org/", "http://gems.github.com/"]
+ - REMOTE SOURCES:
+ - https://rubygems.org/
+ - http://gems.github.com/
JRUBY_GEM_ENV
expect(@gem_env).to receive(:shell_out_compacted!).with("/usr/weird/bin/gem env").and_return(double("jruby_gem_env", stdout: gem_env_out))
expected = ["ruby", Gem::Platform.new("universal-java-1.6")]
@@ -295,32 +295,32 @@ RubyGems Environment:
end
it "uses the current gem platforms when the target env is not jruby" do
- gem_env_out = <<-RBX_GEM_ENV
-RubyGems Environment:
- - RUBYGEMS VERSION: 1.3.6
- - RUBY VERSION: 1.8.7 (2010-05-14 patchlevel 174) [x86_64-apple-darwin10.3.0]
- - INSTALLATION DIRECTORY: /Users/ddeleo/.rvm/gems/rbx-1.0.0-20100514
- - RUBYGEMS PREFIX: /Users/ddeleo/.rvm/rubies/rbx-1.0.0-20100514
- - RUBY EXECUTABLE: /Users/ddeleo/.rvm/rubies/rbx-1.0.0-20100514/bin/rbx
- - EXECUTABLE DIRECTORY: /Users/ddeleo/.rvm/gems/rbx-1.0.0-20100514/bin
- - RUBYGEMS PLATFORMS:
- - ruby
- - x86_64-darwin-10
- - x86_64-rubinius-1.0
- - GEM PATHS:
- - /Users/ddeleo/.rvm/gems/rbx-1.0.0-20100514
- - /Users/ddeleo/.rvm/gems/rbx-1.0.0-20100514@global
- - GEM CONFIGURATION:
- - :update_sources => true
- - :verbose => true
- - :benchmark => false
- - :backtrace => false
- - :bulk_threshold => 1000
- - :sources => ["https://rubygems.org/", "http://gems.github.com/"]
- - "gem" => "--no-rdoc --no-ri"
- - REMOTE SOURCES:
- - https://rubygems.org/
- - http://gems.github.com/
+ gem_env_out = <<~RBX_GEM_ENV
+ RubyGems Environment:
+ - RUBYGEMS VERSION: 1.3.6
+ - RUBY VERSION: 1.8.7 (2010-05-14 patchlevel 174) [x86_64-apple-darwin10.3.0]
+ - INSTALLATION DIRECTORY: /Users/ddeleo/.rvm/gems/rbx-1.0.0-20100514
+ - RUBYGEMS PREFIX: /Users/ddeleo/.rvm/rubies/rbx-1.0.0-20100514
+ - RUBY EXECUTABLE: /Users/ddeleo/.rvm/rubies/rbx-1.0.0-20100514/bin/rbx
+ - EXECUTABLE DIRECTORY: /Users/ddeleo/.rvm/gems/rbx-1.0.0-20100514/bin
+ - RUBYGEMS PLATFORMS:
+ - ruby
+ - x86_64-darwin-10
+ - x86_64-rubinius-1.0
+ - GEM PATHS:
+ - /Users/ddeleo/.rvm/gems/rbx-1.0.0-20100514
+ - /Users/ddeleo/.rvm/gems/rbx-1.0.0-20100514@global
+ - GEM CONFIGURATION:
+ - :update_sources => true
+ - :verbose => true
+ - :benchmark => false
+ - :backtrace => false
+ - :bulk_threshold => 1000
+ - :sources => ["https://rubygems.org/", "http://gems.github.com/"]
+ - "gem" => "--no-rdoc --no-ri"
+ - REMOTE SOURCES:
+ - https://rubygems.org/
+ - http://gems.github.com/
RBX_GEM_ENV
expect(@gem_env).to receive(:shell_out_compacted!).with("/usr/weird/bin/gem env").and_return(double("rbx_gem_env", stdout: gem_env_out))
expect(@gem_env.gem_platforms).to eq(Gem.platforms)
diff --git a/spec/unit/provider/package/solaris_spec.rb b/spec/unit/provider/package/solaris_spec.rb
index 2ebf8fe4be..2aa37fe8b3 100644
--- a/spec/unit/provider/package/solaris_spec.rb
+++ b/spec/unit/provider/package/solaris_spec.rb
@@ -32,18 +32,18 @@ describe Chef::Provider::Package::Solaris do
describe "assessing the current package status" do
before do
- @pkginfo = <<-PKGINFO
-PKGINST: SUNWbash
-NAME: GNU Bourne-Again shell (bash)
-CATEGORY: system
-ARCH: sparc
-VERSION: 11.10.0,REV=2005.01.08.05.16
-BASEDIR: /
-VENDOR: Sun Microsystems, Inc.
-DESC: GNU Bourne-Again shell (bash) version 3.0
-PSTAMP: sfw10-patch20070430084444
-INSTDATE: Nov 04 2009 01:02
-HOTLINE: Please contact your local service provider
+ @pkginfo = <<~PKGINFO
+ PKGINST: SUNWbash
+ NAME: GNU Bourne-Again shell (bash)
+ CATEGORY: system
+ ARCH: sparc
+ VERSION: 11.10.0,REV=2005.01.08.05.16
+ BASEDIR: /
+ VENDOR: Sun Microsystems, Inc.
+ DESC: GNU Bourne-Again shell (bash) version 3.0
+ PSTAMP: sfw10-patch20070430084444
+ INSTDATE: Nov 04 2009 01:02
+ HOTLINE: Please contact your local service provider
PKGINFO
@status = double("Status", stdout: "", exitstatus: 0)
diff --git a/spec/unit/provider/service/arch_service_spec.rb b/spec/unit/provider/service/arch_service_spec.rb
index 818c2ccb27..18db25fef9 100644
--- a/spec/unit/provider/service/arch_service_spec.rb
+++ b/spec/unit/provider/service/arch_service_spec.rb
@@ -117,10 +117,10 @@ describe Chef::Provider::Service::Arch, "load_current_resource" do
describe "when discovering service status with ps" do
before do
- @stdout = StringIO.new(<<-DEFAULT_PS)
-aj 7842 5057 0 21:26 pts/2 00:00:06 vi init.rb
-aj 7903 5016 0 21:26 pts/5 00:00:00 /bin/bash
-aj 8119 6041 0 21:34 pts/3 00:00:03 vi init_service_spec.rb
+ @stdout = StringIO.new(<<~DEFAULT_PS)
+ aj 7842 5057 0 21:26 pts/2 00:00:06 vi init.rb
+ aj 7903 5016 0 21:26 pts/5 00:00:00 /bin/bash
+ aj 8119 6041 0 21:34 pts/3 00:00:03 vi init_service_spec.rb
DEFAULT_PS
@status = double("Status", exitstatus: 0, stdout: @stdout)
allow(@provider).to receive(:shell_out!).and_return(@status)
@@ -129,9 +129,9 @@ DEFAULT_PS
end
it "determines the service is running when it appears in ps" do
- @stdout = StringIO.new(<<-RUNNING_PS)
-aj 7842 5057 0 21:26 pts/2 00:00:06 chef
-aj 7842 5057 0 21:26 pts/2 00:00:06 poos
+ @stdout = StringIO.new(<<~RUNNING_PS)
+ aj 7842 5057 0 21:26 pts/2 00:00:06 chef
+ aj 7842 5057 0 21:26 pts/2 00:00:06 poos
RUNNING_PS
allow(@status).to receive(:stdout).and_return(@stdout)
@provider.load_current_resource
diff --git a/spec/unit/provider/service/freebsd_service_spec.rb b/spec/unit/provider/service/freebsd_service_spec.rb
index 11a02c3421..954ef3d153 100644
--- a/spec/unit/provider/service/freebsd_service_spec.rb
+++ b/spec/unit/provider/service/freebsd_service_spec.rb
@@ -138,10 +138,10 @@ describe Chef::Provider::Service::Freebsd do
context "when we have a 'ps' attribute" do
let(:stdout) do
- StringIO.new(<<-PS_SAMPLE)
-413 ?? Ss 0:02.51 /usr/sbin/syslogd -s
-539 ?? Is 0:00.14 /usr/sbin/sshd
-545 ?? Ss 0:17.53 sendmail: accepting connections (sendmail)
+ StringIO.new(<<~PS_SAMPLE)
+ 413 ?? Ss 0:02.51 /usr/sbin/syslogd -s
+ 539 ?? Is 0:00.14 /usr/sbin/sshd
+ 545 ?? Ss 0:17.53 sendmail: accepting connections (sendmail)
PS_SAMPLE
end
let(:status) { double(stdout: stdout, exitstatus: 0) }
@@ -163,9 +163,9 @@ PS_SAMPLE
context "when the regex matches the output" do
let(:stdout) do
- StringIO.new(<<-PS_SAMPLE)
-555 ?? Ss 0:05.16 /usr/sbin/cron -s
- 9881 ?? Ss 0:06.67 /usr/local/sbin/httpd -DNOHTTPACCEPT
+ StringIO.new(<<~PS_SAMPLE)
+ 555 ?? Ss 0:05.16 /usr/sbin/cron -s
+ 9881 ?? Ss 0:06.67 /usr/local/sbin/httpd -DNOHTTPACCEPT
PS_SAMPLE
end
@@ -341,9 +341,9 @@ PS_SAMPLE
context "when the rc script has a 'name' variable" do
let(:rcscript) do
- StringIO.new(<<-EOF)
-name="#{new_resource.service_name}"
-rcvar=`set_rcvar`
+ StringIO.new(<<~EOF)
+ name="#{new_resource.service_name}"
+ rcvar=`set_rcvar`
EOF
end
@@ -363,8 +363,8 @@ EOF
describe "when the rcscript does not have a name variable" do
let(:rcscript) do
- StringIO.new <<-EOF
-rcvar=`set_rcvar`
+ StringIO.new <<~EOF
+ rcvar=`set_rcvar`
EOF
end
@@ -375,11 +375,11 @@ EOF
describe "when rcvar returns foobar_enable" do
let(:rcvar_stdout) do
- rcvar_stdout = <<-EOF
-# apache22
-#
-# #{new_resource.service_name}_enable="YES"
-# (default: "")
+ rcvar_stdout = <<~EOF
+ # apache22
+ #
+ # #{new_resource.service_name}_enable="YES"
+ # (default: "")
EOF
end
@@ -394,9 +394,9 @@ EOF
describe "when rcvar does not return foobar_enable" do
let(:rcvar_stdout) do
- rcvar_stdout = <<-EOF
-# service_with_noname
-#
+ rcvar_stdout = <<~EOF
+ # service_with_noname
+ #
EOF
end
diff --git a/spec/unit/provider/service/init_service_spec.rb b/spec/unit/provider/service/init_service_spec.rb
index 5d403c6898..7bbe2c6363 100644
--- a/spec/unit/provider/service/init_service_spec.rb
+++ b/spec/unit/provider/service/init_service_spec.rb
@@ -32,10 +32,10 @@ describe Chef::Provider::Service::Init, "load_current_resource" do
@provider = Chef::Provider::Service::Init.new(@new_resource, @run_context)
allow(Chef::Resource::Service).to receive(:new).and_return(@current_resource)
- @stdout = StringIO.new(<<-PS)
-aj 7842 5057 0 21:26 pts/2 00:00:06 vi init.rb
-aj 7903 5016 0 21:26 pts/5 00:00:00 /bin/bash
-aj 8119 6041 0 21:34 pts/3 00:00:03 vi init_service_spec.rb
+ @stdout = StringIO.new(<<~PS)
+ aj 7842 5057 0 21:26 pts/2 00:00:06 vi init.rb
+ aj 7903 5016 0 21:26 pts/5 00:00:00 /bin/bash
+ aj 8119 6041 0 21:34 pts/3 00:00:03 vi init_service_spec.rb
PS
@status = double("Status", exitstatus: 0, stdout: @stdout)
allow(@provider).to receive(:shell_out!).and_return(@status)
@@ -133,9 +133,9 @@ PS
end
it "should set running to true if the regex matches the output" do
- @stdout = StringIO.new(<<-RUNNING_PS)
-aj 7842 5057 0 21:26 pts/2 00:00:06 chef
-aj 7842 5057 0 21:26 pts/2 00:00:06 poos
+ @stdout = StringIO.new(<<~RUNNING_PS)
+ aj 7842 5057 0 21:26 pts/2 00:00:06 chef
+ aj 7842 5057 0 21:26 pts/2 00:00:06 poos
RUNNING_PS
allow(@status).to receive(:stdout).and_return(@stdout)
@provider.load_current_resource
diff --git a/spec/unit/provider/service/invokercd_service_spec.rb b/spec/unit/provider/service/invokercd_service_spec.rb
index a63e3e1afb..2e30c16da4 100644
--- a/spec/unit/provider/service/invokercd_service_spec.rb
+++ b/spec/unit/provider/service/invokercd_service_spec.rb
@@ -32,10 +32,10 @@ describe Chef::Provider::Service::Invokercd, "load_current_resource" do
@provider = Chef::Provider::Service::Invokercd.new(@new_resource, @run_context)
allow(Chef::Resource::Service).to receive(:new).and_return(@current_resource)
- @stdout = StringIO.new(<<-PS)
-aj 7842 5057 0 21:26 pts/2 00:00:06 vi init.rb
-aj 7903 5016 0 21:26 pts/5 00:00:00 /bin/bash
-aj 8119 6041 0 21:34 pts/3 00:00:03 vi init_service_spec.rb
+ @stdout = StringIO.new(<<~PS)
+ aj 7842 5057 0 21:26 pts/2 00:00:06 vi init.rb
+ aj 7903 5016 0 21:26 pts/5 00:00:00 /bin/bash
+ aj 8119 6041 0 21:34 pts/3 00:00:03 vi init_service_spec.rb
PS
@status = double("Status", exitstatus: 0, stdout: @stdout)
allow(@provider).to receive(:shell_out!).and_return(@status)
@@ -118,9 +118,9 @@ PS
end
it "should set running to true if the regex matches the output" do
- @stdout = StringIO.new(<<-RUNNING_PS)
-aj 7842 5057 0 21:26 pts/2 00:00:06 chef
-aj 7842 5057 0 21:26 pts/2 00:00:06 poos
+ @stdout = StringIO.new(<<~RUNNING_PS)
+ aj 7842 5057 0 21:26 pts/2 00:00:06 chef
+ aj 7842 5057 0 21:26 pts/2 00:00:06 poos
RUNNING_PS
@status = double("Status", exitstatus: 0, stdout: @stdout)
expect(@provider).to receive(:shell_out!).and_return(@status)
diff --git a/spec/unit/provider/service/macosx_spec.rb b/spec/unit/provider/service/macosx_spec.rb
index 5ca06d9ec8..0c71eb604f 100644
--- a/spec/unit/provider/service/macosx_spec.rb
+++ b/spec/unit/provider/service/macosx_spec.rb
@@ -48,15 +48,15 @@ describe Chef::Provider::Service::Macosx do
let(:run_context) { Chef::RunContext.new(node, {}, events) }
let(:provider) { described_class.new(new_resource, run_context) }
let(:launchctl_stdout) { StringIO.new }
- let(:plutil_stdout) { String.new <<-XML }
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>Label</key>
- <string>io.redis.redis-server</string>
-</dict>
-</plist>
+ let(:plutil_stdout) { String.new <<~XML }
+ <?xml version="1.0" encoding="UTF-8"?>
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+ <plist version="1.0">
+ <dict>
+ <key>Label</key>
+ <string>io.redis.redis-server</string>
+ </dict>
+ </plist>
XML
%w{Daemon Agent}.each do |service_type|
@@ -136,20 +136,20 @@ XML
end
context "when launchctl returns pid in service list" do
- let(:launchctl_stdout) { StringIO.new <<-SVC_LIST }
-{
- "LimitLoadToSessionType" = "System";
- "Label" = "io.redis.redis-server";
- "TimeOut" = 30;
- "OnDemand" = false;
- "LastExitStatus" = 0;
- "PID" = 62803;
- "Program" = "do_some.sh";
- "ProgramArguments" = (
- "path/to/do_something.sh";
- "-f";
- );
-};
+ let(:launchctl_stdout) { StringIO.new <<~SVC_LIST }
+ {
+ "LimitLoadToSessionType" = "System";
+ "Label" = "io.redis.redis-server";
+ "TimeOut" = 30;
+ "OnDemand" = false;
+ "LastExitStatus" = 0;
+ "PID" = 62803;
+ "Program" = "do_some.sh";
+ "ProgramArguments" = (
+ "path/to/do_something.sh";
+ "-f";
+ );
+ };
SVC_LIST
before do
@@ -175,19 +175,19 @@ SVC_LIST
end
end
context "when launchctl returns empty service pid" do
- let(:launchctl_stdout) { StringIO.new <<-SVC_LIST }
-{
- "LimitLoadToSessionType" = "System";
- "Label" = "io.redis.redis-server";
- "TimeOut" = 30;
- "OnDemand" = false;
- "LastExitStatus" = 0;
- "Program" = "do_some.sh";
- "ProgramArguments" = (
- "path/to/do_something.sh";
- "-f";
- );
-};
+ let(:launchctl_stdout) { StringIO.new <<~SVC_LIST }
+ {
+ "LimitLoadToSessionType" = "System";
+ "Label" = "io.redis.redis-server";
+ "TimeOut" = 30;
+ "OnDemand" = false;
+ "LastExitStatus" = 0;
+ "Program" = "do_some.sh";
+ "ProgramArguments" = (
+ "path/to/do_something.sh";
+ "-f";
+ );
+ };
SVC_LIST
before do
@@ -204,8 +204,8 @@ SVC_LIST
end
context "when launchctl doesn't return service entry at all" do
- let(:launchctl_stdout) { StringIO.new <<-SVC_LIST }
-Could not find service "io.redis.redis-server" in domain for system
+ let(:launchctl_stdout) { StringIO.new <<~SVC_LIST }
+ Could not find service "io.redis.redis-server" in domain for system
SVC_LIST
it "sets service running state to false" do
diff --git a/spec/unit/provider/service/simple_service_spec.rb b/spec/unit/provider/service/simple_service_spec.rb
index e9fe1b0482..4481a7c0e3 100644
--- a/spec/unit/provider/service/simple_service_spec.rb
+++ b/spec/unit/provider/service/simple_service_spec.rb
@@ -31,10 +31,10 @@ describe Chef::Provider::Service::Simple, "load_current_resource" do
@provider = Chef::Provider::Service::Simple.new(@new_resource, @run_context)
allow(Chef::Resource::Service).to receive(:new).and_return(@current_resource)
- @stdout = StringIO.new(<<-NOMOCKINGSTRINGSPLZ)
-aj 7842 5057 0 21:26 pts/2 00:00:06 vi init.rb
-aj 7903 5016 0 21:26 pts/5 00:00:00 /bin/bash
-aj 8119 6041 0 21:34 pts/3 00:00:03 vi simple_service_spec.rb
+ @stdout = StringIO.new(<<~NOMOCKINGSTRINGSPLZ)
+ aj 7842 5057 0 21:26 pts/2 00:00:06 vi init.rb
+ aj 7903 5016 0 21:26 pts/5 00:00:00 /bin/bash
+ aj 8119 6041 0 21:34 pts/3 00:00:03 vi simple_service_spec.rb
NOMOCKINGSTRINGSPLZ
@status = double("Status", exitstatus: 0, stdout: @stdout)
allow(@provider).to receive(:shell_out!).and_return(@status)
@@ -75,9 +75,9 @@ NOMOCKINGSTRINGSPLZ
end
it "should set running to true if the regex matches the output" do
- @stdout = StringIO.new(<<-NOMOCKINGSTRINGSPLZ)
-aj 7842 5057 0 21:26 pts/2 00:00:06 chef
-aj 7842 5057 0 21:26 pts/2 00:00:06 poos
+ @stdout = StringIO.new(<<~NOMOCKINGSTRINGSPLZ)
+ aj 7842 5057 0 21:26 pts/2 00:00:06 chef
+ aj 7842 5057 0 21:26 pts/2 00:00:06 poos
NOMOCKINGSTRINGSPLZ
@status = double("Status", exitstatus: 0, stdout: @stdout)
allow(@provider).to receive(:shell_out!).and_return(@status)
diff --git a/spec/unit/provider/template/content_spec.rb b/spec/unit/provider/template/content_spec.rb
index fb5d127d57..67d4eba138 100644
--- a/spec/unit/provider/template/content_spec.rb
+++ b/spec/unit/provider/template/content_spec.rb
@@ -147,21 +147,21 @@ describe Chef::Provider::Template::Content do
end
it "creates the template with the rendered content" do
- expect(IO.read(content.tempfile.path)).to eql <<EOF
-openldap
-default
-#{CHEF_SPEC_DATA}/cookbooks/openldap/recipes/default.rb:2:in `from_file'
-#{CHEF_SPEC_DATA}/cookbooks/openldap/recipes/default.rb
-2
-helpers.erb
-#{CHEF_SPEC_DATA}/cookbooks/openldap/templates/default/helpers.erb
-openldap
-default
-#{CHEF_SPEC_DATA}/cookbooks/openldap/recipes/default.rb:2:in `from_file'
-#{CHEF_SPEC_DATA}/cookbooks/openldap/recipes/default.rb
-2
-helpers.erb
-#{CHEF_SPEC_DATA}/cookbooks/openldap/templates/default/helpers.erb
+ expect(IO.read(content.tempfile.path)).to eql <<~EOF
+ openldap
+ default
+ #{CHEF_SPEC_DATA}/cookbooks/openldap/recipes/default.rb:2:in `from_file'
+ #{CHEF_SPEC_DATA}/cookbooks/openldap/recipes/default.rb
+ 2
+ helpers.erb
+ #{CHEF_SPEC_DATA}/cookbooks/openldap/templates/default/helpers.erb
+ openldap
+ default
+ #{CHEF_SPEC_DATA}/cookbooks/openldap/recipes/default.rb:2:in `from_file'
+ #{CHEF_SPEC_DATA}/cookbooks/openldap/recipes/default.rb
+ 2
+ helpers.erb
+ #{CHEF_SPEC_DATA}/cookbooks/openldap/templates/default/helpers.erb
EOF
end
diff --git a/spec/unit/provider/zypper_repository_spec.rb b/spec/unit/provider/zypper_repository_spec.rb
index 3a26876f99..fc8ff14afb 100644
--- a/spec/unit/provider/zypper_repository_spec.rb
+++ b/spec/unit/provider/zypper_repository_spec.rb
@@ -20,17 +20,17 @@ require "spec_helper"
# Output of the command:
# => rpm -qa gpg-pubkey*
-RPM_KEYS = <<-EOF
-gpg-pubkey-307e3d54-4be01a65
-gpg-pubkey-3dbdc284-53674dd4
+RPM_KEYS = <<~EOF
+ gpg-pubkey-307e3d54-4be01a65
+ gpg-pubkey-3dbdc284-53674dd4
EOF
# Output of the command:
# => gpg --with-fingerprint [FILE]
-GPG_FINGER = <<-EOF
-pub 2048R/3DBDC284 2011-08-19 [expires: 2024-06-14]
- Key fingerprint = 573B FD6B 3D8F BC64 1079 A6AB ABF5 BD82 7BD9 BF62
-uid nginx signing key <signing-key@nginx.com>
+GPG_FINGER = <<~EOF
+ pub 2048R/3DBDC284 2011-08-19 [expires: 2024-06-14]
+ Key fingerprint = 573B FD6B 3D8F BC64 1079 A6AB ABF5 BD82 7BD9 BF62
+ uid nginx signing key <signing-key@nginx.com>
EOF
describe Chef::Provider::ZypperRepository do
diff --git a/spec/unit/resource_inspector_spec.rb b/spec/unit/resource_inspector_spec.rb
index 2cb9c0bb65..aef92732b3 100644
--- a/spec/unit/resource_inspector_spec.rb
+++ b/spec/unit/resource_inspector_spec.rb
@@ -21,9 +21,9 @@ class DummyResource < Chef::Resource
resource_name :dummy
description "A dummy resource"
examples <<~EOH
- dummy "foo" do
- first "yes"
- end
+ dummy "foo" do
+ first "yes"
+ end
EOH
introduced "14.0"
property :first, String, description: "My First Property", introduced: "14.0"
diff --git a/spec/unit/resource_spec.rb b/spec/unit/resource_spec.rb
index 28a1e01872..92429e3257 100644
--- a/spec/unit/resource_spec.rb
+++ b/spec/unit/resource_spec.rb
@@ -400,16 +400,16 @@ describe Chef::Resource do
it "can have some examples" do
c = Class.new(Chef::Resource) do
- examples <<-EOH
-resource "foo" do
- foo foo
-end
+ examples <<~EOH
+ resource "foo" do
+ foo foo
+ end
EOH
end
- expect(c.examples).to eq <<-EOH
-resource "foo" do
- foo foo
-end
+ expect(c.examples).to eq <<~EOH
+ resource "foo" do
+ foo foo
+ end
EOH
end
end
diff --git a/spec/unit/role_spec.rb b/spec/unit/role_spec.rb
index 9c8900d464..b1400ae4f3 100644
--- a/spec/unit/role_spec.rb
+++ b/spec/unit/role_spec.rb
@@ -245,9 +245,9 @@ describe Chef::Role do
end
end
- ROLE_DSL = <<-EOR
-name "ceiling_cat"
-description "like Aliens, but furry"
+ ROLE_DSL = <<~EOR
+ name "ceiling_cat"
+ description "like Aliens, but furry"
EOR
describe "when loading from disk" do
diff --git a/spec/unit/runner_spec.rb b/spec/unit/runner_spec.rb
index db52862a9c..1effe3157c 100644
--- a/spec/unit/runner_spec.rb
+++ b/spec/unit/runner_spec.rb
@@ -258,10 +258,10 @@ describe Chef::Runner do
end
expect(exception).to be_a(Chef::Exceptions::MultipleFailures)
- expected_message = <<-E
-Multiple failures occurred:
-* FailureProvider::ChefClientFail occurred in delayed notification: [explode] (dynamically defined) had an error: FailureProvider::ChefClientFail: chef had an error of some sort
-* FailureProvider::ChefClientFail occurred in delayed notification: [explode again] (dynamically defined) had an error: FailureProvider::ChefClientFail: chef had an error of some sort
+ expected_message = <<~E
+ Multiple failures occurred:
+ * FailureProvider::ChefClientFail occurred in delayed notification: [explode] (dynamically defined) had an error: FailureProvider::ChefClientFail: chef had an error of some sort
+ * FailureProvider::ChefClientFail occurred in delayed notification: [explode again] (dynamically defined) had an error: FailureProvider::ChefClientFail: chef had an error of some sort
E
expect(exception.message).to eq(expected_message)
diff --git a/spec/unit/util/dsc/lcm_output_parser_spec.rb b/spec/unit/util/dsc/lcm_output_parser_spec.rb
index 65eaafe19c..32e5c0e07f 100644
--- a/spec/unit/util/dsc/lcm_output_parser_spec.rb
+++ b/spec/unit/util/dsc/lcm_output_parser_spec.rb
@@ -47,11 +47,11 @@ describe Chef::Util::DSC::LocalConfigurationManager::Parser do
context "correctly formatted output from lcm for WhatIfParser" do
it "returns a single resource when only 1 logged with the correct name" do
- str = <<EOF
-logtype: [machinename]: LCM: [ Start Set ]
-logtype: [machinename]: LCM: [ Start Resource ] [name]
-logtype: [machinename]: LCM: [ End Resource ] [name]
-logtype: [machinename]: LCM: [ End Set ]
+ str = <<~EOF
+ logtype: [machinename]: LCM: [ Start Set ]
+ logtype: [machinename]: LCM: [ Start Resource ] [name]
+ logtype: [machinename]: LCM: [ End Resource ] [name]
+ logtype: [machinename]: LCM: [ End Set ]
EOF
resources = Chef::Util::DSC::LocalConfigurationManager::Parser.parse(str, false)
expect(resources.length).to eq(1)
@@ -59,51 +59,51 @@ EOF
end
it "identifies when a resource changes the state of the system" do
- str = <<EOF
-logtype: [machinename]: LCM: [ Start Set ]
-logtype: [machinename]: LCM: [ Start Resource ] [name]
-logtype: [machinename]: LCM: [ Start Set ] [name]
-logtype: [machinename]: LCM: [ End Set ] [name]
-logtype: [machinename]: LCM: [ End Resource ] [name]
-logtype: [machinename]: LCM: [ End Set ]
+ str = <<~EOF
+ logtype: [machinename]: LCM: [ Start Set ]
+ logtype: [machinename]: LCM: [ Start Resource ] [name]
+ logtype: [machinename]: LCM: [ Start Set ] [name]
+ logtype: [machinename]: LCM: [ End Set ] [name]
+ logtype: [machinename]: LCM: [ End Resource ] [name]
+ logtype: [machinename]: LCM: [ End Set ]
EOF
resources = Chef::Util::DSC::LocalConfigurationManager::Parser.parse(str, false)
expect(resources[0].changes_state?).to be_truthy
end
it "preserves the log provided for how the system changed the state" do
- str = <<EOF
-logtype: [machinename]: LCM: [ Start Set ]
-logtype: [machinename]: LCM: [ Start Resource ] [name]
-logtype: [machinename]: LCM: [ Start Set ] [name]
-logtype: [machinename]: [message]
-logtype: [machinename]: LCM: [ End Set ] [name]
-logtype: [machinename]: LCM: [ End Resource ] [name]
-logtype: [machinename]: LCM: [ End Set ]
+ str = <<~EOF
+ logtype: [machinename]: LCM: [ Start Set ]
+ logtype: [machinename]: LCM: [ Start Resource ] [name]
+ logtype: [machinename]: LCM: [ Start Set ] [name]
+ logtype: [machinename]: [message]
+ logtype: [machinename]: LCM: [ End Set ] [name]
+ logtype: [machinename]: LCM: [ End Resource ] [name]
+ logtype: [machinename]: LCM: [ End Set ]
EOF
resources = Chef::Util::DSC::LocalConfigurationManager::Parser.parse(str, false)
expect(resources[0].change_log).to match_array(["[name]", "[message]", "[name]"])
end
it "returns false for changes_state?" do
- str = <<EOF
-logtype: [machinename]: LCM: [ Start Set ]
-logtype: [machinename]: LCM: [ Start Resource ] [name]
-logtype: [machinename]: LCM: [ Skip Set ] [name]
-logtype: [machinename]: LCM: [ End Resource ] [name]
-logtype: [machinename]: LCM: [ End Set ]
+ str = <<~EOF
+ logtype: [machinename]: LCM: [ Start Set ]
+ logtype: [machinename]: LCM: [ Start Resource ] [name]
+ logtype: [machinename]: LCM: [ Skip Set ] [name]
+ logtype: [machinename]: LCM: [ End Resource ] [name]
+ logtype: [machinename]: LCM: [ End Set ]
EOF
resources = Chef::Util::DSC::LocalConfigurationManager::Parser.parse(str, false)
expect(resources[0].changes_state?).to be_falsey
end
it "returns an empty array for change_log if changes_state? is false" do
- str = <<EOF
-logtype: [machinename]: LCM: [ Start Set ]
-logtype: [machinename]: LCM: [ Start Resource ] [name]
-logtype: [machinename]: LCM: [ Skip Set ] [name]
-logtype: [machinename]: LCM: [ End Resource ] [name]
-logtype: [machinename]: LCM: [ End Set ]
+ str = <<~EOF
+ logtype: [machinename]: LCM: [ Start Set ]
+ logtype: [machinename]: LCM: [ Start Resource ] [name]
+ logtype: [machinename]: LCM: [ Skip Set ] [name]
+ logtype: [machinename]: LCM: [ End Resource ] [name]
+ logtype: [machinename]: LCM: [ End Set ]
EOF
resources = Chef::Util::DSC::LocalConfigurationManager::Parser.parse(str, false)
expect(resources[0].change_log).to be_empty
@@ -112,12 +112,12 @@ EOF
context "correctly formatted output from lcm for TestDSCParser" do
it "returns a single resource when only 1 logged with the correct name" do
- str = <<EOF
-InDesiredState : False
-ResourcesInDesiredState :
-ResourcesNotInDesiredState: [name]
-ReturnValue : 0
-PSComputerName : .
+ str = <<~EOF
+ InDesiredState : False
+ ResourcesInDesiredState :
+ ResourcesNotInDesiredState: [name]
+ ReturnValue : 0
+ PSComputerName : .
EOF
resources = Chef::Util::DSC::LocalConfigurationManager::Parser.parse(str, true)
expect(resources.length).to eq(1)
@@ -125,36 +125,36 @@ EOF
end
it "identifies when a resource changes the state of the system" do
- str = <<EOF
-InDesiredState : False
-ResourcesInDesiredState :
-ResourcesNotInDesiredState: [name]
-ReturnValue : 0
-PSComputerName : .
+ str = <<~EOF
+ InDesiredState : False
+ ResourcesInDesiredState :
+ ResourcesNotInDesiredState: [name]
+ ReturnValue : 0
+ PSComputerName : .
EOF
resources = Chef::Util::DSC::LocalConfigurationManager::Parser.parse(str, true)
expect(resources[0].changes_state?).to be_truthy
end
it "returns false for changes_state?" do
- str = <<EOF
-InDesiredState : True
-ResourcesInDesiredState : [name]
-ResourcesNotInDesiredState:
-ReturnValue : 0
-PSComputerName : .
+ str = <<~EOF
+ InDesiredState : True
+ ResourcesInDesiredState : [name]
+ ResourcesNotInDesiredState:
+ ReturnValue : 0
+ PSComputerName : .
EOF
resources = Chef::Util::DSC::LocalConfigurationManager::Parser.parse(str, true)
expect(resources[0].changes_state?).to be_falsey
end
it "returns an empty array for change_log if changes_state? is false" do
- str = <<EOF
-InDesiredState : True
-ResourcesInDesiredState : [name]
-ResourcesNotInDesiredState:
-ReturnValue : 0
-PSComputerName : .
+ str = <<~EOF
+ InDesiredState : True
+ ResourcesInDesiredState : [name]
+ ResourcesNotInDesiredState:
+ ReturnValue : 0
+ PSComputerName : .
EOF
resources = Chef::Util::DSC::LocalConfigurationManager::Parser.parse(str, true)
expect(resources[0].change_log).to be_empty
@@ -163,19 +163,19 @@ EOF
context "Incorrectly formatted output from LCM for WhatIfParser" do
it "allows missing [End Resource] when its the last one and still find all the resource" do
- str = <<-EOF
-logtype: [machinename]: LCM: [ Start Set ]
-logtype: [machinename]: LCM: [ Start Resource ] [name]
-logtype: [machinename]: LCM: [ Start Test ]
-logtype: [machinename]: LCM: [ End Test ]
-logtype: [machinename]: LCM: [ Skip Set ]
-logtype: [machinename]: LCM: [ End Resource ]
-logtype: [machinename]: LCM: [ Start Resource ] [name2]
-logtype: [machinename]: LCM: [ Start Test ]
-logtype: [machinename]: LCM: [ End Test ]
-logtype: [machinename]: LCM: [ Start Set ]
-logtype: [machinename]: LCM: [ End Set ]
-logtype: [machinename]: LCM: [ End Set ]
+ str = <<~EOF
+ logtype: [machinename]: LCM: [ Start Set ]
+ logtype: [machinename]: LCM: [ Start Resource ] [name]
+ logtype: [machinename]: LCM: [ Start Test ]
+ logtype: [machinename]: LCM: [ End Test ]
+ logtype: [machinename]: LCM: [ Skip Set ]
+ logtype: [machinename]: LCM: [ End Resource ]
+ logtype: [machinename]: LCM: [ Start Resource ] [name2]
+ logtype: [machinename]: LCM: [ Start Test ]
+ logtype: [machinename]: LCM: [ End Test ]
+ logtype: [machinename]: LCM: [ Start Set ]
+ logtype: [machinename]: LCM: [ End Set ]
+ logtype: [machinename]: LCM: [ End Set ]
EOF
resources = Chef::Util::DSC::LocalConfigurationManager::Parser.parse(str, false)
@@ -184,19 +184,19 @@ EOF
end
it "allow missing [End Resource] when its the first one and still find all the resource" do
- str = <<-EOF
-logtype: [machinename]: LCM: [ Start Set ]
-logtype: [machinename]: LCM: [ Start Resource ] [name]
-logtype: [machinename]: LCM: [ Start Test ]
-logtype: [machinename]: LCM: [ End Test ]
-logtype: [machinename]: LCM: [ Skip Set ]
-logtype: [machinename]: LCM: [ Start Resource ] [name2]
-logtype: [machinename]: LCM: [ Start Test ]
-logtype: [machinename]: LCM: [ End Test ]
-logtype: [machinename]: LCM: [ Start Set ]
-logtype: [machinename]: LCM: [ End Set ]
-logtype: [machinename]: LCM: [ End Resource ]
-logtype: [machinename]: LCM: [ End Set ]
+ str = <<~EOF
+ logtype: [machinename]: LCM: [ Start Set ]
+ logtype: [machinename]: LCM: [ Start Resource ] [name]
+ logtype: [machinename]: LCM: [ Start Test ]
+ logtype: [machinename]: LCM: [ End Test ]
+ logtype: [machinename]: LCM: [ Skip Set ]
+ logtype: [machinename]: LCM: [ Start Resource ] [name2]
+ logtype: [machinename]: LCM: [ Start Test ]
+ logtype: [machinename]: LCM: [ End Test ]
+ logtype: [machinename]: LCM: [ Start Set ]
+ logtype: [machinename]: LCM: [ End Set ]
+ logtype: [machinename]: LCM: [ End Resource ]
+ logtype: [machinename]: LCM: [ End Set ]
EOF
resources = Chef::Util::DSC::LocalConfigurationManager::Parser.parse(str, false)
@@ -205,18 +205,18 @@ EOF
end
it "allows missing set and end resource and assume an unconverged resource in this case" do
- str = <<-EOF
-logtype: [machinename]: LCM: [ Start Set ]
-logtype: [machinename]: LCM: [ Start Resource ] [name]
-logtype: [machinename]: LCM: [ Start Test ]
-logtype: [machinename]: LCM: [ End Test ]
-logtype: [machinename]: LCM: [ Start Resource ] [name2]
-logtype: [machinename]: LCM: [ Start Test ]
-logtype: [machinename]: LCM: [ End Test ]
-logtype: [machinename]: LCM: [ Start Set ]
-logtype: [machinename]: LCM: [ End Set ]
-logtype: [machinename]: LCM: [ End Resource ]
-logtype: [machinename]: LCM: [ End Set ]
+ str = <<~EOF
+ logtype: [machinename]: LCM: [ Start Set ]
+ logtype: [machinename]: LCM: [ Start Resource ] [name]
+ logtype: [machinename]: LCM: [ Start Test ]
+ logtype: [machinename]: LCM: [ End Test ]
+ logtype: [machinename]: LCM: [ Start Resource ] [name2]
+ logtype: [machinename]: LCM: [ Start Test ]
+ logtype: [machinename]: LCM: [ End Test ]
+ logtype: [machinename]: LCM: [ Start Set ]
+ logtype: [machinename]: LCM: [ End Set ]
+ logtype: [machinename]: LCM: [ End Resource ]
+ logtype: [machinename]: LCM: [ End Set ]
EOF
resources = Chef::Util::DSC::LocalConfigurationManager::Parser.parse(str, false)
expect(resources[0].changes_state?).to be_truthy
@@ -228,17 +228,17 @@ EOF
context "Incorrectly formatted output from LCM for TestDSCParser" do
it "allows missing [End Resource] when its the last one and still find all the resource" do
- str = <<EOF
-InDesiredState : True
-ResourcesInDesiredState :
-ResourcesNotInDesiredState: [name]
-ReturnValue : 0
-PSComputerName : .
-InDesiredState : True
-ResourcesInDesiredState :
-ResourcesNotInDesiredState: [name2]
-ReturnValue : 0
-PSComputerName : .
+ str = <<~EOF
+ InDesiredState : True
+ ResourcesInDesiredState :
+ ResourcesNotInDesiredState: [name]
+ ReturnValue : 0
+ PSComputerName : .
+ InDesiredState : True
+ ResourcesInDesiredState :
+ ResourcesNotInDesiredState: [name2]
+ ReturnValue : 0
+ PSComputerName : .
EOF
resources = Chef::Util::DSC::LocalConfigurationManager::Parser.parse(str, true)
diff --git a/spec/unit/util/dsc/local_configuration_manager_spec.rb b/spec/unit/util/dsc/local_configuration_manager_spec.rb
index 33c618f2eb..cce5a39537 100644
--- a/spec/unit/util/dsc/local_configuration_manager_spec.rb
+++ b/spec/unit/util/dsc/local_configuration_manager_spec.rb
@@ -24,28 +24,28 @@ describe Chef::Util::DSC::LocalConfigurationManager do
let(:lcm) { Chef::Util::DSC::LocalConfigurationManager.new(nil, "tmp") }
let(:normal_lcm_output) do
- <<-EOH
-logtype: [machinename]: LCM: [ Start Set ]
-logtype: [machinename]: LCM: [ Start Resource ] [name]
-logtype: [machinename]: LCM: [ End Resource ] [name]
-logtype: [machinename]: LCM: [ End Set ]
+ <<~EOH
+ logtype: [machinename]: LCM: [ Start Set ]
+ logtype: [machinename]: LCM: [ Start Resource ] [name]
+ logtype: [machinename]: LCM: [ End Resource ] [name]
+ logtype: [machinename]: LCM: [ End Set ]
EOH
end
let(:no_whatif_lcm_output) do
- <<-EOH
-Start-DscConfiguration : A parameter cannot be found\r\n that matches parameter name 'whatif'.
-At line:1 char:123
-+ run-somecommand -whatif
-+ ~~~~~~~~
- + CategoryInfo : InvalidArgument: (:) [Start-DscConfiguration], ParameterBindingException
- + FullyQualifiedErrorId : NamedParameterNotFound,SomeCompany.SomeAssembly.Commands.RunSomeCommand
+ <<~EOH
+ Start-DscConfiguration : A parameter cannot be found\r\n that matches parameter name 'whatif'.
+ At line:1 char:123
+ + run-somecommand -whatif
+ + ~~~~~~~~
+ + CategoryInfo : InvalidArgument: (:) [Start-DscConfiguration], ParameterBindingException
+ + FullyQualifiedErrorId : NamedParameterNotFound,SomeCompany.SomeAssembly.Commands.RunSomeCommand
EOH
end
let(:dsc_resource_import_failure_output) do
- <<-EOH
-PowerShell provider MSFT_xWebsite failed to execute Test-TargetResource functionality with error message: Please ensure that WebAdministration module is installed. + CategoryInfo : InvalidOperation: (:) [], CimException + FullyQualifiedErrorId : ProviderOperationExecutionFailure + PSComputerName : . PowerShell provider MSFT_xWebsite failed to execute Test-TargetResource functionality with error message: Please ensure that WebAdministration module is installed. + CategoryInfo : InvalidOperation: (:) [], CimException + FullyQualifiedErrorId : ProviderOperationExecutionFailure + PSComputerName : . The SendConfigurationApply function did not succeed. + CategoryInfo : NotSpecified: (root/Microsoft/...gurationManager:String) [], CimException + FullyQualifiedErrorId : MI RESULT 1 + PSComputerName : .
+ <<~EOH
+ PowerShell provider MSFT_xWebsite failed to execute Test-TargetResource functionality with error message: Please ensure that WebAdministration module is installed. + CategoryInfo : InvalidOperation: (:) [], CimException + FullyQualifiedErrorId : ProviderOperationExecutionFailure + PSComputerName : . PowerShell provider MSFT_xWebsite failed to execute Test-TargetResource functionality with error message: Please ensure that WebAdministration module is installed. + CategoryInfo : InvalidOperation: (:) [], CimException + FullyQualifiedErrorId : ProviderOperationExecutionFailure + PSComputerName : . The SendConfigurationApply function did not succeed. + CategoryInfo : NotSpecified: (root/Microsoft/...gurationManager:String) [], CimException + FullyQualifiedErrorId : MI RESULT 1 + PSComputerName : .
EOH
end
diff --git a/spec/unit/util/file_edit_spec.rb b/spec/unit/util/file_edit_spec.rb
index 1a71d1d856..5c5b04d8a5 100644
--- a/spec/unit/util/file_edit_spec.rb
+++ b/spec/unit/util/file_edit_spec.rb
@@ -22,29 +22,29 @@ require "tempfile"
describe Chef::Util::FileEdit do
let(:starting_content) do
- <<-EOF
-127.0.0.1 localhost
-255.255.255.255 broadcasthost
-::1 localhost
-fe80::1%lo0 localhost
+ <<~EOF
+ 127.0.0.1 localhost
+ 255.255.255.255 broadcasthost
+ ::1 localhost
+ fe80::1%lo0 localhost
EOF
end
let(:localhost_replaced) do
- <<-EOF
-127.0.0.1 replacement
-255.255.255.255 broadcasthost
-::1 replacement
-fe80::1%lo0 replacement
+ <<~EOF
+ 127.0.0.1 replacement
+ 255.255.255.255 broadcasthost
+ ::1 replacement
+ fe80::1%lo0 replacement
EOF
end
let(:localhost_line_replaced) do
- <<-EOF
-replacement line
-255.255.255.255 broadcasthost
-replacement line
-replacement line
+ <<~EOF
+ replacement line
+ 255.255.255.255 broadcasthost
+ replacement line
+ replacement line
EOF
end
@@ -54,41 +54,41 @@ replacement line
end
let(:localhost_line_deleted) do
- <<-EOF
-255.255.255.255 broadcasthost
+ <<~EOF
+ 255.255.255.255 broadcasthost
EOF
end
let(:append_after_all_localhost) do
- <<-EOF
-127.0.0.1 localhost
-new line inserted
-255.255.255.255 broadcasthost
-::1 localhost
-new line inserted
-fe80::1%lo0 localhost
-new line inserted
+ <<~EOF
+ 127.0.0.1 localhost
+ new line inserted
+ 255.255.255.255 broadcasthost
+ ::1 localhost
+ new line inserted
+ fe80::1%lo0 localhost
+ new line inserted
EOF
end
let(:append_after_content) do
- <<-EOF
-127.0.0.1 localhost
-255.255.255.255 broadcasthost
-::1 localhost
-fe80::1%lo0 localhost
-new line inserted
+ <<~EOF
+ 127.0.0.1 localhost
+ 255.255.255.255 broadcasthost
+ ::1 localhost
+ fe80::1%lo0 localhost
+ new line inserted
EOF
end
let(:append_twice) do
- <<-EOF
-127.0.0.1 localhost
-255.255.255.255 broadcasthost
-::1 localhost
-fe80::1%lo0 localhost
-once
-twice
+ <<~EOF
+ 127.0.0.1 localhost
+ 255.255.255.255 broadcasthost
+ ::1 localhost
+ fe80::1%lo0 localhost
+ once
+ twice
EOF
end