Skip to content

Commit

Permalink
Add minitest gem
Browse files Browse the repository at this point in the history
  • Loading branch information
leereilly committed Jun 24, 2015
1 parent 4355921 commit 11a52e2
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 16 deletions.
9 changes: 5 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ source "http://rubygems.org"
gem "toml", ">= 0.0.2"

group :development do
gem "shoulda", ">= 0"
gem "rdoc", "~> 3.12"
gem "bundler", "~> 1.10.4"
gem "jeweler", "~> 1.8.4"
gem "bundler"
gem "jeweler"
gem "minitest"
gem "rdoc"
gem "shoulda"
end
3 changes: 1 addition & 2 deletions lib/record.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ class Record
#
# Returns a CSI::Record object or nil if one couldn't be created.
def initialize(type, code)
puts "*"*80
raise CSI::CodeInvalid, 'String required' unless code.is_a? String

type.downcase!
Expand Down Expand Up @@ -41,4 +40,4 @@ def initialize(type, code)
end
end
end
end
end
6 changes: 3 additions & 3 deletions test/helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
$stderr.puts "Run `bundle install` to install missing gems"
exit e.status_code
end
require 'test/unit'
#require 'test/unit'
require 'minitest/autorun'
require 'shoulda'

class Test::Unit::TestCase
class Minitest::Test
end

unless defined? CSI
$:.unshift File.expand_path('../../lib', __FILE__)
require 'csi'
end

2 changes: 1 addition & 1 deletion test/test_csi.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'helper'

class TestCsi < Test::Unit::TestCase
class TestCsi < Minitest::Test
should "find valid NAICS records" do
naics_record = CSI::naics("928110")
assert_equal "National Security", naics_record.name
Expand Down
4 changes: 2 additions & 2 deletions test/test_errors.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'helper'

class ErrorsTest < Test::Unit::TestCase
class ErrorsTest < Minitest::Test

def test_error_inheritance
assert_kind_of StandardError,
Expand All @@ -22,4 +22,4 @@ def test_classification_invalid_inheritance
CSI::ClassificationInvalid.new
end

end
end
8 changes: 4 additions & 4 deletions test/test_record.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'helper'

class TestCsiRecord < Test::Unit::TestCase
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
Expand All @@ -12,19 +12,19 @@ class TestCsiRecord < Test::Unit::TestCase
end

should "demand an integer value for the code parameter" do
assert_raise CSI::CodeInvalid 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_raise CSI::ClassificationInvalid 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_raise CSI::ClassificationInvalid do
assert_raises CSI::TypeInvalid do
CSI::Record.new("LOL", "1337")
end
end
Expand Down

0 comments on commit 11a52e2

Please sign in to comment.