Sha256: a917f8772ffb0c71e3579601b04d20fe04a92a20f0e8503a5943fe00cecdd04d

Contents?: true

Size: 1.02 KB

Versions: 42

Compression:

Stored size: 1.02 KB

Contents

require 'pry'
require 'active_shipping'
require 'test_helper'

include ActiveShipping
include ActiveShipping::Test::Credentials
include ActiveShipping::Test::Fixtures

def create_carrier(klass, creds)
  options = credentials(creds).merge(:test => true)
  klass.new(options)
rescue NoCredentialsFound
  STDERR.puts "No credentials found for #{creds}"
  nil
end

def px(xml_s)
  puts Nokogiri.XML(xml_s)
end

def reload!
  # Supress a billion constant redefinition warnings
  warn_level = $VERBOSE
  $VERBOSE = nil

  files = $LOADED_FEATURES.select { |feat| feat =~ /\/active_shipping\// }
  files.each { |file| load file }

  $VERBOSE = warn_level
  files
end

# Prebuilt objects for most common carriers
@canpo    = create_carrier(CanadaPost,:canada_post)
@fedex    = create_carrier(FedEx,:fedex)
@shipwire = create_carrier(Shipwire,:shipwire)
@ups      = create_carrier(UPS,:ups)
@usps     = create_carrier(USPS,:usps)
# Tips: call reload! to reload all the active_shipping files, use fixtures from test_helpers for parameters
binding.pry

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
active_shipping-2.1.1 test/console.rb
active_shipping-2.1.0 test/console.rb
active_shipping-2.0.1 test/console.rb
active_shipping-2.0.0 test/console.rb
active_shipping-1.14.2 test/console.rb
active_shipping-1.14.1 test/console.rb
active_shipping-1.14.0 test/console.rb
active_shipping-1.13.4 test/console.rb
active_shipping-1.13.3 test/console.rb
active_shipping-1.13.2 test/console.rb
active_shipping-1.13.1 test/console.rb
active_shipping-1.13.0 test/console.rb
active_shipping-1.12.1 test/console.rb
active_shipping-1.12.0 test/console.rb
active_shipping-1.11.1 test/console.rb
active_shipping-1.11.0 test/console.rb
active_shipping-1.10.1 test/console.rb
active_shipping-1.9.2 test/console.rb
active_shipping-1.9.1 test/console.rb
active_shipping-1.9.0 test/console.rb