Backport #9193 » ruby_1_9_3.rubygems.1.8.23.2.patch
lib/rubygems/version.rb (working copy) | ||
---|---|---|
include Comparable
|
||
VERSION_PATTERN = '[0-9]+(\.[0-9a-zA-Z]+)*' # :nodoc:
|
||
ANCHORED_VERSION_PATTERN = /\A\s*(#{VERSION_PATTERN})*\s*\z/ # :nodoc:
|
||
VERSION_PATTERN = '[0-9]+(?>\.[0-9a-zA-Z]+)*' # :nodoc:
|
||
ANCHORED_VERSION_PATTERN = /\A\s*(#{VERSION_PATTERN})?\s*\z/ # :nodoc:
|
||
##
|
||
# A string representation of this Version.
|
lib/rubygems.rb (working copy) | ||
---|---|---|
# -The RubyGems Team
|
||
module Gem
|
||
VERSION = '1.8.23'
|
||
VERSION = '1.8.23.2'
|
||
##
|
||
# Raised when RubyGems is unable to load or activate a gem. Contains the
|
test/rubygems/test_gem_requirement.rb (working copy) | ||
---|---|---|
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
|
test/rubygems/test_gem_version.rb (working copy) | ||
---|---|---|
end
|
||
def test_initialize_bad
|
||
["junk", "1.0\n2.0"].each do |bad|
|
||
e = assert_raises ArgumentError do
|
||
%W[
|
||
junk
|
||
1.0\n2.0
|
||
1..2
|
||
1.2\ 3.4
|
||
1-2-3
|
||
].each do |bad|
|
||
e = assert_raises ArgumentError, bad do
|
||
Gem::Version.new bad
|
||
end
|
||
assert_equal "Malformed version number string #{bad}", e.message
|
||
assert_equal "Malformed version number string #{bad}", e.message, bad
|
||
end
|
||
end
|
||
- « Previous
- 1
- 2
- Next »