Sha256: d40ce0aa4bee64f83ded6038b094d59db70cf94aaf3cb83d62a1e57302f1c9e6

Contents?: true

Size: 528 Bytes

Versions: 62

Compression:

Stored size: 528 Bytes

Contents

module Workarea
  class BogusCarrier < ActiveShipping::Workarea
    MESSAGE = 'SUCCESS - 0000 Success'

    def create_shipment(origin, destination, packages, options = {})
      labels = [ActiveShipping::Label.new(generate_tracking_number, image)]
      ActiveShipping::LabelResponse.new(true, MESSAGE, {}, labels: labels)
    end

    def generate_tracking_number
      "1ZX1A#{Array.new(13) { rand(0..9) }.join}"
    end

    def image
      IO.read(Core::Engine.root.join('test', 'fixtures', 'label.png'))
    end
  end
end

Version data entries

62 entries across 62 versions & 1 rubygems

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