Sha256: beed8c24795f5a15c5b5b425ea22deaebfcc12c16931c08486af2ee307a69fc4

Contents?: true

Size: 986 Bytes

Versions: 9

Compression:

Stored size: 986 Bytes

Contents

require 'spec_helper'
module SamlIdp
  describe "Algorithmable" do
    include Algorithmable

    describe "named raw algorithm" do
      def raw_algorithm
        :sha256
      end

      it "finds algorithm class" do
        expect(algorithm).to eq(OpenSSL::Digest::SHA256)
      end

      it "finds the name" do
        expect(algorithm_name).to eq("sha256")
      end
    end

    describe "class raw algorithm" do
      def raw_algorithm
        OpenSSL::Digest::SHA512
      end

      it "finds algorithm class" do
        expect(algorithm).to eq(OpenSSL::Digest::SHA512)
      end

      it "finds the name" do
        expect(algorithm_name).to eq("sha512")
      end
    end

    describe "nonexistent raw algorithm" do
      def raw_algorithm
        :sha1024
      end

      it "finds algorithm class" do
        expect(algorithm).to eq(OpenSSL::Digest::SHA1)
      end

      it "finds the name" do
        expect(algorithm_name).to eq("sha1")
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
saml_idp-0.16.0 spec/lib/saml_idp/algorithmable_spec.rb
saml_idp-0.15.0 spec/lib/saml_idp/algorithmable_spec.rb
saml_idp-0.14.0 spec/lib/saml_idp/algorithmable_spec.rb
saml_idp-0.12.0 spec/lib/saml_idp/algorithmable_spec.rb
saml_idp-0.11.0 spec/lib/saml_idp/algorithmable_spec.rb
saml_idp-0.10.0 spec/lib/saml_idp/algorithmable_spec.rb
saml_idp-0.9.0 spec/lib/saml_idp/algorithmable_spec.rb
saml_idp-0.8.1 spec/lib/saml_idp/algorithmable_spec.rb
saml_idp-0.8.0 spec/lib/saml_idp/algorithmable_spec.rb