diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-12-01 00:42:36 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-12-01 00:42:36 +0000 |
commit | 5db8f999431b22b31c4feecbabb498047bc3e6d2 (patch) | |
tree | 995b3e8242aa2b0d03a153c664c79e331f6dd387 /test/rubygems | |
parent | 18a3774438469b6da3f44635e38c8b00f36c4cd7 (diff) | |
download | ruby-5db8f999431b22b31c4feecbabb498047bc3e6d2.tar.gz |
* lib/rubygems.rb: Search for gem deps file up the directory tree.
* test/rubygems/test_gem.rb: Test for above.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38097 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rubygems')
-rw-r--r-- | test/rubygems/test_gem.rb | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/test/rubygems/test_gem.rb b/test/rubygems/test_gem.rb index bbc18d42f0..20e411a7e4 100644 --- a/test/rubygems/test_gem.rb +++ b/test/rubygems/test_gem.rb @@ -1402,6 +1402,41 @@ class TestGem < Gem::TestCase assert_equal '["a-1", "b-1", "c-1"]', out.strip end + def test_looks_for_gemdeps_files_automatically_on_start_in_parent_dir + util_clear_gems + + a = new_spec "a", "1", nil, "lib/a.rb" + b = new_spec "b", "1", nil, "lib/b.rb" + c = new_spec "c", "1", nil, "lib/c.rb" + + install_specs a, b, c + + path = File.join @tempdir, "gem.deps.rb" + + File.open path, "w" do |f| + f.puts "gem 'a'" + f.puts "gem 'b'" + f.puts "gem 'c'" + end + + path = File.join(@tempdir, "gd-tmp") + install_gem a, :install_dir => path + install_gem b, :install_dir => path + install_gem c, :install_dir => path + + ENV['GEM_PATH'] = path + ENV['RUBYGEMS_GEMDEPS'] = "-" + + Dir.mkdir "sub1" + out = Dir.chdir "sub1" do + `#{Gem.ruby.untaint} -I #{LIB_PATH.untaint} -rubygems -e "p Gem.loaded_specs.values.map(&:full_name).sort"` + end + + Dir.rmdir "sub1" + + assert_equal '["a-1", "b-1", "c-1"]', out.strip + end + def with_plugin(path) test_plugin_path = File.expand_path("test/rubygems/plugin/#{path}", @@project_dir) |