Sha256: da418e79dc7755efb790fd51970b5c06be699b2821b5f81b7dadbc9e62872a04

Contents?: true

Size: 587 Bytes

Versions: 2

Compression:

Stored size: 587 Bytes

Contents

require "test_helper"
require "azure/auth"

describe Azure::Auth do
  before do
    uri = double(path: "/path")

    @signer = MiniTest::Mock.new
    @signer.stub(:name, "SharedKey")
    @signer.stub(:sign, "Base64String==")

    @request = MiniTest::Mock.new
    @request.stub(:method, :get)
    @request.stub(:uri, uri)
    @request.stub(:headers, {})
  end

  it "generates a proper Authorization header" do
    auth = Azure::Auth.new("account-name")
    auth.sign(@request, @signer)

    @request.headers["Authorization"].must_equal "SharedKey account-name:Base64String=="
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
azure-0.1.1 test/unit/auth_test.rb
azure-0.1.0 test/unit/auth_test.rb