summaryrefslogtreecommitdiff
path: root/spec/unit/util
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit/util')
-rw-r--r--spec/unit/util/diff_spec.rb12
-rw-r--r--spec/unit/util/dsc/local_configuration_manager_spec.rb10
-rw-r--r--spec/unit/util/path_helper_spec.rb12
3 files changed, 13 insertions, 21 deletions
diff --git a/spec/unit/util/diff_spec.rb b/spec/unit/util/diff_spec.rb
index ea226f1c04..b0a57a32c0 100644
--- a/spec/unit/util/diff_spec.rb
+++ b/spec/unit/util/diff_spec.rb
@@ -105,7 +105,7 @@ shared_examples_for "a diff util" do
end
end
- describe "when the default external encoding is UTF-8", :ruby_gte_19_only do
+ describe "when the default external encoding is UTF-8" do
before do
@saved_default_external = Encoding.default_external
@@ -170,7 +170,7 @@ shared_examples_for "a diff util" do
end
- describe "when the default external encoding is Latin-1", :ruby_gte_19_only do
+ describe "when the default external encoding is Latin-1" do
before do
@saved_default_external = Encoding.default_external
@@ -234,7 +234,7 @@ shared_examples_for "a diff util" do
end
end
- describe "when the default external encoding is Shift_JIS", :ruby_gte_19_only do
+ describe "when the default external encoding is Shift_JIS" do
before do
@saved_default_external = Encoding.default_external
@@ -411,7 +411,7 @@ shared_examples_for "a diff util" do
end
end
- describe "when the default external encoding is UTF-8", :ruby_gte_19_only do
+ describe "when the default external encoding is UTF-8" do
before do
@saved_default_external = Encoding.default_external
@@ -456,7 +456,7 @@ shared_examples_for "a diff util" do
end
- describe "when the default external encoding is Latin-1", :ruby_gte_19_only do
+ describe "when the default external encoding is Latin-1" do
before do
@saved_default_external = Encoding.default_external
@@ -500,7 +500,7 @@ shared_examples_for "a diff util" do
end
end
- describe "when the default external encoding is Shift-JIS", :ruby_gte_19_only do
+ describe "when the default external encoding is Shift-JIS" do
before do
@saved_default_external = Encoding.default_external
diff --git a/spec/unit/util/dsc/local_configuration_manager_spec.rb b/spec/unit/util/dsc/local_configuration_manager_spec.rb
index 1281862e67..1cff9e445b 100644
--- a/spec/unit/util/dsc/local_configuration_manager_spec.rb
+++ b/spec/unit/util/dsc/local_configuration_manager_spec.rb
@@ -65,7 +65,7 @@ EOH
let(:lcm_cmdlet_success) { true }
it 'should successfully return resource information for normally formatted output when cmdlet the cmdlet succeeds' do
- test_configuration_result = lcm.test_configuration('config')
+ test_configuration_result = lcm.test_configuration('config', {})
expect(test_configuration_result.class).to be(Array)
expect(test_configuration_result.length).to be > 0
expect(Chef::Log).not_to receive(:warn)
@@ -85,7 +85,7 @@ EOH
expect(Chef::Log).to receive(:warn).at_least(:once)
expect(lcm).to receive(:whatif_not_supported?).and_call_original
test_configuration_result = nil
- expect {test_configuration_result = lcm.test_configuration('config')}.not_to raise_error
+ expect {test_configuration_result = lcm.test_configuration('config', {})}.not_to raise_error
expect(test_configuration_result.class).to be(Array)
end
end
@@ -99,13 +99,13 @@ EOH
expect(Chef::Log).to receive(:warn).at_least(:once)
expect(lcm).to receive(:dsc_module_import_failure?).and_call_original
test_configuration_result = nil
- expect {test_configuration_result = lcm.test_configuration('config')}.not_to raise_error
+ expect {test_configuration_result = lcm.test_configuration('config', {})}.not_to raise_error
end
it 'should return a (possibly empty) array of ResourceInfo instances' do
expect(Chef::Log).to receive(:warn).at_least(:once)
test_configuration_result = nil
- expect {test_configuration_result = lcm.test_configuration('config')}.not_to raise_error
+ expect {test_configuration_result = lcm.test_configuration('config', {})}.not_to raise_error
expect(test_configuration_result.class).to be(Array)
end
end
@@ -118,7 +118,7 @@ EOH
it 'should log a warning' do
expect(Chef::Log).to receive(:warn).at_least(:once)
expect(lcm).to receive(:dsc_module_import_failure?).and_call_original
- expect {lcm.test_configuration('config')}.not_to raise_error
+ expect {lcm.test_configuration('config', {})}.not_to raise_error
end
end
end
diff --git a/spec/unit/util/path_helper_spec.rb b/spec/unit/util/path_helper_spec.rb
index 4df4b9b1ff..5756c29b90 100644
--- a/spec/unit/util/path_helper_spec.rb
+++ b/spec/unit/util/path_helper_spec.rb
@@ -189,16 +189,8 @@ describe Chef::Util::PathHelper do
end
context "not on windows", :unix_only do
- context "ruby is at least 1.9", :ruby_gte_19_only do
- it "returns a canonical path" do
- expect(PathHelper.canonical_path("/etc//apache.d/sites-enabled/../sites-available/default")).to eq("/etc/apache.d/sites-available/default")
- end
- end
-
- context "ruby is less than 1.9", :ruby_18_only do
- it "returns a canonical path" do
- expect { PathHelper.canonical_path("/etc//apache.d/sites-enabled/../sites-available/default") }.to raise_error(NotImplementedError)
- end
+ it "returns a canonical path" do
+ expect(PathHelper.canonical_path("/etc//apache.d/sites-enabled/../sites-available/default")).to eq("/etc/apache.d/sites-available/default")
end
end
end