Sha256: 78996758e80784e68b9f8c47728800ab64f53b2ac70d6866a13123734c058a52

Contents?: true

Size: 1.03 KB

Versions: 5

Compression:

Stored size: 1.03 KB

Contents

require 'minitest/autorun'
require 'smartsend'

class ParcelsTest < Minitest::Test

  def test_serializing
    parcel = Smartsend::Parcel.new(
      :shipped_at     => Time.new(2017, 11, 30, 16, 46, 04, 0),
      :reference      => '123456789',
      :weight         => 1.25,
      :height         => 21,
      :width          => 27,
      :length         => 35,
      :size           => "large",
      :items          => [],
      :freetext_lines => [
        "Brians birthsday gift",
        "Don't open this before your birthsday Brian",
        "We look forward to seeing you soon Brian"
      ]
    )

    assert_equal({
      "shipdate": Time.new(2017, 11, 30, 16, 46, 04, 0),
      "reference": "123456789",
      "weight": 1.25,
      "height": 21,
      "width": 27,
      "length": 35,
      "size": "large",
      "freetext1": "Brians birthsday gift",
      "freetext2": "Don't open this before your birthsday Brian",
      "freetext3": "We look forward to seeing you soon Brian",
      "items": []
    }, parcel.serialize)
  end

  private



end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
smartsend-ruby-0.1.1 test/test_parcels.rb
smartsend-ruby-0.1.0 test/test_parcels.rb
smartsend-ruby-0.0.3 test/test_parcels.rb
smartsend-ruby-0.0.2 test/test_parcels.rb
smartsend-ruby-0.0.1 test/test_parcels.rb