summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authormo khan <mo.khan@gmail.com>2021-01-30 21:37:05 -0700
committermo khan <mo.khan@gmail.com>2021-01-30 21:37:05 -0700
commit9d46474008bcf7945a8c4a479852ccfd3d6fa811 (patch)
treecfeeb0065e0bc25897f117d78af80f8ced148742 /spec
parent2bdb4a1b341160c52a39cc0d339f6f6b4514ad08 (diff)
style: fix linter errorsv0.5.0
Diffstat (limited to 'spec')
-rw-r--r--spec/spec_helper.rb2
-rw-r--r--spec/xml/kit/crypto/symmetric_cipher_spec.rb10
-rw-r--r--spec/xml/kit/signatures_spec.rb1
-rw-r--r--spec/xml/kit/soap_spec.rb1
4 files changed, 8 insertions, 6 deletions
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index b0023c4..aeba20b 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -12,7 +12,7 @@ require 'tempfile'
Xml::Kit.logger.level = Logger::FATAL
-Dir[File.join(Dir.pwd, 'spec/support/**/*.rb')].each { |f| require f }
+Dir[File.join(Dir.pwd, 'spec/support/**/*.rb')].sort.each { |f| require f }
RSpec.configure do |config|
# Enable flags like --only-failures and --next-failure
config.example_status_persistence_file_path = '.rspec_status'
diff --git a/spec/xml/kit/crypto/symmetric_cipher_spec.rb b/spec/xml/kit/crypto/symmetric_cipher_spec.rb
index 0bf72be..534bec8 100644
--- a/spec/xml/kit/crypto/symmetric_cipher_spec.rb
+++ b/spec/xml/kit/crypto/symmetric_cipher_spec.rb
@@ -1,11 +1,11 @@
# frozen_string_literal: true
RSpec.describe ::Xml::Kit::Crypto::SymmetricCipher do
- [
- 'aes128-cbc',
- 'aes192-cbc',
- 'aes256-cbc',
- 'tripledes-cbc',
+ %w[
+ aes128-cbc
+ aes192-cbc
+ aes256-cbc
+ tripledes-cbc
].each do |algorithm|
describe algorithm do
let(:xml_algorithm) { "#{::Xml::Kit::Namespaces::XMLENC}#{algorithm}" }
diff --git a/spec/xml/kit/signatures_spec.rb b/spec/xml/kit/signatures_spec.rb
index ee170b0..efcfb06 100644
--- a/spec/xml/kit/signatures_spec.rb
+++ b/spec/xml/kit/signatures_spec.rb
@@ -27,6 +27,7 @@ RSpec.describe ::Xml::Kit::Signatures do
specify { expect(signature['SignedInfo']['Reference']['DigestValue']).to be_present }
specify { expect(signature['SignatureValue']).to be_present }
specify { expect(OpenSSL::X509::Certificate.new(Base64.decode64(signature['KeyInfo']['X509Data']['X509Certificate']))).to be_present }
+
specify do
expect(signature['SignedInfo']['Reference']['Transforms']['Transform']).to match_array([
{ 'Algorithm' => 'http://www.w3.org/2000/09/xmldsig#enveloped-signature' },
diff --git a/spec/xml/kit/soap_spec.rb b/spec/xml/kit/soap_spec.rb
index ebc2d01..a38e90f 100644
--- a/spec/xml/kit/soap_spec.rb
+++ b/spec/xml/kit/soap_spec.rb
@@ -9,6 +9,7 @@ RSpec.describe Soap do
specify { expect(result['Envelope']).to be_present }
specify { expect(result['Envelope']['Header']).to be_present }
+
specify do
cipher_value = result['Envelope']['Header']['Security']['EncryptedKey']['CipherData']['CipherValue']
symmetric_key = key_pair.private_key.private_decrypt(Base64.decode64(cipher_value))