Raise an error is Language#name is missing

This commit is contained in:
Joshua Peek
2011-05-09 23:03:30 -05:00
parent 6041dda7ca
commit fdc8f18c52
2 changed files with 7 additions and 1 deletions

View File

@@ -32,6 +32,12 @@ class TestLanguage < Test::Unit::TestCase
assert_equal "Ruby", Language['Ruby'].name
end
def test_error_without_name
assert_raise ArgumentError do
Language.new :name => nil
end
end
def test_extensions
assert Language['Perl'].extensions.include?('.pl')
assert Language['Python'].extensions.include?('.py')