summaryrefslogtreecommitdiff
path: root/test/rubygems/test_gem_request_set.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/rubygems/test_gem_request_set.rb')
-rw-r--r--test/rubygems/test_gem_request_set.rb198
1 files changed, 99 insertions, 99 deletions
diff --git a/test/rubygems/test_gem_request_set.rb b/test/rubygems/test_gem_request_set.rb
index e2fe98b9bf..6d14321126 100644
--- a/test/rubygems/test_gem_request_set.rb
+++ b/test/rubygems/test_gem_request_set.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
-require_relative 'helper'
-require 'rubygems/request_set'
+require_relative "helper"
+require "rubygems/request_set"
class TestGemRequestSet < Gem::TestCase
def setup
@@ -23,24 +23,24 @@ class TestGemRequestSet < Gem::TestCase
def test_gem_duplicate
rs = Gem::RequestSet.new
- rs.gem 'a', '1'
- rs.gem 'a', '2'
+ rs.gem "a", "1"
+ rs.gem "a", "2"
- assert_equal [dep('a', '= 1', '= 2')], rs.dependencies
+ assert_equal [dep("a", "= 1", "= 2")], rs.dependencies
end
def test_import
rs = Gem::RequestSet.new
- rs.gem 'a'
+ rs.gem "a"
- rs.import [dep('b')]
+ rs.import [dep("b")]
- assert_equal [dep('a'), dep('b')], rs.dependencies
+ assert_equal [dep("a"), dep("b")], rs.dependencies
end
def test_install_from_gemdeps
spec_fetcher do |fetcher|
- fetcher.gem 'a', 2
+ fetcher.gem "a", 2
end
done_installing_ran = false
@@ -52,7 +52,7 @@ class TestGemRequestSet < Gem::TestCase
rs = Gem::RequestSet.new
installed = []
- File.open 'gem.deps.rb', 'w' do |io|
+ File.open "gem.deps.rb", "w" do |io|
io.puts 'gem "a"'
io.flush
@@ -63,9 +63,9 @@ class TestGemRequestSet < Gem::TestCase
assert_kind_of Array, result # what is supposed to be in here?
end
- assert_includes installed, 'a-2'
- assert_path_exist File.join @gemhome, 'gems', 'a-2'
- assert_path_exist 'gem.deps.rb.lock'
+ assert_includes installed, "a-2"
+ assert_path_exist File.join @gemhome, "gems", "a-2"
+ assert_path_exist "gem.deps.rb.lock"
assert rs.remote
refute done_installing_ran
@@ -73,12 +73,12 @@ class TestGemRequestSet < Gem::TestCase
def test_install_from_gemdeps_explain
spec_fetcher do |fetcher|
- fetcher.gem 'a', 2
+ fetcher.gem "a", 2
end
rs = Gem::RequestSet.new
- File.open 'gem.deps.rb', 'w' do |io|
+ File.open "gem.deps.rb", "w" do |io|
io.puts 'gem "a"'
io.flush
@@ -96,21 +96,21 @@ Gems to install:
def test_install_from_gemdeps_install_dir
spec_fetcher do |fetcher|
- fetcher.gem 'a', 2
+ fetcher.gem "a", 2
end
util_clear_gems
- assert_path_not_exist File.join Gem.dir, 'gems', 'a-2'
+ assert_path_not_exist File.join Gem.dir, "gems", "a-2"
rs = Gem::RequestSet.new
installed = []
- File.open 'gem.deps.rb', 'w' do |io|
+ File.open "gem.deps.rb", "w" do |io|
io.puts 'gem "a"'
end
options = {
- :gemdeps => 'gem.deps.rb',
+ :gemdeps => "gem.deps.rb",
:install_dir => "#{@gemhome}2",
}
@@ -118,18 +118,18 @@ Gems to install:
installed << req.full_name
end
- assert_includes installed, 'a-2'
- assert_path_not_exist File.join Gem.dir, 'gems', 'a-2'
+ assert_includes installed, "a-2"
+ assert_path_not_exist File.join Gem.dir, "gems", "a-2"
end
def test_install_from_gemdeps_local
spec_fetcher do |fetcher|
- fetcher.gem 'a', 2
+ fetcher.gem "a", 2
end
rs = Gem::RequestSet.new
- File.open 'gem.deps.rb', 'w' do |io|
+ File.open "gem.deps.rb", "w" do |io|
io.puts 'gem "a"'
io.flush
@@ -143,15 +143,15 @@ Gems to install:
def test_install_from_gemdeps_lockfile
spec_fetcher do |fetcher|
- fetcher.download 'a', 1
- fetcher.download 'a', 2
- fetcher.download 'b', 1, 'a' => '>= 0'
+ fetcher.download "a", 1
+ fetcher.download "a", 2
+ fetcher.download "b", 1, "a" => ">= 0"
end
rs = Gem::RequestSet.new
installed = []
- File.open 'gem.deps.rb.lock', 'w' do |io|
+ File.open "gem.deps.rb.lock", "w" do |io|
io.puts <<-LOCKFILE
GEM
remote: #{@gem_repo}
@@ -168,19 +168,19 @@ DEPENDENCIES
LOCKFILE
end
- File.open 'gem.deps.rb', 'w' do |io|
+ File.open "gem.deps.rb", "w" do |io|
io.puts 'gem "b"'
end
- rs.install_from_gemdeps :gemdeps => 'gem.deps.rb' do |req, installer|
+ rs.install_from_gemdeps :gemdeps => "gem.deps.rb" do |req, installer|
installed << req.full_name
end
- assert_includes installed, 'b-1'
- assert_includes installed, 'a-1'
+ assert_includes installed, "b-1"
+ assert_includes installed, "a-1"
- assert_path_exist File.join @gemhome, 'specifications', 'a-1.gemspec'
- assert_path_exist File.join @gemhome, 'specifications', 'b-1.gemspec'
+ assert_path_exist File.join @gemhome, "specifications", "a-1.gemspec"
+ assert_path_exist File.join @gemhome, "specifications", "b-1.gemspec"
end
def test_install_from_gemdeps_complex_dependencies
@@ -197,7 +197,7 @@ DEPENDENCIES
rs = Gem::RequestSet.new
installed = []
- File.open 'Gemfile.lock', 'w' do |io|
+ File.open "Gemfile.lock", "w" do |io|
io.puts <<-LOCKFILE
GEM
remote: #{@gem_repo}
@@ -212,7 +212,7 @@ DEPENDENCIES
LOCKFILE
end
- File.open 'testo.gemspec', 'w' do |io|
+ File.open "testo.gemspec", "w" do |io|
io.puts <<-LOCKFILE
Gem::Specification.new do |spec|
spec.name = 'testo'
@@ -222,28 +222,28 @@ end
LOCKFILE
end
- File.open 'Gemfile', 'w' do |io|
+ File.open "Gemfile", "w" do |io|
io.puts("gemspec")
end
- rs.install_from_gemdeps :gemdeps => 'Gemfile' do |req, installer|
+ rs.install_from_gemdeps :gemdeps => "Gemfile" do |req, installer|
installed << req.full_name
end
- assert_includes installed, 'z-1.0.3'
+ assert_includes installed, "z-1.0.3"
- assert_path_exist File.join @gemhome, 'specifications', 'z-1.0.3.gemspec'
+ assert_path_exist File.join @gemhome, "specifications", "z-1.0.3.gemspec"
end
def test_install_from_gemdeps_version_mismatch
spec_fetcher do |fetcher|
- fetcher.gem 'a', 2
+ fetcher.gem "a", 2
end
rs = Gem::RequestSet.new
installed = []
- File.open 'gem.deps.rb', 'w' do |io|
+ File.open "gem.deps.rb", "w" do |io|
io.puts <<-GEM_DEPS
gem "a"
ruby "0"
@@ -256,13 +256,13 @@ ruby "0"
end
end
- assert_includes installed, 'a-2'
+ assert_includes installed, "a-2"
end
def test_load_gemdeps
rs = Gem::RequestSet.new
- tf = Tempfile.open 'gem.deps.rb' do |io|
+ tf = Tempfile.open "gem.deps.rb" do |io|
io.puts 'gem "a"'
io.flush
@@ -273,7 +273,7 @@ ruby "0"
end
tf.close!
- assert_equal [dep('a')], rs.dependencies
+ assert_equal [dep("a")], rs.dependencies
assert rs.git_set
assert rs.vendor_set
@@ -282,7 +282,7 @@ ruby "0"
def test_load_gemdeps_installing
rs = Gem::RequestSet.new
- tf = Tempfile.open 'gem.deps.rb' do |io|
+ tf = Tempfile.open "gem.deps.rb" do |io|
io.puts 'ruby "0"'
io.puts 'gem "a"'
io.flush
@@ -294,13 +294,13 @@ ruby "0"
end
tf.close!
- assert_equal [dep('a')], rs.dependencies
+ assert_equal [dep("a")], rs.dependencies
end
def test_load_gemdeps_without_groups
rs = Gem::RequestSet.new
- tf = Tempfile.open 'gem.deps.rb' do |io|
+ tf = Tempfile.open "gem.deps.rb" do |io|
io.puts 'gem "a", :group => :test'
io.flush
@@ -332,12 +332,12 @@ ruby "0"
end
def test_bug_bug_990
- a = util_spec 'a', '1.b', 'b' => '~> 1.a'
- b = util_spec 'b', '1.b', 'c' => '>= 1'
- c = util_spec 'c', '1.1.b'
+ a = util_spec "a", "1.b", "b" => "~> 1.a"
+ b = util_spec "b", "1.b", "c" => ">= 1"
+ c = util_spec "c", "1.1.b"
rs = Gem::RequestSet.new
- rs.gem 'a'
+ rs.gem "a"
rs.prerelease = true
res = rs.resolve StaticSet.new([a, b, c])
@@ -349,11 +349,11 @@ ruby "0"
end
def test_resolve_development
- a = util_spec 'a', 1
+ a = util_spec "a", 1
spec = Gem::Resolver::SpecSpecification.new nil, a
rs = Gem::RequestSet.new
- rs.gem 'a'
+ rs.gem "a"
rs.development = true
res = rs.resolve StaticSet.new [spec]
@@ -364,22 +364,22 @@ ruby "0"
end
def test_resolve_development_shallow
- a = util_spec 'a', 1 do |s|
- s.add_development_dependency 'b'
+ a = util_spec "a", 1 do |s|
+ s.add_development_dependency "b"
end
- b = util_spec 'b', 1 do |s|
- s.add_development_dependency 'c'
+ b = util_spec "b", 1 do |s|
+ s.add_development_dependency "c"
end
- c = util_spec 'c', 1
+ c = util_spec "c", 1
a_spec = Gem::Resolver::SpecSpecification.new nil, a
b_spec = Gem::Resolver::SpecSpecification.new nil, b
c_spec = Gem::Resolver::SpecSpecification.new nil, c
rs = Gem::RequestSet.new
- rs.gem 'a'
+ rs.gem "a"
rs.development = true
rs.development_shallow = true
@@ -395,7 +395,7 @@ ruby "0"
rs = Gem::RequestSet.new
- tf = Tempfile.open 'gem.deps.rb' do |io|
+ tf = Tempfile.open "gem.deps.rb" do |io|
io.puts <<-GEMS_DEPS_RB
gem "#{name}", :git => "#{repository}"
GEMS_DEPS_RB
@@ -435,12 +435,12 @@ ruby "0"
end
def test_resolve_incompatible
- a1 = util_spec 'a', 1
- a2 = util_spec 'a', 2
+ a1 = util_spec "a", 1
+ a2 = util_spec "a", 2
rs = Gem::RequestSet.new
- rs.gem 'a', '= 1'
- rs.gem 'a', '= 2'
+ rs.gem "a", "= 1"
+ rs.gem "a", "= 2"
set = StaticSet.new [a1, a2]
@@ -450,15 +450,15 @@ ruby "0"
end
def test_resolve_vendor
- a_name, _, a_directory = vendor_gem 'a', 1 do |s|
- s.add_dependency 'b', '~> 2.0'
+ a_name, _, a_directory = vendor_gem "a", 1 do |s|
+ s.add_dependency "b", "~> 2.0"
end
- b_name, _, b_directory = vendor_gem 'b', 2
+ b_name, _, b_directory = vendor_gem "b", 2
rs = Gem::RequestSet.new
- tf = Tempfile.open 'gem.deps.rb' do |io|
+ tf = Tempfile.open "gem.deps.rb" do |io|
io.puts <<-GEMS_DEPS_RB
gem "#{a_name}", :path => "#{a_directory}"
gem "#{b_name}", :path => "#{b_directory}"
@@ -509,7 +509,7 @@ ruby "0"
end
rs = Gem::RequestSet.new
- rs.gem 'a'
+ rs.gem "a"
rs.resolve
@@ -525,8 +525,8 @@ ruby "0"
assert_equal %w[b-1 a-1],
installers.map {|installer| installer.spec.full_name }
- assert_path_exist File.join @gemhome, 'specifications', 'a-1.gemspec'
- assert_path_exist File.join @gemhome, 'specifications', 'b-1.gemspec'
+ assert_path_exist File.join @gemhome, "specifications", "a-1.gemspec"
+ assert_path_exist File.join @gemhome, "specifications", "b-1.gemspec"
assert_equal %w[b-1 a-1], installed.map {|s| s.full_name }
@@ -545,32 +545,32 @@ ruby "0"
rs.resolve
installed = rs.install_into @tempdir do
- assert_equal @tempdir, ENV['GEM_HOME']
+ assert_equal @tempdir, ENV["GEM_HOME"]
end
- assert_path_exist File.join @tempdir, 'specifications', 'a-1.gemspec'
- assert_path_exist File.join @tempdir, 'specifications', 'b-1.gemspec'
+ assert_path_exist File.join @tempdir, "specifications", "a-1.gemspec"
+ assert_path_exist File.join @tempdir, "specifications", "b-1.gemspec"
assert_equal %w[b-1 a-1], installed.map {|s| s.full_name }
end
def test_install_into_development_shallow
spec_fetcher do |fetcher|
- fetcher.gem 'a', '1' do |s|
- s.add_development_dependency 'b', '= 1'
+ fetcher.gem "a", "1" do |s|
+ s.add_development_dependency "b", "= 1"
end
- fetcher.gem 'b', '1' do |s|
- s.add_development_dependency 'c', '= 1'
+ fetcher.gem "b", "1" do |s|
+ s.add_development_dependency "c", "= 1"
end
- fetcher.spec 'c', '1'
+ fetcher.spec "c", "1"
end
rs = Gem::RequestSet.new
rs.development = true
rs.development_shallow = true
- rs.gem 'a'
+ rs.gem "a"
rs.resolve
@@ -580,25 +580,25 @@ ruby "0"
}
installed = rs.install_into @tempdir, true, options do
- assert_equal @tempdir, ENV['GEM_HOME']
+ assert_equal @tempdir, ENV["GEM_HOME"]
end
assert_equal %w[a-1 b-1], installed.map {|s| s.full_name }.sort
end
def test_sorted_requests_development_shallow
- a = util_spec 'a', 1 do |s|
- s.add_development_dependency 'b'
+ a = util_spec "a", 1 do |s|
+ s.add_development_dependency "b"
end
- b = util_spec 'b', 1 do |s|
- s.add_development_dependency 'c'
+ b = util_spec "b", 1 do |s|
+ s.add_development_dependency "c"
end
- c = util_spec 'c', 1
+ c = util_spec "c", 1
rs = Gem::RequestSet.new
- rs.gem 'a'
+ rs.gem "a"
rs.development = true
rs.development_shallow = true
@@ -612,18 +612,18 @@ ruby "0"
end
def test_tsort_each_child_development
- a = util_spec 'a', 1 do |s|
- s.add_development_dependency 'b'
+ a = util_spec "a", 1 do |s|
+ s.add_development_dependency "b"
end
- b = util_spec 'b', 1 do |s|
- s.add_development_dependency 'c'
+ b = util_spec "b", 1 do |s|
+ s.add_development_dependency "c"
end
- c = util_spec 'c', 1
+ c = util_spec "c", 1
rs = Gem::RequestSet.new
- rs.gem 'a'
+ rs.gem "a"
rs.development = true
rs.development_shallow = true
@@ -641,18 +641,18 @@ ruby "0"
end
def test_tsort_each_child_development_shallow
- a = util_spec 'a', 1 do |s|
- s.add_development_dependency 'b'
+ a = util_spec "a", 1 do |s|
+ s.add_development_dependency "b"
end
- b = util_spec 'b', 1 do |s|
- s.add_development_dependency 'c'
+ b = util_spec "b", 1 do |s|
+ s.add_development_dependency "c"
end
- c = util_spec 'c', 1
+ c = util_spec "c", 1
rs = Gem::RequestSet.new
- rs.gem 'a'
+ rs.gem "a"
rs.development = true
rs.development_shallow = true