Sha256: ccfc3763a4303b9c478ec68f34c3c7cac6c6d6b4a1be57f144ea22473e1b5298

Contents?: true

Size: 773 Bytes

Versions: 5

Compression:

Stored size: 773 Bytes

Contents

require 'test_helper'

class OnTracTrackingNumberTest < Minitest::Test
  context "an OnTrac tracking number" do
    ["C11031500001879", "C10999911320231"].each do |valid_number|
      should "return ontrac for #{valid_number}" do
        should_be_valid_number(valid_number, TrackingNumber::OnTrac, :ontrac)
      end

      should "fail on check digit changes on #{valid_number}" do
        should_fail_on_check_digit_changes(valid_number)
      end

      should "detect #{valid_number} regardless of spacing" do
        should_detect_number_variants(valid_number, TrackingNumber::OnTrac)
      end
    end

    should "not detect an invalid number" do
      results = TrackingNumber::OnTrac.search("C10999911320230")
      assert_equal 0, results.size
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
tracking_number-0.10.5 test/ontrac_tracking_number_test.rb
tracking_number-0.10.4 test/ontrac_tracking_number_test.rb
tracking_number-0.10.3 test/ontrac_tracking_number_test.rb
tracking_number-0.10.1 test/ontrac_tracking_number_test.rb
tracking_number-0.10.0 test/ontrac_tracking_number_test.rb