Permalink
Browse files

Fix error on creating a Version object with a frozen string.

Conflicts:

	lib/rubygems/version.rb
  • Loading branch information...
1 parent bea7856 commit da4362a6644ca5a75c210677ac500bccfe75f529 @headius headius committed with evanphx Sep 28, 2012
Showing with 4 additions and 1 deletion.
  1. +1 −1 lib/rubygems/version.rb
  2. +3 −0 test/rubygems/test_gem_version.rb
View
@@ -191,7 +191,7 @@ def initialize version
raise ArgumentError, "Malformed version number string #{version}" unless
self.class.correct?(version)
- @version = version.to_s.strip
+ @version = version.to_s.dup.strip
end
##
@@ -33,6 +33,9 @@ def fake.version; "1.0" end
assert_same fake, Gem::Version.create(fake)
assert_nil Gem::Version.create(nil)
assert_equal v("5.1"), Gem::Version.create("5.1")
+
+ ver = '1.1'.freeze
+ assert_equal v('1.1'), Gem::Version.create(ver)
end
def test_eql_eh

0 comments on commit da4362a

Please sign in to comment.