summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
-rw-r--r--test/rubygems/packages/ascii_binder-0.1.10.1.gembin0 -> 244736 bytes
-rw-r--r--test/rubygems/test_gem_commands_setup_command.rb2
-rw-r--r--test/rubygems/test_gem_commands_update_command.rb29
-rw-r--r--test/rubygems/test_gem_installer.rb22
-rw-r--r--test/rubygems/test_gem_package.rb4
-rw-r--r--test/rubygems/test_gem_platform.rb29
-rw-r--r--test/rubygems/test_gem_remote_fetcher.rb38
-rw-r--r--test/rubygems/test_gem_server.rb8
8 files changed, 94 insertions, 38 deletions
Binary files differ
@@ -48,7 +48,7 @@ class TestGemCommandsSetupCommand < Gem::TestCase
io.puts gemspec.to_ruby
end
- open(File.join(Gem.default_specifications_dir, "bundler-1.15.4.gemspec"), 'w') do |io|
gemspec.version = "1.15.4"
io.puts gemspec.to_ruby
end
@@ -168,6 +168,15 @@ class TestGemCommandsUpdateCommand < Gem::TestCase
@cmd.options[:args] = []
@cmd.options[:system] = "2.5.1"
assert_raises Gem::MockGemUi::TermError do
use_ui @ui do
@cmd.execute
@@ -175,7 +184,7 @@ class TestGemCommandsUpdateCommand < Gem::TestCase
end
assert_empty @ui.output
- assert_equal "ERROR: rubygems 2.5.1 is not supported. The oldest supported version is 2.5.2\n", @ui.error
end
def test_execute_system_specific_older_than_3_2_removes_plugins_dir
@@ -185,6 +194,15 @@ class TestGemCommandsUpdateCommand < Gem::TestCase
end
end
@cmd.options[:args] = []
@cmd.options[:system] = "3.1"
@@ -203,6 +221,15 @@ class TestGemCommandsUpdateCommand < Gem::TestCase
end
end
@cmd.options[:args] = []
@cmd.options[:system] = "3.2.a"
@@ -730,11 +730,31 @@ gem 'other', version
installer.generate_bin
default_shebang = Gem.ruby
- shebang_line = open("#{@gemhome}/bin/executable") {|f| f.readlines.first }
assert_match(/\A#!/, shebang_line)
assert_match(/#{default_shebang}/, shebang_line)
end
def test_generate_plugins
installer = util_setup_installer do |spec|
write_file File.join(@tempdir, 'lib', 'rubygems_plugin.rb') do |io|
@@ -218,7 +218,7 @@ class TestGemPackage < Gem::Package::TarTestCase
end
assert_equal %w[lib/code.rb], files
- assert_equal [{'lib/code_sym.rb' => 'lib/code.rb'}, {'lib/code_sym2.rb' => '../lib/code.rb'}], symlinks
end
def test_build
@@ -937,7 +937,7 @@ class TestGemPackage < Gem::Package::TarTestCase
build = Gem::Package.new @gem
build.spec = @spec
build.setup_signer
- open @gem, 'wb' do |gem_io|
Gem::Package::TarWriter.new gem_io do |gem|
build.add_metadata gem
build.add_contents gem
@@ -134,9 +134,7 @@ class TestGemPlatform < Gem::TestCase
'i386-solaris2.8' => ['x86', 'solaris', '2.8'],
'mswin32' => ['x86', 'mswin32', nil],
'x86_64-linux' => ['x86_64', 'linux', nil],
- 'x86_64-linux-gnu' => ['x86_64', 'linux', nil],
'x86_64-linux-musl' => ['x86_64', 'linux', 'musl'],
- 'x86_64-linux-uclibc' => ['x86_64', 'linux', 'uclibc'],
'x86_64-openbsd3.9' => ['x86_64', 'openbsd', '3.9'],
'x86_64-openbsd4.0' => ['x86_64', 'openbsd', '4.0'],
'x86_64-openbsd' => ['x86_64', 'openbsd', nil],
@@ -145,7 +143,6 @@ class TestGemPlatform < Gem::TestCase
test_cases.each do |arch, expected|
platform = Gem::Platform.new arch
assert_equal expected, platform.to_a, arch.inspect
- assert_equal expected, Gem::Platform.new(platform.to_s).to_a, arch.inspect
end
end
@@ -264,32 +261,6 @@ class TestGemPlatform < Gem::TestCase
assert((with_x86_arch === with_nil_arch), 'x86 =~ nil')
end
- def test_nil_version_is_treated_as_any_version
- x86_darwin_8 = Gem::Platform.new 'i686-darwin8.0'
- x86_darwin_nil = Gem::Platform.new 'i686-darwin'
-
- assert((x86_darwin_8 === x86_darwin_nil), '8.0 =~ nil')
- assert((x86_darwin_nil === x86_darwin_8), 'nil =~ 8.0')
- end
-
- def test_nil_version_is_stricter_for_linux_os
- x86_linux = Gem::Platform.new 'i686-linux'
- x86_linux_gnu = Gem::Platform.new 'i686-linux-gnu'
- x86_linux_musl = Gem::Platform.new 'i686-linux-musl'
- x86_linux_uclibc = Gem::Platform.new 'i686-linux-uclibc'
-
- assert((x86_linux === x86_linux_gnu), 'linux =~ linux-gnu')
- assert((x86_linux_gnu === x86_linux), 'linux-gnu =~ linux')
- assert(!(x86_linux_gnu === x86_linux_musl), 'linux-gnu =~ linux-musl')
- assert(!(x86_linux_musl === x86_linux_gnu), 'linux-musl =~ linux-gnu')
- assert(!(x86_linux_uclibc === x86_linux_musl), 'linux-uclibc =~ linux-musl')
- assert(!(x86_linux_musl === x86_linux_uclibc), 'linux-musl =~ linux-uclibc')
- assert(!(x86_linux === x86_linux_musl), 'linux =~ linux-musl')
- assert(!(x86_linux_musl === x86_linux), 'linux-musl =~ linux')
- assert(!(x86_linux === x86_linux_uclibc), 'linux =~ linux-uclibc')
- assert(!(x86_linux_uclibc === x86_linux), 'linux-uclibc =~ linux')
- end
-
def test_equals3_cpu_arm
arm = Gem::Platform.new 'arm-linux'
armv5 = Gem::Platform.new 'armv5-linux'
@@ -496,6 +496,44 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
assert_equal url, e.uri
end
def test_fetch_path_openssl_ssl_sslerror
fetcher = Gem::RemoteFetcher.new nil
@fetcher = fetcher
@@ -365,7 +365,7 @@ class TestGemServer < Gem::TestCase
specs_dir = File.join dir, 'specifications'
FileUtils.mkdir_p specs_dir
- open File.join(specs_dir, spec.spec_name), 'w' do |io|
io.write spec.to_ruby
end
@@ -420,7 +420,7 @@ class TestGemServer < Gem::TestCase
specs_dir = File.join dir, 'specifications'
FileUtils.mkdir_p specs_dir
- open File.join(specs_dir, spec.spec_name), 'w' do |io|
io.write spec.to_ruby
end
@@ -475,7 +475,7 @@ class TestGemServer < Gem::TestCase
specs_dir = File.join dir, 'specifications'
FileUtils.mkdir_p specs_dir
- open File.join(specs_dir, spec.spec_name), 'w' do |io|
io.write spec.to_ruby
end
@@ -502,7 +502,7 @@ class TestGemServer < Gem::TestCase
specs_dir = File.join dir, 'specifications'
FileUtils.mkdir_p specs_dir
- open File.join(specs_dir, spec.spec_name), 'w' do |io|
io.write spec.to_ruby
end