diff options
| author | mo khan <mo@mokhan.ca> | 2025-03-26 13:40:26 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2025-03-26 13:40:26 -0600 |
| commit | 1270301b45aed2e5ba0cb06a802c8fb68670908b (patch) | |
| tree | 6903a818f994b8f1195aa5e0a149b786bd00c583 | |
| parent | 34c00c330edd255587417e7738879b0afda0a84a (diff) | |
chore: fix failing specs
| -rw-r--r-- | spec/saml/kit/configuration_spec.rb | 12 | ||||
| -rw-r--r-- | spec/saml/kit/response_spec.rb | 4 |
2 files changed, 12 insertions, 4 deletions
diff --git a/spec/saml/kit/configuration_spec.rb b/spec/saml/kit/configuration_spec.rb index 93864e3..85f3c0b 100644 --- a/spec/saml/kit/configuration_spec.rb +++ b/spec/saml/kit/configuration_spec.rb @@ -57,7 +57,9 @@ RSpec.describe Saml::Kit::Configuration do before do subject.add_key_pair(active_certificate.to_pem, private_key.export, use: :signing) subject.add_key_pair(expired_certificate.to_pem, private_key.export, use: :signing) - subject.add_key_pair(unsigned_certificate.to_pem, private_key.export, use: :signing) + if Gem::Version.new('3.1.0') > Gem::Version.new(RUBY_VERSION) + subject.add_key_pair(unsigned_certificate.to_pem, private_key.export, use: :signing) + end end specify do @@ -71,7 +73,9 @@ RSpec.describe Saml::Kit::Configuration do before do subject.add_key_pair(active_certificate.to_pem, private_key.export, use: :encryption) subject.add_key_pair(expired_certificate.to_pem, private_key.export, use: :encryption) - subject.add_key_pair(unsigned_certificate.to_pem, private_key.export, use: :encryption) + if Gem::Version.new('3.1.0') > Gem::Version.new(RUBY_VERSION) + subject.add_key_pair(unsigned_certificate.to_pem, private_key.export, use: :encryption) + end end specify do @@ -112,7 +116,9 @@ RSpec.describe Saml::Kit::Configuration do before do subject.add_key_pair(active_certificate.to_pem, private_key.export, use: :signing) subject.add_key_pair(expired_certificate.to_pem, private_key.export, use: :signing) - subject.add_key_pair(unsigned_certificate.to_pem, private_key.export, use: :signing) + if Gem::Version.new('3.1.0') > Gem::Version.new(RUBY_VERSION) + subject.add_key_pair(unsigned_certificate.to_pem, private_key.export, use: :signing) + end end specify { expect(subject.key_pairs.count).to be(1) } diff --git a/spec/saml/kit/response_spec.rb b/spec/saml/kit/response_spec.rb index 8675ccb..9cccb95 100644 --- a/spec/saml/kit/response_spec.rb +++ b/spec/saml/kit/response_spec.rb @@ -486,7 +486,9 @@ RSpec.describe Saml::Kit::Response do public_key = OpenSSL::X509::Certificate.new(certificate_pem).public_key private_key = OpenSSL::PKey::RSA.new(private_key_pem, password) - allow(Saml::Kit.configuration).to receive(:private_keys).with(use: :encryption).and_return([private_key]) + allow(Saml::Kit.configuration).to receive(:private_keys) + .with(hash_including(use: :encryption)) + .and_return([private_key]) cipher = OpenSSL::Cipher.new('AES-128-CBC') cipher.encrypt |
