diff options
author | Tim Smith <tsmith84@gmail.com> | 2020-02-28 22:40:53 -0800 |
---|---|---|
committer | Tim Smith <tsmith84@gmail.com> | 2020-02-28 22:40:53 -0800 |
commit | 410b6c1c97b6049a0afabcf88966a590f7b1c988 (patch) | |
tree | 04167ee93c4be6f61a147d03e7611df847619231 /spec | |
parent | 5f29b31fb9ed3eafcb249fb9e7056cf95497ae43 (diff) | |
download | chef-410b6c1c97b6049a0afabcf88966a590f7b1c988.tar.gz |
Remove constraints on specsnuke_old_specs
Run it all.
Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'spec')
-rw-r--r-- | spec/support/shared/unit/script_resource.rb | 4 | ||||
-rw-r--r-- | spec/unit/cookbook/metadata_spec.rb | 11 | ||||
-rw-r--r-- | spec/unit/encrypted_data_bag_item/check_encrypted_spec.rb | 2 | ||||
-rw-r--r-- | spec/unit/encrypted_data_bag_item_spec.rb | 4 | ||||
-rw-r--r-- | spec/unit/mixin/shell_out_spec.rb | 56 |
5 files changed, 33 insertions, 44 deletions
diff --git a/spec/support/shared/unit/script_resource.rb b/spec/support/shared/unit/script_resource.rb index 83d7d9dfe6..3c158afd6b 100644 --- a/spec/support/shared/unit/script_resource.rb +++ b/spec/support/shared/unit/script_resource.rb @@ -30,7 +30,7 @@ shared_examples_for "a script resource" do expect(script_resource.resource_name).to eql(resource_name) end - it "should set command to nil on the resource", chef: ">= 13" do + it "should set command to nil on the resource" do expect(script_resource.command).to be nil end @@ -44,7 +44,7 @@ shared_examples_for "a script resource" do expect(script_resource.flags.strip).to eql("-f") end - it "should raise an exception if users set command on the resource", chef: ">= 13" do + it "should raise an exception if users set command on the resource" do expect { script_resource.command("foo") }.to raise_error(Chef::Exceptions::Script) end diff --git a/spec/unit/cookbook/metadata_spec.rb b/spec/unit/cookbook/metadata_spec.rb index 6de2ab2a08..3c52198310 100644 --- a/spec/unit/cookbook/metadata_spec.rb +++ b/spec/unit/cookbook/metadata_spec.rb @@ -267,16 +267,7 @@ describe Chef::Cookbook::Metadata do end end - it "strips out self-dependencies", chef: "< 13" do - metadata.name("foo") - expect(Chef::Log).to receive(:warn).with( - "Ignoring self-dependency in cookbook foo, please remove it (in the future this will be fatal)." - ) - metadata.depends("foo") - expect(metadata.dependencies).to eql({}) - end - - it "errors on self-dependencies", chef: ">= 13" do + it "errors on self-dependencies" do metadata.name("foo") expect { metadata.depends("foo") }.to raise_error # FIXME: add the error type diff --git a/spec/unit/encrypted_data_bag_item/check_encrypted_spec.rb b/spec/unit/encrypted_data_bag_item/check_encrypted_spec.rb index f8fcb654d9..f7968dd3fb 100644 --- a/spec/unit/encrypted_data_bag_item/check_encrypted_spec.rb +++ b/spec/unit/encrypted_data_bag_item/check_encrypted_spec.rb @@ -85,7 +85,7 @@ describe Chef::EncryptedDataBagItem::CheckEncrypted do end end - context "when encryption version is 3", :aes_256_gcm_only, ruby: "~> 2.0.0" do + context "when encryption version is 3", :aes_256_gcm_only do include_examples "encryption detected" do let(:version) { 3 } let(:encryptor) { Chef::EncryptedDataBagItem::Encryptor::Version3Encryptor } diff --git a/spec/unit/encrypted_data_bag_item_spec.rb b/spec/unit/encrypted_data_bag_item_spec.rb index f406aa2ad0..64f62c6d21 100644 --- a/spec/unit/encrypted_data_bag_item_spec.rb +++ b/spec/unit/encrypted_data_bag_item_spec.rb @@ -97,7 +97,7 @@ describe Chef::EncryptedDataBagItem::Encryptor do Chef::Config[:data_bag_encrypt_version] = 3 end - context "on supported platforms", :aes_256_gcm_only, ruby: "~> 2.0.0" do + context "on supported platforms", :aes_256_gcm_only do it "creates a version 3 encryptor" do expect(encryptor).to be_a_instance_of(Chef::EncryptedDataBagItem::Encryptor::Version3Encryptor) @@ -166,7 +166,7 @@ describe Chef::EncryptedDataBagItem::Decryptor do context "when decrypting a version 3 (JSON+aes-256-gcm+random iv+auth tag) encrypted value" do - context "on supported platforms", :aes_256_gcm_only, ruby: "~> 2.0.0" do + context "on supported platforms", :aes_256_gcm_only do let(:encrypted_value) do Chef::EncryptedDataBagItem::Encryptor::Version3Encryptor.new(plaintext_data, encryption_key).for_encrypted_item diff --git a/spec/unit/mixin/shell_out_spec.rb b/spec/unit/mixin/shell_out_spec.rb index afa3687a15..f2b0295bf6 100644 --- a/spec/unit/mixin/shell_out_spec.rb +++ b/spec/unit/mixin/shell_out_spec.rb @@ -246,35 +246,33 @@ describe Chef::Mixin::ShellOut do let(:new_resource) { CustomResource.new("foo") } let(:provider) { new_resource.provider_for_action(:install) } - describe "on Chef-15", chef: ">= 15" do - %i{shell_out shell_out!}.each do |method| - stubbed_method = (method == :shell_out) ? :shell_out_compacted : :shell_out_compacted! - it "#{method} defaults to 900 seconds" do - expect(provider).to receive(stubbed_method).with("foo", timeout: 900) - provider.send(method, "foo") - end - it "#{method} overrides the default timeout with its options" do - expect(provider).to receive(stubbed_method).with("foo", timeout: 1) - provider.send(method, "foo", timeout: 1) - end - it "#{method} overrides the new_resource.timeout with the timeout option" do - new_resource.timeout(99) - expect(provider).to receive(stubbed_method).with("foo", timeout: 1) - provider.send(method, "foo", timeout: 1) - end - it "#{method} defaults to 900 seconds and preserves options" do - expect(provider).to receive(stubbed_method).with("foo", env: nil, timeout: 900) - provider.send(method, "foo", env: nil) - end - it "#{method} overrides the default timeout with its options and preserves options" do - expect(provider).to receive(stubbed_method).with("foo", timeout: 1, env: nil) - provider.send(method, "foo", timeout: 1, env: nil) - end - it "#{method} overrides the new_resource.timeout with the timeout option and preseves options" do - new_resource.timeout(99) - expect(provider).to receive(stubbed_method).with("foo", timeout: 1, env: nil) - provider.send(method, "foo", timeout: 1, env: nil) - end + %i{shell_out shell_out!}.each do |method| + stubbed_method = (method == :shell_out) ? :shell_out_compacted : :shell_out_compacted! + it "#{method} defaults to 900 seconds" do + expect(provider).to receive(stubbed_method).with("foo", timeout: 900) + provider.send(method, "foo") + end + it "#{method} overrides the default timeout with its options" do + expect(provider).to receive(stubbed_method).with("foo", timeout: 1) + provider.send(method, "foo", timeout: 1) + end + it "#{method} overrides the new_resource.timeout with the timeout option" do + new_resource.timeout(99) + expect(provider).to receive(stubbed_method).with("foo", timeout: 1) + provider.send(method, "foo", timeout: 1) + end + it "#{method} defaults to 900 seconds and preserves options" do + expect(provider).to receive(stubbed_method).with("foo", env: nil, timeout: 900) + provider.send(method, "foo", env: nil) + end + it "#{method} overrides the default timeout with its options and preserves options" do + expect(provider).to receive(stubbed_method).with("foo", timeout: 1, env: nil) + provider.send(method, "foo", timeout: 1, env: nil) + end + it "#{method} overrides the new_resource.timeout with the timeout option and preseves options" do + new_resource.timeout(99) + expect(provider).to receive(stubbed_method).with("foo", timeout: 1, env: nil) + provider.send(method, "foo", timeout: 1, env: nil) end end end |