summaryrefslogtreecommitdiff
path: root/test/rubygems/test_gem_requirement.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/rubygems/test_gem_requirement.rb')
-rw-r--r--test/rubygems/test_gem_requirement.rb20
1 files changed, 11 insertions, 9 deletions
diff --git a/test/rubygems/test_gem_requirement.rb b/test/rubygems/test_gem_requirement.rb
index 0bc6ad7059..d79cc8e3f7 100644
--- a/test/rubygems/test_gem_requirement.rb
+++ b/test/rubygems/test_gem_requirement.rb
@@ -37,17 +37,19 @@ class TestGemRequirement < Gem::TestCase
end
def test_parse_bad
- e = assert_raises ArgumentError do
- Gem::Requirement.parse nil
- end
-
- assert_equal 'Illformed requirement [nil]', e.message
+ [
+ nil,
+ '',
+ '! 1',
+ '= junk',
+ '1..2',
+ ].each do |bad|
+ e = assert_raises ArgumentError do
+ Gem::Requirement.parse bad
+ end
- e = assert_raises ArgumentError do
- Gem::Requirement.parse ""
+ assert_equal "Illformed requirement [#{bad.inspect}]", e.message
end
-
- assert_equal 'Illformed requirement [""]', e.message
end
def test_prerelease_eh