added extra test for error checking

This commit is contained in:
Enrique García Cota
2012-01-14 01:11:46 +01:00
parent 2b1dc60390
commit fce189134d

View File

@@ -39,7 +39,7 @@ context('semver', function()
end)
end)
describe('errors are thrown in', function()
describe('errors', function()
test('no parameters are passed', function()
assert_error(function() v() end)
end)
@@ -62,6 +62,9 @@ context('semver', function()
test('garbage at the end of the string', function()
assert_error(function() v("1.2.3foobar") end)
end)
test('a non-string or number is passed', function()
assert_error(function() v({}) end)
end)
end)
end)