Skip to content

Commit

Permalink
Fix error on creating a Version object with a frozen string.
Browse files Browse the repository at this point in the history
Conflicts:

	lib/rubygems/version.rb
  • Loading branch information
headius authored and evanphx committed Oct 6, 2012
1 parent bea7856 commit da4362a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rubygems/version.rb
Expand Up @@ -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

##
Expand Down
3 changes: 3 additions & 0 deletions test/rubygems/test_gem_version.rb
Expand Up @@ -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
Expand Down

0 comments on commit da4362a

Please sign in to comment.