test/test_helper.rb in active_shipping-1.0.0.pre4 vs test/test_helper.rb in active_shipping-1.0.0
- old
+ new
@@ -1,10 +1,11 @@
require 'bundler/setup'
require 'minitest/autorun'
require 'mocha/mini_test'
require 'timecop'
+require 'business_time'
require 'active_shipping'
require 'logger'
require 'erb'
@@ -30,11 +31,11 @@
LOCAL_CREDENTIALS = ENV['HOME'] + '/.active_shipping/credentials.yml'
DEFAULT_CREDENTIALS = File.dirname(__FILE__) + '/credentials.yml'
def credentials(key)
data = all_credentials[key]
- if data.nil? || data.all? { |k,v| v.nil? || v.empty? }
+ if data.nil? || data.all? { |k,v| v.nil? || v.to_s.empty? }
raise NoCredentialsFound.new(key)
end
data.symbolize_keys
end
@@ -85,11 +86,12 @@
:big_half_pound => Package.new((16 * 50), [24, 24, 36], :units => :imperial),
:chocolate_stuff => Package.new(80, [2, 6, 12], :units => :imperial),
:declared_value => Package.new(80, [2, 6, 12], :units => :imperial, :currency => 'USD', :value => 999.99),
:tshirts => Package.new(10 * 16, nil, :units => :imperial),
:shipping_container => Package.new(2200000, [2440, 2600, 6058], :description => '20 ft Standard Container', :units => :metric),
- :largest_gold_bar => Package.new(250000, [45.5, 22.5, 17], :value => 15300000)
+ :largest_gold_bar => Package.new(250000, [45.5, 22.5, 17], :value => 15300000),
+ :books => Package.new(64, [4, 8, 6], :units => :imperial, :value => 15300000, :description => 'Books')
}
end
def location_fixtures
@location_fixtures ||= {
@@ -100,9 +102,17 @@
:city => 'Ottawa',
:address1 => '110 Laurier Avenue West',
:postal_code => 'K1P 1J1',
:phone => '1-613-580-2400',
:fax => '1-613-580-2495'),
+ :ottawa_with_name => Location.new( :country => 'CA',
+ :province => 'ON',
+ :city => 'Ottawa',
+ :name => 'Paul Ottawa',
+ :address1 => '110 Laurier Avenue West',
+ :postal_code => 'K1P 1J1',
+ :phone => '1-613-580-2400',
+ :fax => '1-613-580-2495'),
:beverly_hills => Location.new(
:country => 'US',
:state => 'CA',
:city => 'Beverly Hills',
:address1 => '455 N. Rexford Dr.',