test/test_csi.rb in csi-0.1.0 vs test/test_csi.rb in csi-0.2.0

- old
+ new

@@ -3,13 +3,41 @@ class TestCsi < Test::Unit::TestCase should "find a NAICS classification for 1123" do assert_equal CSI::lookup_naics(1123), 'Poultry and Egg Production' end - should "non find a NAICS classification for 0000" do + should "not find a NAICS classification for 0000" do assert_equal CSI::lookup_naics(0000), nil end - should "not find a NAICS classification for nil" do - assert_equal CSI::lookup_naics(nil), nil + should "raise an error finding a NAICS classification for nil" do + assert_raise TypeError do + CSI::lookup_naics(nil) + end + end + + should "raise an error finding a NAICS classification for strings" do + assert_raise TypeError do + CSI::lookup_naics("1123") + end + end + + should "find a SIC classification for 8041" do + assert_equal CSI::lookup_sic(8041), 'Offices and Clinics of Chiropractors' + end + + should "not find a SIC classification for 0000" do + assert_equal CSI::lookup_sic(0000), nil + end + + should "raise an error finding a SIC classification for nil" do + assert_raise TypeError do + CSI::lookup_sic(nil) + end + end + + should "raise an error finding a SIC classification for strings" do + assert_raise TypeError do + CSI::lookup_sic("8041") + end end end