Sha256: e2497b6446d474c08e663cb96b88f81d801869d6fedab6598b2219442a3efac8

Contents?: true

Size: 1.01 KB

Versions: 1

Compression:

Stored size: 1.01 KB

Contents

require File.join(File.dirname(__FILE__), 'test_helper')

class SignatureTest < Test::Unit::TestCase
  def setup
    @expected_base64 = "F8zvW31wDYENPZrwkVYaPOLHh2R+goZncb0SlwTwyes="
    @expected_digest = "\027\314\357[}p\r\201\r=\232\360\221V\032<\342\307\207d~\202\206gq\275\022\227\004\360\311\353"
  end
  
  def test_sign_with_string_keys
    signature = Amazon::MWS::Authentication::Signature.new(
      {"devil" => "666"}, 
      {:verb => :get, :secret_access_key => "beelzebub"}
    )
    
    # Not sure if this really helps, just locks it down
    assert_equal(@expected_base64, signature)
    assert_equal(@expected_digest, Base64.decode64(signature))
  end
  
  def test_sign_with_symbol_keys
    signature = Amazon::MWS::Authentication::Signature.new(
      {:devil => "666"}, 
      {:verb => :get, :secret_access_key => "beelzebub"}
    )
    
    # Not sure if this really helps, just locks it down
    assert_equal(@expected_base64, signature)
    assert_equal(@expected_digest, Base64.decode64(signature))
  end  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
amazon-mws-0.1.0 test/signature_test.rb