Sha256: 241917b0b63258425b90808706382a649f4a37c14e975202d07a6510cbbee507

Contents?: true

Size: 716 Bytes

Versions: 17

Compression:

Stored size: 716 Bytes

Contents

require 'spec_helper'

describe Rack::OAuth2::AccessToken::MAC::Verifier do
  let(:verifier) { Rack::OAuth2::AccessToken::MAC::Verifier.new(:algorithm => algorithm) }
  subject { verifier }

  context 'when "hmac-sha-1" is specified' do
    let(:algorithm) { 'hmac-sha-1' }
    its(:hash_generator) { should be_instance_of OpenSSL::Digest::SHA1 }
  end

  context 'when "hmac-sha-256" is specified' do
    let(:algorithm) { 'hmac-sha-256' }
    its(:hash_generator) { should be_instance_of OpenSSL::Digest::SHA256 }
  end

  context 'otherwise' do
    let(:algorithm) { 'invalid' }
    it do
      expect { verifier.send(:hash_generator) }.to raise_error(StandardError, 'Unsupported Algorithm')
    end
  end

  
end

Version data entries

17 entries across 17 versions & 2 rubygems

Version Path
rack-oauth2-1.1.1 spec/rack/oauth2/access_token/mac/verifier_spec.rb
rack-oauth2-1.1.0 spec/rack/oauth2/access_token/mac/verifier_spec.rb
rack-oauth2-1.0.10 spec/rack/oauth2/access_token/mac/verifier_spec.rb
rack-oauth2-1.0.9 spec/rack/oauth2/access_token/mac/verifier_spec.rb
rack-oauth2-1.0.8 spec/rack/oauth2/access_token/mac/verifier_spec.rb
rack-oauth2-revibe-1.0.7 spec/rack/oauth2/access_token/mac/verifier_spec.rb
rack-oauth2-1.0.7 spec/rack/oauth2/access_token/mac/verifier_spec.rb
rack-oauth2-1.0.6 spec/rack/oauth2/access_token/mac/verifier_spec.rb
rack-oauth2-1.0.5 spec/rack/oauth2/access_token/mac/verifier_spec.rb
rack-oauth2-1.0.4 spec/rack/oauth2/access_token/mac/verifier_spec.rb
rack-oauth2-1.0.3 spec/rack/oauth2/access_token/mac/verifier_spec.rb
rack-oauth2-1.0.2 spec/rack/oauth2/access_token/mac/verifier_spec.rb
rack-oauth2-1.0.1 spec/rack/oauth2/access_token/mac/verifier_spec.rb
rack-oauth2-1.0.0 spec/rack/oauth2/access_token/mac/verifier_spec.rb
rack-oauth2-0.14.9 spec/rack/oauth2/access_token/mac/verifier_spec.rb
rack-oauth2-0.14.8 spec/rack/oauth2/access_token/mac/verifier_spec.rb
rack-oauth2-0.14.7 spec/rack/oauth2/access_token/mac/verifier_spec.rb