Sha256: b6a35cd223dba853caaa662a81944d76cc35a45564f88d7a5774af0a9030a9e0

Contents?: true

Size: 744 Bytes

Versions: 4

Compression:

Stored size: 744 Bytes

Contents

require 'spec_helper'

describe MWS::Connection do

  context "initialize" do
    it "should intialize with all requires params" do
      conn = MWS::Connection.new auth_params
      conn.class.should == MWS::Connection
      auth_params.each do |k,v|
        conn.send(k).should == v
      end
      conn.host.should == "mws.amazonservices.com"
    end

    it "should raise an exception when a required param is missing" do
      auth_params.each do |k,v|
        lambda { MWS::Connection.new auth_params.delete(k) }.should raise_error
      end
    end

    it "should override host when sent a host param" do
      conn = MWS::Connection.new auth_params.merge({host: 'newhost.com'})
      conn.host.should == 'newhost.com'
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ruby-mws-0.1 spec/ruby-mws/connection_spec.rb
ruby-mws-0.0.4 spec/ruby-mws/connection_spec.rb
ruby-mws-0.0.3 spec/ruby-mws/connection_spec.rb
ruby-mws-0.0.2 spec/ruby-mws/connection_spec.rb