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.27 lib/workarea/bogus_carrier.rb
workarea-core-3.5.26 lib/workarea/bogus_carrier.rb
workarea-core-3.4.45 lib/workarea/bogus_carrier.rb
workarea-core-3.5.25 lib/workarea/bogus_carrier.rb
workarea-core-3.5.23 lib/workarea/bogus_carrier.rb
workarea-core-3.4.44 lib/workarea/bogus_carrier.rb
workarea-core-3.5.22 lib/workarea/bogus_carrier.rb
workarea-core-3.4.43 lib/workarea/bogus_carrier.rb
workarea-core-3.5.21 lib/workarea/bogus_carrier.rb
workarea-core-3.4.42 lib/workarea/bogus_carrier.rb
workarea-core-3.5.20 lib/workarea/bogus_carrier.rb
workarea-core-3.4.41 lib/workarea/bogus_carrier.rb
workarea-core-3.5.19 lib/workarea/bogus_carrier.rb
workarea-core-3.4.40 lib/workarea/bogus_carrier.rb
workarea-core-3.5.18 lib/workarea/bogus_carrier.rb
workarea-core-3.4.39 lib/workarea/bogus_carrier.rb
workarea-core-3.5.17 lib/workarea/bogus_carrier.rb
workarea-core-3.4.38 lib/workarea/bogus_carrier.rb
workarea-core-3.5.16 lib/workarea/bogus_carrier.rb
workarea-core-3.4.37 lib/workarea/bogus_carrier.rb