Sha256: f0f179532677a46ea4cd5c4c56deda1d4b65b734d21fec140a141a5bb5d1c952

Contents?: true

Size: 1004 Bytes

Versions: 1

Compression:

Stored size: 1004 Bytes

Contents

require 'helper'

class TestCsiRecord < Minitest::Test
  should "should return a valid record based on a valid type and code combo" do
    record = CSI::Record.new("NAICS", "336992")
    assert_equal "Military Armored Vehicle, Tank, and Tank Component Manufacturing", record.name
  end

  should "not care about case in the type parameter" do
    record = CSI::Record.new("naICs", "336992")
    assert_equal "Military Armored Vehicle, Tank, and Tank Component Manufacturing", record.name
  end

  should "demand an integer value for the code parameter" do
    assert_raises CSI::CodeInvalid  do
      CSI::Record.new("NAICS", 336992)
    end
  end

  should "raise CSI::ClassificationInvalid for valid type/invalid code combos" do
    assert_raises CSI::ClassificationInvalid do
      CSI::Record.new("NAICS", "999999999")
    end
  end

  should "raise CSI::TypeInvalid for valid type/invalid code combos" do
    assert_raises CSI::TypeInvalid do
      CSI::Record.new("LOL", "1337")
    end
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
csi-0.3.3 test/test_record.rb