mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/rubygems*: Updated to RubyGems 2.0
* test/rubygems*: ditto. * common.mk (prelude): Updated for RubyGems 2.0 source rearrangement. * tool/change_maker.rb: Allow invalid UTF-8 characters in source files. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37976 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
3f606b7063
commit
9694bb8cac
214 changed files with 14049 additions and 7085 deletions
|
|
@ -9,6 +9,15 @@ class TestGemDependency < Gem::TestCase
|
|||
assert_equal req("> 1.0"), d.requirement
|
||||
end
|
||||
|
||||
def test_initialize_type_bad
|
||||
e = assert_raises ArgumentError do
|
||||
Gem::Dependency.new 'monkey' => '1.0'
|
||||
end
|
||||
|
||||
assert_equal 'dependency name must be a String, was {"monkey"=>"1.0"}',
|
||||
e.message
|
||||
end
|
||||
|
||||
def test_initialize_double
|
||||
d = dep "pkg", "> 1.0", "< 2.0"
|
||||
assert_equal req("> 1.0", "< 2.0"), d.requirement
|
||||
|
|
@ -173,5 +182,42 @@ class TestGemDependency < Gem::TestCase
|
|||
assert dep('a', '= 1').specific?
|
||||
end
|
||||
|
||||
def test_to_specs_suggests_other_versions
|
||||
a = util_spec 'a', '1.0', 'b' => '>= 1.0'
|
||||
|
||||
a_file = File.join a.gem_dir, 'lib', 'a_file.rb'
|
||||
|
||||
write_file a_file do |io|
|
||||
io.puts '# a_file.rb'
|
||||
end
|
||||
|
||||
dep = Gem::Dependency.new "a", "= 2.0"
|
||||
|
||||
e = assert_raises Gem::LoadError do
|
||||
dep.to_specs
|
||||
end
|
||||
|
||||
assert_equal "Could not find 'a' (= 2.0) - did find: [a-1.0]", e.message
|
||||
end
|
||||
|
||||
def test_to_specs_indicates_total_gem_set_size
|
||||
a = util_spec 'a', '1.0', 'b' => '>= 1.0'
|
||||
|
||||
a_file = File.join a.gem_dir, 'lib', 'a_file.rb'
|
||||
|
||||
write_file a_file do |io|
|
||||
io.puts '# a_file.rb'
|
||||
end
|
||||
|
||||
dep = Gem::Dependency.new "b", "= 2.0"
|
||||
|
||||
e = assert_raises Gem::LoadError do
|
||||
dep.to_specs
|
||||
end
|
||||
|
||||
assert_equal "Could not find 'b' (= 2.0) among 1 total gem(s)", e.message
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue