mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 16:44:01 +02:00
Backport test_realworld_default_gem test from Rubygems-2.6.13.
But this test is always fail on ruby core repository. Because default gems is only availabled after installation of Ruby. I ignored this test at https://github.com/rubygems/rubygems/pull/1986 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59839 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
b7127e6356
commit
bfa3d672d1
1 changed files with 17 additions and 0 deletions
|
@ -301,6 +301,23 @@ class TestGemRequire < Gem::TestCase
|
||||||
assert_equal %w(default-2.0.0.0), loaded_spec_names
|
assert_equal %w(default-2.0.0.0), loaded_spec_names
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_realworld_default_gem
|
||||||
|
skip "no default gems on ruby < 2.0" unless RUBY_VERSION >= "2"
|
||||||
|
begin
|
||||||
|
gem 'json'
|
||||||
|
rescue Gem::MissingSpecError
|
||||||
|
skip "default gems are only available after ruby installation"
|
||||||
|
end
|
||||||
|
|
||||||
|
cmd = <<-RUBY
|
||||||
|
$stderr = $stdout
|
||||||
|
require "json"
|
||||||
|
puts Gem.loaded_specs["json"].default_gem?
|
||||||
|
RUBY
|
||||||
|
output = Gem::Util.popen(Gem.ruby, "-e", cmd).strip
|
||||||
|
assert_equal "true", output
|
||||||
|
end
|
||||||
|
|
||||||
def test_default_gem_and_normal_gem
|
def test_default_gem_and_normal_gem
|
||||||
default_gem_spec = new_default_spec("default", "2.0.0.0",
|
default_gem_spec = new_default_spec("default", "2.0.0.0",
|
||||||
nil, "default/gem.rb")
|
nil, "default/gem.rb")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue