Sha256: b90809e4b7c1222d6c0d29975a4556cba5d2d177927ff1f176f9c36ff3b9d830

Contents?: true

Size: 1005 Bytes

Versions: 62

Compression:

Stored size: 1005 Bytes

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)
@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

62 entries across 62 versions & 1 rubygems

Version Path
workarea-core-3.5.15 vendor/active_shipping/test/console.rb
workarea-core-3.4.36 vendor/active_shipping/test/console.rb
workarea-core-3.5.14 vendor/active_shipping/test/console.rb
workarea-core-3.4.35 vendor/active_shipping/test/console.rb
workarea-core-3.5.13 vendor/active_shipping/test/console.rb
workarea-core-3.4.34 vendor/active_shipping/test/console.rb
workarea-core-3.5.12 vendor/active_shipping/test/console.rb
workarea-core-3.4.33 vendor/active_shipping/test/console.rb
workarea-core-3.5.11 vendor/active_shipping/test/console.rb
workarea-core-3.5.10 vendor/active_shipping/test/console.rb
workarea-core-3.4.32 vendor/active_shipping/test/console.rb
workarea-core-3.5.9 vendor/active_shipping/test/console.rb
workarea-core-3.4.31 vendor/active_shipping/test/console.rb
workarea-core-3.5.8 vendor/active_shipping/test/console.rb
workarea-core-3.4.30 vendor/active_shipping/test/console.rb
workarea-core-3.5.7 vendor/active_shipping/test/console.rb
workarea-core-3.4.29 vendor/active_shipping/test/console.rb
workarea-core-3.5.6 vendor/active_shipping/test/console.rb
workarea-core-3.4.28 vendor/active_shipping/test/console.rb
workarea-core-3.5.5 vendor/active_shipping/test/console.rb