зеркало из https://github.com/github/ruby.git
[rubygems/rubygems] Enable Style/PercentLiteralDelimiters cop in rubygems
So it matches the style used by bundler. https://github.com/rubygems/rubygems/commit/ab0580fd65
This commit is contained in:
Родитель
f987302cf4
Коммит
ba9dcdab36
|
@ -1011,7 +1011,7 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
|
|||
def self.suffixes
|
||||
@suffixes ||= ['',
|
||||
'.rb',
|
||||
*%w(DLEXT DLEXT2).map do |key|
|
||||
*%w[DLEXT DLEXT2].map do |key|
|
||||
val = RbConfig::CONFIG[key]
|
||||
next unless val and not val.empty?
|
||||
".#{val}"
|
||||
|
|
|
@ -546,7 +546,7 @@ abort "#{deprecation_message}"
|
|||
next unless Gem.win_platform?
|
||||
|
||||
File.open "#{old_bin_path}.bat", 'w' do |fp|
|
||||
fp.puts %{@ECHO.#{deprecation_message}}
|
||||
fp.puts %(@ECHO.#{deprecation_message})
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -27,7 +27,7 @@ class Gem::Ext::ExtConfBuilder < Gem::Ext::Builder
|
|||
# Details: https://github.com/rubygems/rubygems/issues/977#issuecomment-171544940
|
||||
tmp_dest = get_relative_path(tmp_dest)
|
||||
|
||||
Tempfile.open %w"siteconf .rb", "." do |siteconf|
|
||||
Tempfile.open %w[siteconf .rb], "." do |siteconf|
|
||||
siteconf.puts "require 'rbconfig'"
|
||||
siteconf.puts "dest_path = #{tmp_dest.dump}"
|
||||
%w[sitearchdir sitelibdir].each do |dir|
|
||||
|
|
|
@ -7,7 +7,7 @@ module Gem
|
|||
# Psych.safe_load
|
||||
|
||||
module SafeYAML
|
||||
PERMITTED_CLASSES = %w(
|
||||
PERMITTED_CLASSES = %w[
|
||||
Symbol
|
||||
Time
|
||||
Date
|
||||
|
@ -19,12 +19,12 @@ module Gem
|
|||
Gem::Version::Requirement
|
||||
YAML::Syck::DefaultKey
|
||||
Syck::DefaultKey
|
||||
).freeze
|
||||
].freeze
|
||||
|
||||
PERMITTED_SYMBOLS = %w(
|
||||
PERMITTED_SYMBOLS = %w[
|
||||
development
|
||||
runtime
|
||||
).freeze
|
||||
].freeze
|
||||
|
||||
if ::YAML.respond_to? :safe_load
|
||||
def self.safe_load(input)
|
||||
|
|
|
@ -573,7 +573,7 @@ div.method-source-code pre { color: #ffdead; overflow: hidden; }
|
|||
add_date res
|
||||
|
||||
case req.request_uri.path
|
||||
when %r|^/quick/(Marshal.#{Regexp.escape Gem.marshal_version}/)?(.*?)\.gemspec\.rz$| then
|
||||
when %r{^/quick/(Marshal.#{Regexp.escape Gem.marshal_version}/)?(.*?)\.gemspec\.rz$} then
|
||||
marshal_format, full_name = $1, $2
|
||||
specs = Gem::Specification.find_all_by_full_name(full_name)
|
||||
|
||||
|
|
|
@ -228,8 +228,8 @@ class Gem::Source::Git < Gem::Source
|
|||
require 'digest' # required here to avoid deadlocking in Gem.activate_bin_path (because digest is a gem on 2.5+)
|
||||
|
||||
normalized =
|
||||
if @repository =~ %r%^\w+://(\w+@)?%
|
||||
uri = URI(@repository).normalize.to_s.sub %r%/$%,''
|
||||
if @repository =~ %r{^\w+://(\w+@)?}
|
||||
uri = URI(@repository).normalize.to_s.sub %r{/$},''
|
||||
uri.sub(/\A(\w+)/) { $1.downcase }
|
||||
else
|
||||
@repository
|
||||
|
|
|
@ -2188,7 +2188,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|||
|
||||
attributes.each do |attr_name|
|
||||
current_value = self.send attr_name
|
||||
current_value = current_value.sort if %i(files test_files).include? attr_name
|
||||
current_value = current_value.sort if %i[files test_files].include? attr_name
|
||||
if current_value != default_value(attr_name) or
|
||||
self.class.required_attribute? attr_name
|
||||
|
||||
|
|
|
@ -576,7 +576,7 @@ class Gem::TestCase < (defined?(Minitest::Test) ? Minitest::Test : MiniTest::Uni
|
|||
end
|
||||
|
||||
def in_path?(executable) # :nodoc:
|
||||
return true if %r%\A([A-Z]:|/)% =~ executable and File.exist? executable
|
||||
return true if %r{\A([A-Z]:|/)} =~ executable and File.exist? executable
|
||||
|
||||
ENV['PATH'].split(File::PATH_SEPARATOR).any? do |directory|
|
||||
File.exist? File.join directory, executable
|
||||
|
@ -1286,7 +1286,7 @@ Also, a list:
|
|||
|
||||
def escape_path(*path)
|
||||
path = File.join(*path)
|
||||
if %r'\A[-+:/=@,.\w]+\z' =~ path
|
||||
if %r{\A[-+:/=@,.\w]+\z} =~ path
|
||||
path
|
||||
else
|
||||
"\"#{path.gsub(/[`$"]/, '\\&')}\""
|
||||
|
|
|
@ -49,7 +49,7 @@ class Gem::FakeFetcher
|
|||
|
||||
path = path.to_s
|
||||
@paths << path
|
||||
raise ArgumentError, 'need full URI' unless path =~ %r'^https?://'
|
||||
raise ArgumentError, 'need full URI' unless path =~ %r{^https?://}
|
||||
|
||||
unless @data.key? path
|
||||
raise Gem::RemoteFetcher::FetchError.new("no data for #{path}", path)
|
||||
|
@ -121,7 +121,7 @@ class Gem::FakeFetcher
|
|||
path = path.to_s
|
||||
@paths << path
|
||||
|
||||
raise ArgumentError, 'need full URI' unless path =~ %r'^http://'
|
||||
raise ArgumentError, 'need full URI' unless path =~ %r{^http://}
|
||||
|
||||
unless @data.key? path
|
||||
raise Gem::RemoteFetcher::FetchError.new("no data for #{path}", path)
|
||||
|
|
|
@ -9,7 +9,7 @@ class Gem::Licenses
|
|||
|
||||
# Software Package Data Exchange (SPDX) standard open-source software
|
||||
# license identifiers
|
||||
LICENSE_IDENTIFIERS = %w(
|
||||
LICENSE_IDENTIFIERS = %w[
|
||||
0BSD
|
||||
AAL
|
||||
ADSL
|
||||
|
@ -379,10 +379,10 @@ class Gem::Licenses
|
|||
xinetd
|
||||
xpp
|
||||
zlib-acknowledgement
|
||||
).freeze
|
||||
].freeze
|
||||
|
||||
# exception identifiers
|
||||
EXCEPTION_IDENTIFIERS = %w(
|
||||
EXCEPTION_IDENTIFIERS = %w[
|
||||
389-exception
|
||||
Autoconf-exception-2.0
|
||||
Autoconf-exception-3.0
|
||||
|
@ -410,7 +410,7 @@ class Gem::Licenses
|
|||
mif-exception
|
||||
openvpn-openssl-exception
|
||||
u-boot-exception-2.0
|
||||
).freeze
|
||||
].freeze
|
||||
|
||||
REGEXP = %r{
|
||||
\A
|
||||
|
|
|
@ -42,12 +42,12 @@ class TestGem < Gem::TestCase
|
|||
|
||||
a1.activate
|
||||
|
||||
assert_equal %w(a-1), loaded_spec_names
|
||||
assert_equal %w[a-1], loaded_spec_names
|
||||
assert_equal ["b (> 0)"], unresolved_names
|
||||
|
||||
Gem.finish_resolve
|
||||
|
||||
assert_equal %w(a-1 b-2 c-2), loaded_spec_names
|
||||
assert_equal %w[a-1 b-2 c-2], loaded_spec_names
|
||||
assert_equal [], unresolved_names
|
||||
end
|
||||
end
|
||||
|
@ -66,12 +66,12 @@ class TestGem < Gem::TestCase
|
|||
|
||||
a1.activate
|
||||
|
||||
assert_equal %w(a-1), loaded_spec_names
|
||||
assert_equal %w[a-1], loaded_spec_names
|
||||
assert_equal ["b (> 0)", "d (> 0)"], unresolved_names
|
||||
|
||||
Gem.finish_resolve
|
||||
|
||||
assert_equal %w(a-1 b-1 c-1 d-2), loaded_spec_names
|
||||
assert_equal %w[a-1 b-1 c-1 d-2], loaded_spec_names
|
||||
assert_equal [], unresolved_names
|
||||
end
|
||||
end
|
||||
|
@ -89,12 +89,12 @@ class TestGem < Gem::TestCase
|
|||
a1.activate
|
||||
c1.activate
|
||||
|
||||
assert_equal %w(a-1 c-1), loaded_spec_names
|
||||
assert_equal %w[a-1 c-1], loaded_spec_names
|
||||
assert_equal ["b (> 0)"], unresolved_names
|
||||
|
||||
Gem.finish_resolve
|
||||
|
||||
assert_equal %w(a-1 b-1 c-1), loaded_spec_names
|
||||
assert_equal %w[a-1 b-1 c-1], loaded_spec_names
|
||||
assert_equal [], unresolved_names
|
||||
end
|
||||
end
|
||||
|
@ -299,7 +299,7 @@ class TestGem < Gem::TestCase
|
|||
gem 'c'
|
||||
Gem.finish_resolve
|
||||
|
||||
assert_equal %w(a-1 b-2 c-1), loaded_spec_names
|
||||
assert_equal %w[a-1 b-2 c-1], loaded_spec_names
|
||||
end
|
||||
|
||||
def test_activate_bin_path_gives_proper_error_for_bundler
|
||||
|
@ -368,7 +368,7 @@ class TestGem < Gem::TestCase
|
|||
|
||||
load Gem.activate_bin_path("bundler", "bundle", ">= 0.a")
|
||||
|
||||
assert_equal %w(bundler-2.0.0), loaded_spec_names
|
||||
assert_equal %w[bundler-2.0.0], loaded_spec_names
|
||||
end
|
||||
|
||||
def test_activate_bin_path_respects_underscore_selection_if_given
|
||||
|
@ -402,7 +402,7 @@ class TestGem < Gem::TestCase
|
|||
|
||||
load Gem.activate_bin_path("bundler", "bundle", "= 1.17.3")
|
||||
|
||||
assert_equal %w(bundler-1.17.3), loaded_spec_names
|
||||
assert_equal %w[bundler-1.17.3], loaded_spec_names
|
||||
end
|
||||
|
||||
def test_self_bin_path_no_exec_name
|
||||
|
@ -701,7 +701,7 @@ class TestGem < Gem::TestCase
|
|||
|
||||
discover_path = File.join 'lib', 'sff', 'discover.rb'
|
||||
|
||||
foo1, foo2 = %w(1 2).map do |version|
|
||||
foo1, foo2 = %w[1 2].map do |version|
|
||||
spec = quick_gem 'sff', version do |s|
|
||||
s.files << discover_path
|
||||
end
|
||||
|
@ -733,7 +733,7 @@ class TestGem < Gem::TestCase
|
|||
|
||||
discover_path = File.join 'lib', 'sff', 'discover.rb'
|
||||
|
||||
foo1, _ = %w(1 2).map do |version|
|
||||
foo1, _ = %w[1 2].map do |version|
|
||||
spec = quick_gem 'sff', version do |s|
|
||||
s.files << discover_path
|
||||
end
|
||||
|
@ -769,7 +769,7 @@ class TestGem < Gem::TestCase
|
|||
|
||||
discover_path = File.join 'lib', 'sff', 'discover.rb'
|
||||
|
||||
_, foo2 = %w(1 2).map do |version|
|
||||
_, foo2 = %w[1 2].map do |version|
|
||||
spec = quick_gem 'sff', version do |s|
|
||||
s.files << discover_path
|
||||
end
|
||||
|
@ -1259,7 +1259,7 @@ class TestGem < Gem::TestCase
|
|||
Gem.try_activate 'a_file'
|
||||
end
|
||||
|
||||
assert_match %r%Could not find 'b' %, e.message
|
||||
assert_match %r{Could not find 'b' }, e.message
|
||||
end
|
||||
|
||||
def test_self_try_activate_missing_prerelease
|
||||
|
@ -1279,7 +1279,7 @@ class TestGem < Gem::TestCase
|
|||
Gem.try_activate 'a_file'
|
||||
end
|
||||
|
||||
assert_match %r%Could not find 'b' \(= 1.0rc1\)%, e.message
|
||||
assert_match %r{Could not find 'b' \(= 1.0rc1\)}, e.message
|
||||
end
|
||||
|
||||
def test_self_try_activate_missing_extensions
|
||||
|
@ -1384,7 +1384,7 @@ class TestGem < Gem::TestCase
|
|||
|
||||
activated = Gem::Specification.map { |x| x.full_name }
|
||||
|
||||
assert_equal %w!a-1 b-1 c-2!, activated.sort
|
||||
assert_equal %w[a-1 b-1 c-2], activated.sort
|
||||
end
|
||||
|
||||
def test_self_needs_picks_up_unresolved_deps
|
||||
|
@ -1404,7 +1404,7 @@ class TestGem < Gem::TestCase
|
|||
require "d#{$$}"
|
||||
end
|
||||
|
||||
assert_equal %w!a-1 b-1 c-2 d-1 e-1!, loaded_spec_names
|
||||
assert_equal %w[a-1 b-1 c-2 d-1 e-1], loaded_spec_names
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -1596,7 +1596,7 @@ class TestGem < Gem::TestCase
|
|||
|
||||
Gem.use_gemdeps
|
||||
|
||||
assert_equal add_bundler_full_name(%W(a-1 b-1 c-1)), loaded_spec_names
|
||||
assert_equal add_bundler_full_name(%W[a-1 b-1 c-1]), loaded_spec_names
|
||||
end
|
||||
|
||||
def test_auto_activation_of_used_gemdeps_file
|
||||
|
@ -1750,7 +1750,7 @@ class TestGem < Gem::TestCase
|
|||
|
||||
Gem.use_gemdeps gem_deps_file
|
||||
|
||||
assert_equal add_bundler_full_name(%W(a-1)), loaded_spec_names
|
||||
assert_equal add_bundler_full_name(%W[a-1]), loaded_spec_names
|
||||
refute_nil Gem.gemdeps
|
||||
end
|
||||
|
||||
|
@ -1810,7 +1810,7 @@ class TestGem < Gem::TestCase
|
|||
|
||||
Gem.use_gemdeps
|
||||
|
||||
assert_equal add_bundler_full_name(%W(a-1)), loaded_spec_names
|
||||
assert_equal add_bundler_full_name(%W[a-1]), loaded_spec_names
|
||||
ensure
|
||||
ENV['RUBYGEMS_GEMDEPS'] = rubygems_gemdeps
|
||||
end
|
||||
|
@ -1887,7 +1887,7 @@ You may need to `gem install -g` to install missing gems
|
|||
|
||||
Gem.use_gemdeps
|
||||
|
||||
assert_equal add_bundler_full_name(%W(a-1)), loaded_spec_names
|
||||
assert_equal add_bundler_full_name(%W[a-1]), loaded_spec_names
|
||||
ensure
|
||||
ENV['RUBYGEMS_GEMDEPS'] = rubygems_gemdeps
|
||||
end
|
||||
|
|
|
@ -82,7 +82,7 @@ class TestGemCommand < Gem::TestCase
|
|||
@cmd.invoke
|
||||
end
|
||||
|
||||
assert_match %r|Usage: gem doit|, @ui.output
|
||||
assert_match %r{Usage: gem doit}, @ui.output
|
||||
end
|
||||
|
||||
def test_invoke
|
||||
|
@ -168,7 +168,7 @@ class TestGemCommand < Gem::TestCase
|
|||
@cmd.invoke '-h'
|
||||
end
|
||||
|
||||
assert_match %r|Usage: gem doit|, @ui.output
|
||||
assert_match %r{Usage: gem doit}, @ui.output
|
||||
end
|
||||
|
||||
def test_option_recognition
|
||||
|
|
|
@ -220,7 +220,7 @@ class TestGemCommandsCleanupCommand < Gem::TestCase
|
|||
@cmd.execute
|
||||
end
|
||||
|
||||
assert_match %r%^Skipped default gems: b-2%, @ui.output
|
||||
assert_match %r{^Skipped default gems: b-2}, @ui.output
|
||||
assert_empty @ui.error
|
||||
end
|
||||
|
||||
|
|
|
@ -27,8 +27,8 @@ class TestGemCommandsContentsCommand < Gem::TestCase
|
|||
@cmd.execute
|
||||
end
|
||||
|
||||
assert_match %r|lib/foo\.rb|, @ui.output
|
||||
assert_match %r|Rakefile|, @ui.output
|
||||
assert_match %r{lib/foo\.rb}, @ui.output
|
||||
assert_match %r{Rakefile}, @ui.output
|
||||
assert_equal "", @ui.error
|
||||
end
|
||||
|
||||
|
@ -42,9 +42,9 @@ class TestGemCommandsContentsCommand < Gem::TestCase
|
|||
@cmd.execute
|
||||
end
|
||||
|
||||
assert_match %r|lib/foo\.rb|, @ui.output
|
||||
assert_match %r|lib/bar\.rb|, @ui.output
|
||||
assert_match %r|Rakefile|, @ui.output
|
||||
assert_match %r{lib/foo\.rb}, @ui.output
|
||||
assert_match %r{lib/bar\.rb}, @ui.output
|
||||
assert_match %r{Rakefile}, @ui.output
|
||||
assert_equal "", @ui.error
|
||||
end
|
||||
|
||||
|
@ -57,8 +57,8 @@ class TestGemCommandsContentsCommand < Gem::TestCase
|
|||
end
|
||||
end
|
||||
|
||||
assert_match %r|Unable to find gem 'foo' in default gem paths|, @ui.output
|
||||
assert_match %r|Directories searched:|, @ui.output
|
||||
assert_match %r{Unable to find gem 'foo' in default gem paths}, @ui.output
|
||||
assert_match %r{Directories searched:}, @ui.output
|
||||
assert_equal "", @ui.error
|
||||
end
|
||||
|
||||
|
@ -71,8 +71,8 @@ class TestGemCommandsContentsCommand < Gem::TestCase
|
|||
@cmd.execute
|
||||
end
|
||||
|
||||
assert_match %r|lib/foo\.rb|, @ui.output
|
||||
assert_match %r|Rakefile|, @ui.output
|
||||
assert_match %r{lib/foo\.rb}, @ui.output
|
||||
assert_match %r{Rakefile}, @ui.output
|
||||
assert_equal "", @ui.error
|
||||
end
|
||||
|
||||
|
@ -86,8 +86,8 @@ class TestGemCommandsContentsCommand < Gem::TestCase
|
|||
@cmd.execute
|
||||
end
|
||||
|
||||
assert_match %r|lib/foo\.rb|, @ui.output
|
||||
refute_match %r|Rakefile|, @ui.output
|
||||
assert_match %r{lib/foo\.rb}, @ui.output
|
||||
refute_match %r{Rakefile}, @ui.output
|
||||
|
||||
assert_equal "", @ui.error
|
||||
end
|
||||
|
@ -146,9 +146,9 @@ class TestGemCommandsContentsCommand < Gem::TestCase
|
|||
@cmd.execute
|
||||
end
|
||||
|
||||
assert_match %r|lib/foo\.rb|, @ui.output
|
||||
assert_match %r|lib/bar\.rb|, @ui.output
|
||||
assert_match %r|Rakefile|, @ui.output
|
||||
assert_match %r{lib/foo\.rb}, @ui.output
|
||||
assert_match %r{lib/bar\.rb}, @ui.output
|
||||
assert_match %r{Rakefile}, @ui.output
|
||||
assert_equal "", @ui.error
|
||||
end
|
||||
|
||||
|
|
|
@ -22,29 +22,29 @@ class TestGemCommandsEnvironmentCommand < Gem::TestCase
|
|||
@cmd.execute
|
||||
end
|
||||
|
||||
assert_match %r|RUBYGEMS VERSION: (\d\.)+\d|, @ui.output
|
||||
assert_match %r|RUBY VERSION: \d+\.\d+\.\d+ \(.*\) \[.*\]|, @ui.output
|
||||
assert_match %r|INSTALLATION DIRECTORY: #{Regexp.escape @gemhome}|,
|
||||
assert_match %r{RUBYGEMS VERSION: (\d\.)+\d}, @ui.output
|
||||
assert_match %r{RUBY VERSION: \d+\.\d+\.\d+ \(.*\) \[.*\]}, @ui.output
|
||||
assert_match %r{INSTALLATION DIRECTORY: #{Regexp.escape @gemhome}},
|
||||
@ui.output
|
||||
assert_match %r|RUBYGEMS PREFIX: |, @ui.output
|
||||
assert_match %r|RUBY EXECUTABLE:.*#{RbConfig::CONFIG['ruby_install_name']}|,
|
||||
assert_match %r{RUBYGEMS PREFIX: }, @ui.output
|
||||
assert_match %r{RUBY EXECUTABLE:.*#{RbConfig::CONFIG['ruby_install_name']}},
|
||||
@ui.output
|
||||
assert_match %r|GIT EXECUTABLE: #{@cmd.send(:git_path)}|, @ui.output
|
||||
assert_match %r|SYSTEM CONFIGURATION DIRECTORY:|, @ui.output
|
||||
assert_match %r|EXECUTABLE DIRECTORY:|, @ui.output
|
||||
assert_match %r|RUBYGEMS PLATFORMS:|, @ui.output
|
||||
assert_match %r|- #{Gem::Platform.local}|, @ui.output
|
||||
assert_match %r|GEM PATHS:|, @ui.output
|
||||
assert_match %r|- #{Regexp.escape @gemhome}|, @ui.output
|
||||
assert_match %r|GEM CONFIGURATION:|, @ui.output
|
||||
assert_match %r|"gemcutter_key" => "\*\*\*\*"|, @ui.output
|
||||
assert_match %r|:verbose => |, @ui.output
|
||||
assert_match %r|REMOTE SOURCES:|, @ui.output
|
||||
assert_match %r{GIT EXECUTABLE: #{@cmd.send(:git_path)}}, @ui.output
|
||||
assert_match %r{SYSTEM CONFIGURATION DIRECTORY:}, @ui.output
|
||||
assert_match %r{EXECUTABLE DIRECTORY:}, @ui.output
|
||||
assert_match %r{RUBYGEMS PLATFORMS:}, @ui.output
|
||||
assert_match %r{- #{Gem::Platform.local}}, @ui.output
|
||||
assert_match %r{GEM PATHS:}, @ui.output
|
||||
assert_match %r{- #{Regexp.escape @gemhome}}, @ui.output
|
||||
assert_match %r{GEM CONFIGURATION:}, @ui.output
|
||||
assert_match %r{"gemcutter_key" => "\*\*\*\*"}, @ui.output
|
||||
assert_match %r{:verbose => }, @ui.output
|
||||
assert_match %r{REMOTE SOURCES:}, @ui.output
|
||||
|
||||
assert_match %r|- SHELL PATH:|, @ui.output
|
||||
assert_match %r|- /usr/local/bin$|, @ui.output
|
||||
assert_match %r|- /usr/bin$|, @ui.output
|
||||
assert_match %r|- /bin$|, @ui.output
|
||||
assert_match %r{- SHELL PATH:}, @ui.output
|
||||
assert_match %r{- /usr/local/bin$}, @ui.output
|
||||
assert_match %r{- /usr/bin$}, @ui.output
|
||||
assert_match %r{- /bin$}, @ui.output
|
||||
|
||||
assert_empty @ui.error
|
||||
|
||||
|
|
|
@ -33,12 +33,12 @@ class TestGemCommandsInfoCommand < Gem::TestCase
|
|||
@cmd.execute
|
||||
end
|
||||
|
||||
assert_match %r%#{@gem.name} \(#{@gem.version}\)\n%, @ui.output
|
||||
assert_match %r%Authors: #{@gem.authors.join(', ')}\n%, @ui.output
|
||||
assert_match %r%Homepage: #{@gem.homepage}\n%, @ui.output
|
||||
assert_match %r%License: #{@gem.license}\n%, @ui.output
|
||||
assert_match %r%Installed at: #{@gem.base_dir}\n%, @ui.output
|
||||
assert_match %r%#{@gem.summary}\n%, @ui.output
|
||||
assert_match %r{#{@gem.name} \(#{@gem.version}\)\n}, @ui.output
|
||||
assert_match %r{Authors: #{@gem.authors.join(', ')}\n}, @ui.output
|
||||
assert_match %r{Homepage: #{@gem.homepage}\n}, @ui.output
|
||||
assert_match %r{License: #{@gem.license}\n}, @ui.output
|
||||
assert_match %r{Installed at: #{@gem.base_dir}\n}, @ui.output
|
||||
assert_match %r{#{@gem.summary}\n}, @ui.output
|
||||
assert_match "", @ui.error
|
||||
end
|
||||
|
||||
|
|
|
@ -337,7 +337,7 @@ ERROR: Could not find a valid gem 'bar' (= 0.5) (required by 'foo' (>= 0)) in a
|
|||
errs = @ui.error.split("\n")
|
||||
|
||||
assert_match(/ould not find a valid gem 'nonexistent'/, errs.shift)
|
||||
assert_match(%r!Unable to download data from http://not-there.nothing!, errs.shift)
|
||||
assert_match(%r{Unable to download data from http://not-there.nothing}, errs.shift)
|
||||
end
|
||||
|
||||
def test_execute_nonexistent_hint_disabled
|
||||
|
@ -582,7 +582,7 @@ ERROR: Possible alternatives: non_existent_with_hint
|
|||
fetcher.gem 'a', 2
|
||||
end
|
||||
|
||||
args = %w!--with-awesome=true --more-awesome=yes!
|
||||
args = %w[--with-awesome=true --more-awesome=yes]
|
||||
|
||||
Gem::Command.build_args = args
|
||||
|
||||
|
@ -886,7 +886,7 @@ ERROR: Possible alternatives: non_existent_with_hint
|
|||
end
|
||||
|
||||
assert_equal 2, e.exit_code
|
||||
assert_match %r!Could not find a valid gem 'a' \(= 10.0\)!, @ui.error
|
||||
assert_match %r{Could not find a valid gem 'a' \(= 10.0\)}, @ui.error
|
||||
end
|
||||
|
||||
def test_show_errors_on_failure
|
||||
|
|
|
@ -15,7 +15,7 @@ class TestGemCommandsMirrorCommand < Gem::TestCase
|
|||
@cmd.execute
|
||||
end
|
||||
|
||||
assert_match %r%Install the rubygems-mirror%i, @ui.error
|
||||
assert_match %r{Install the rubygems-mirror}i, @ui.error
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -51,7 +51,7 @@ class TestGemCommandsOpenCommand < Gem::TestCase
|
|||
end
|
||||
end
|
||||
|
||||
assert_match %r|Unable to find gem 'foo'|, @ui.output
|
||||
assert_match %r{Unable to find gem 'foo'}, @ui.output
|
||||
assert_equal "", @ui.error
|
||||
end
|
||||
|
||||
|
@ -64,7 +64,7 @@ class TestGemCommandsOpenCommand < Gem::TestCase
|
|||
end
|
||||
end
|
||||
|
||||
assert_match %r|Unable to find gem 'foo'|, @ui.output
|
||||
assert_match %r{Unable to find gem 'foo'}, @ui.output
|
||||
assert_equal "", @ui.error
|
||||
end
|
||||
|
||||
|
@ -93,7 +93,7 @@ class TestGemCommandsOpenCommand < Gem::TestCase
|
|||
end
|
||||
end
|
||||
|
||||
assert_match %r|'foo' is a default gem and can't be opened\.| , @ui.output
|
||||
assert_match %r{'foo' is a default gem and can't be opened\.} , @ui.output
|
||||
assert_equal "", @ui.error
|
||||
end
|
||||
|
||||
|
|
|
@ -119,7 +119,7 @@ EOF
|
|||
end
|
||||
Gem.configuration.load_api_keys
|
||||
|
||||
@cmd.handle_options %w(-k other)
|
||||
@cmd.handle_options %w[-k other]
|
||||
@cmd.show_owners('freewill')
|
||||
|
||||
assert_equal '701229f217cdf23b1344c7b4b54ca97', @stub_fetcher.last_request['Authorization']
|
||||
|
@ -177,7 +177,7 @@ EOF
|
|||
end
|
||||
Gem.configuration.load_api_keys
|
||||
|
||||
@cmd.handle_options %w(-k other)
|
||||
@cmd.handle_options %w[-k other]
|
||||
@cmd.add_owners('freewill', ['user-new1@example.com'])
|
||||
|
||||
assert_equal '701229f217cdf23b1344c7b4b54ca97', @stub_fetcher.last_request['Authorization']
|
||||
|
@ -217,7 +217,7 @@ EOF
|
|||
end
|
||||
Gem.configuration.load_api_keys
|
||||
|
||||
@cmd.handle_options %w(-k other)
|
||||
@cmd.handle_options %w[-k other]
|
||||
@cmd.remove_owners('freewill', ['user-remove1@example.com'])
|
||||
|
||||
assert_equal '701229f217cdf23b1344c7b4b54ca97', @stub_fetcher.last_request['Authorization']
|
||||
|
|
|
@ -160,9 +160,9 @@ class TestGemCommandsPristineCommand < Gem::TestCase
|
|||
|
||||
ruby_exec = sprintf Gem.default_exec_format, 'ruby'
|
||||
|
||||
bin_env = win_platform? ? "" : %w(/usr/bin/env /bin/env).find {|f| File.executable?(f) } + " "
|
||||
bin_env = win_platform? ? "" : %w[/usr/bin/env /bin/env].find {|f| File.executable?(f) } + " "
|
||||
|
||||
assert_match %r%\A#!\s*#{bin_env}#{ruby_exec}%, File.read(gem_exec)
|
||||
assert_match %r{\A#!\s*#{bin_env}#{ruby_exec}}, File.read(gem_exec)
|
||||
end
|
||||
|
||||
def test_execute_extensions_explicit
|
||||
|
@ -246,7 +246,7 @@ class TestGemCommandsPristineCommand < Gem::TestCase
|
|||
RUBY
|
||||
end
|
||||
|
||||
build_args = %w!--with-awesome=true --sweet!
|
||||
build_args = %w[--with-awesome=true --sweet]
|
||||
|
||||
install_gem a, :build_args => build_args
|
||||
|
||||
|
@ -455,7 +455,7 @@ class TestGemCommandsPristineCommand < Gem::TestCase
|
|||
end
|
||||
end
|
||||
|
||||
assert_match %r|at least one gem name|, e.message
|
||||
assert_match %r{at least one gem name}, e.message
|
||||
end
|
||||
|
||||
def test_execute_only_executables
|
||||
|
|
|
@ -246,7 +246,7 @@ class TestGemCommandsPushCommand < Gem::TestCase
|
|||
spec.metadata['allowed_push_host'] = "https://privategemserver.example"
|
||||
end
|
||||
|
||||
response = %{ERROR: "#{@host}" is not allowed by the gemspec, which only allows "https://privategemserver.example"}
|
||||
response = %(ERROR: "#{@host}" is not allowed by the gemspec, which only allows "https://privategemserver.example")
|
||||
|
||||
assert_raises Gem::MockGemUi::TermError do
|
||||
send_battery
|
||||
|
@ -355,7 +355,7 @@ class TestGemCommandsPushCommand < Gem::TestCase
|
|||
end
|
||||
Gem.configuration.load_api_keys
|
||||
|
||||
@cmd.handle_options %w(-k other)
|
||||
@cmd.handle_options %w[-k other]
|
||||
@cmd.instance_variable_set :@host, @host
|
||||
@cmd.send_gem(@path)
|
||||
|
||||
|
|
|
@ -580,8 +580,8 @@ pl (1 i386-linux)
|
|||
@cmd.execute
|
||||
end
|
||||
|
||||
assert_match %r%^a %, @stub_ui.output
|
||||
assert_match %r%^pl %, @stub_ui.output
|
||||
assert_match %r{^a }, @stub_ui.output
|
||||
assert_match %r{^pl }, @stub_ui.output
|
||||
assert_equal '', @stub_ui.error
|
||||
end
|
||||
|
||||
|
@ -593,8 +593,8 @@ pl (1 i386-linux)
|
|||
@cmd.send :show_gems, /a/i
|
||||
end
|
||||
|
||||
assert_match %r%^a %, @stub_ui.output
|
||||
refute_match %r%^pl %, @stub_ui.output
|
||||
assert_match %r{^a }, @stub_ui.output
|
||||
refute_match %r{^pl }, @stub_ui.output
|
||||
assert_empty @stub_ui.error
|
||||
end
|
||||
|
||||
|
|
|
@ -196,10 +196,10 @@ class TestGemCommandsSetupCommand < Gem::TestCase
|
|||
|
||||
ruby_exec = sprintf Gem.default_exec_format, 'ruby'
|
||||
|
||||
bin_env = win_platform? ? "" : %w(/usr/bin/env /bin/env).find {|f| File.executable?(f) } + " "
|
||||
assert_match %r%\A#!\s*#{bin_env}#{ruby_exec}%, File.read(default_gem_bin_path)
|
||||
assert_match %r%\A#!\s*#{bin_env}#{ruby_exec}%, File.read(default_bundle_bin_path)
|
||||
assert_match %r%\A#!\s*#{bin_env}#{ruby_exec}%, File.read(gem_bin_path)
|
||||
bin_env = win_platform? ? "" : %w[/usr/bin/env /bin/env].find {|f| File.executable?(f) } + " "
|
||||
assert_match %r{\A#!\s*#{bin_env}#{ruby_exec}}, File.read(default_gem_bin_path)
|
||||
assert_match %r{\A#!\s*#{bin_env}#{ruby_exec}}, File.read(default_bundle_bin_path)
|
||||
assert_match %r{\A#!\s*#{bin_env}#{ruby_exec}}, File.read(gem_bin_path)
|
||||
end
|
||||
|
||||
def test_pem_files_in
|
||||
|
|
|
@ -21,8 +21,8 @@ class TestGemCommandsSpecificationCommand < Gem::TestCase
|
|||
@cmd.execute
|
||||
end
|
||||
|
||||
assert_match %r|Gem::Specification|, @ui.output
|
||||
assert_match %r|name: foo|, @ui.output
|
||||
assert_match %r{Gem::Specification}, @ui.output
|
||||
assert_match %r{name: foo}, @ui.output
|
||||
assert_equal '', @ui.error
|
||||
end
|
||||
|
||||
|
@ -37,10 +37,10 @@ class TestGemCommandsSpecificationCommand < Gem::TestCase
|
|||
@cmd.execute
|
||||
end
|
||||
|
||||
assert_match %r|Gem::Specification|, @ui.output
|
||||
assert_match %r|name: foo|, @ui.output
|
||||
assert_match %r|version: 0.0.1|, @ui.output
|
||||
assert_match %r|version: 0.0.2|, @ui.output
|
||||
assert_match %r{Gem::Specification}, @ui.output
|
||||
assert_match %r{name: foo}, @ui.output
|
||||
assert_match %r{version: 0.0.1}, @ui.output
|
||||
assert_match %r{version: 0.0.2}, @ui.output
|
||||
assert_equal '', @ui.error
|
||||
end
|
||||
|
||||
|
@ -99,8 +99,8 @@ class TestGemCommandsSpecificationCommand < Gem::TestCase
|
|||
@cmd.execute
|
||||
end
|
||||
|
||||
assert_match %r|Gem::Specification|, @ui.output
|
||||
assert_match %r|name: foo|, @ui.output
|
||||
assert_match %r{Gem::Specification}, @ui.output
|
||||
assert_match %r{name: foo}, @ui.output
|
||||
assert_equal '', @ui.error
|
||||
end
|
||||
|
||||
|
@ -131,8 +131,8 @@ class TestGemCommandsSpecificationCommand < Gem::TestCase
|
|||
@cmd.execute
|
||||
end
|
||||
|
||||
assert_match %r|Gem::Specification|, @ui.output
|
||||
assert_match %r|name: foo|, @ui.output
|
||||
assert_match %r{Gem::Specification}, @ui.output
|
||||
assert_match %r{name: foo}, @ui.output
|
||||
assert_equal '', @ui.error
|
||||
end
|
||||
|
||||
|
@ -164,8 +164,8 @@ class TestGemCommandsSpecificationCommand < Gem::TestCase
|
|||
@cmd.execute
|
||||
end
|
||||
|
||||
assert_match %r|\A--- !ruby/object:Gem::Specification|, @ui.output
|
||||
assert_match %r|name: foo|, @ui.output
|
||||
assert_match %r{\A--- !ruby/object:Gem::Specification}, @ui.output
|
||||
assert_match %r{name: foo}, @ui.output
|
||||
end
|
||||
|
||||
def test_execute_remote_with_version
|
||||
|
@ -200,8 +200,8 @@ class TestGemCommandsSpecificationCommand < Gem::TestCase
|
|||
@cmd.execute
|
||||
end
|
||||
|
||||
assert_match %r|\A--- !ruby/object:Gem::Specification|, @ui.output
|
||||
assert_match %r|name: foo|, @ui.output
|
||||
assert_match %r{\A--- !ruby/object:Gem::Specification}, @ui.output
|
||||
assert_match %r{name: foo}, @ui.output
|
||||
|
||||
spec = YAML.load @ui.output
|
||||
|
||||
|
@ -222,8 +222,8 @@ class TestGemCommandsSpecificationCommand < Gem::TestCase
|
|||
@cmd.execute
|
||||
end
|
||||
|
||||
assert_match %r|\A--- !ruby/object:Gem::Specification|, @ui.output
|
||||
assert_match %r|name: foo|, @ui.output
|
||||
assert_match %r{\A--- !ruby/object:Gem::Specification}, @ui.output
|
||||
assert_match %r{name: foo}, @ui.output
|
||||
|
||||
spec = YAML.load @ui.output
|
||||
|
||||
|
@ -242,8 +242,8 @@ class TestGemCommandsSpecificationCommand < Gem::TestCase
|
|||
@cmd.execute
|
||||
end
|
||||
|
||||
assert_match %r|Gem::Specification.new|, @ui.output
|
||||
assert_match %r|s.name = "foo"|, @ui.output
|
||||
assert_match %r{Gem::Specification.new}, @ui.output
|
||||
assert_match %r{s.name = "foo"}, @ui.output
|
||||
assert_equal '', @ui.error
|
||||
end
|
||||
|
||||
|
|
|
@ -486,7 +486,7 @@ WARNING: Use your OS package manager to uninstall vendor gems
|
|||
end
|
||||
|
||||
assert_empty @ui.output
|
||||
assert_match %r!Error: unable to successfully uninstall '#{@spec.name}'!, @ui.error
|
||||
assert_match %r{Error: unable to successfully uninstall '#{@spec.name}'}, @ui.error
|
||||
end
|
||||
|
||||
private
|
||||
|
|
|
@ -33,7 +33,7 @@ class TestGemCommandsWhichCommand < Gem::TestCase
|
|||
end
|
||||
|
||||
assert_equal '', @ui.output
|
||||
assert_match %r%Can.t find Ruby library file or shared library directory\n%,
|
||||
assert_match %r{Can.t find Ruby library file or shared library directory\n},
|
||||
@ui.error
|
||||
end
|
||||
|
||||
|
@ -51,7 +51,7 @@ class TestGemCommandsWhichCommand < Gem::TestCase
|
|||
end
|
||||
|
||||
assert_equal "#{@foo_bar.full_gem_path}/lib/foo_bar.rb\n", @ui.output
|
||||
assert_match %r%Can.t find Ruby library file or shared library missinglib\n%,
|
||||
assert_match %r{Can.t find Ruby library file or shared library missinglib\n},
|
||||
@ui.error
|
||||
end
|
||||
|
||||
|
@ -65,7 +65,7 @@ class TestGemCommandsWhichCommand < Gem::TestCase
|
|||
end
|
||||
|
||||
assert_equal '', @ui.output
|
||||
assert_match %r%Can.t find Ruby library file or shared library missinglib\n%,
|
||||
assert_match %r{Can.t find Ruby library file or shared library missinglib\n},
|
||||
@ui.error
|
||||
end
|
||||
|
||||
|
|
|
@ -46,8 +46,8 @@ class TestGemCommandsYankCommand < Gem::TestCase
|
|||
@cmd.execute
|
||||
end
|
||||
|
||||
assert_match %r%Yanking gem from http://example%, @ui.output
|
||||
assert_match %r%Successfully yanked%, @ui.output
|
||||
assert_match %r{Yanking gem from http://example}, @ui.output
|
||||
assert_match %r{Successfully yanked}, @ui.output
|
||||
|
||||
platform = Gem.platforms[1]
|
||||
body = @fetcher.last_request.body.split('&').sort
|
||||
|
@ -77,8 +77,8 @@ class TestGemCommandsYankCommand < Gem::TestCase
|
|||
|
||||
assert_match 'You have enabled multi-factor authentication. Please enter OTP code.', @otp_ui.output
|
||||
assert_match 'Code: ', @otp_ui.output
|
||||
assert_match %r%Yanking gem from http://example%, @otp_ui.output
|
||||
assert_match %r%Successfully yanked%, @otp_ui.output
|
||||
assert_match %r{Yanking gem from http://example}, @otp_ui.output
|
||||
assert_match %r{Successfully yanked}, @otp_ui.output
|
||||
assert_equal '111111', @fetcher.last_request['OTP']
|
||||
end
|
||||
|
||||
|
@ -132,8 +132,8 @@ class TestGemCommandsYankCommand < Gem::TestCase
|
|||
@cmd.execute
|
||||
end
|
||||
|
||||
assert_match %r%Yanking gem from https://other.example%, @ui.output
|
||||
assert_match %r%Successfully yanked%, @ui.output
|
||||
assert_match %r{Yanking gem from https://other.example}, @ui.output
|
||||
assert_match %r{Successfully yanked}, @ui.output
|
||||
|
||||
body = @fetcher.last_request.body.split('&').sort
|
||||
assert_equal %w[gem_name=a version=1.0], body
|
||||
|
|
|
@ -559,7 +559,7 @@ class TestGemDependencyInstaller < Gem::TestCase
|
|||
|
||||
env = "/\\S+/env" unless Gem.win_platform?
|
||||
|
||||
assert_match %r|\A#!#{env} #{RbConfig::CONFIG['ruby_install_name']}\n|,
|
||||
assert_match %r{\A#!#{env} #{RbConfig::CONFIG['ruby_install_name']}\n},
|
||||
File.read(File.join(@gemhome, 'bin', 'a_bin'))
|
||||
end
|
||||
|
||||
|
@ -875,7 +875,7 @@ class TestGemDependencyInstaller < Gem::TestCase
|
|||
inst = Gem::DependencyInstaller.new :wrappers => false, :format_executable => false
|
||||
inst.install 'a'
|
||||
|
||||
refute_match(%r|This file was generated by RubyGems.|,
|
||||
refute_match(%r{This file was generated by RubyGems.},
|
||||
File.read(File.join(@gemhome, 'bin', 'a_bin')))
|
||||
end
|
||||
end
|
||||
|
|
|
@ -21,7 +21,7 @@ class TestGemDependencyResolutionError < Gem::TestCase
|
|||
end
|
||||
|
||||
def test_message
|
||||
assert_match %r%^conflicting dependencies a \(= 1\) and a \(= 2\)$%,
|
||||
assert_match %r{^conflicting dependencies a \(= 1\) and a \(= 2\)$},
|
||||
@error.message
|
||||
end
|
||||
|
||||
|
|
|
@ -50,14 +50,14 @@ install:
|
|||
|
||||
results = results.join "\n"
|
||||
|
||||
assert_match %r%"DESTDIR=#{ENV['DESTDIR']}" clean$%, results
|
||||
assert_match %r%"DESTDIR=#{ENV['DESTDIR']}"$%, results
|
||||
assert_match %r%"DESTDIR=#{ENV['DESTDIR']}" install$%, results
|
||||
assert_match %r{"DESTDIR=#{ENV['DESTDIR']}" clean$}, results
|
||||
assert_match %r{"DESTDIR=#{ENV['DESTDIR']}"$}, results
|
||||
assert_match %r{"DESTDIR=#{ENV['DESTDIR']}" install$}, results
|
||||
|
||||
if /nmake/ !~ results
|
||||
assert_match %r%^clean: destination$%, results
|
||||
assert_match %r%^all: destination$%, results
|
||||
assert_match %r%^install: destination$%, results
|
||||
assert_match %r{^clean: destination$}, results
|
||||
assert_match %r{^all: destination$}, results
|
||||
assert_match %r{^install: destination$}, results
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -81,9 +81,9 @@ install:
|
|||
|
||||
results = results.join "\n"
|
||||
|
||||
assert_match %r%"DESTDIR=#{ENV['DESTDIR']}" clean$%, results
|
||||
assert_match %r%"DESTDIR=#{ENV['DESTDIR']}"$%, results
|
||||
assert_match %r%"DESTDIR=#{ENV['DESTDIR']}" install$%, results
|
||||
assert_match %r{"DESTDIR=#{ENV['DESTDIR']}" clean$}, results
|
||||
assert_match %r{"DESTDIR=#{ENV['DESTDIR']}"$}, results
|
||||
assert_match %r{"DESTDIR=#{ENV['DESTDIR']}" install$}, results
|
||||
end
|
||||
|
||||
def test_build_extensions
|
||||
|
@ -234,9 +234,9 @@ install:
|
|||
|
||||
gem_make_out = File.join @spec.extension_dir, 'gem_make.out'
|
||||
|
||||
assert_match %r%#{Regexp.escape Gem.ruby}.* extconf\.rb%,
|
||||
assert_match %r{#{Regexp.escape Gem.ruby}.* extconf\.rb},
|
||||
File.read(gem_make_out)
|
||||
assert_match %r%: No such file%,
|
||||
assert_match %r{: No such file},
|
||||
File.read(gem_make_out)
|
||||
|
||||
refute_path_exists @spec.gem_build_complete_path
|
||||
|
@ -244,7 +244,7 @@ install:
|
|||
skip "Gem.ruby is not the name of the binary being run in the end" \
|
||||
unless File.read(gem_make_out).include? "#{Gem.ruby}:"
|
||||
|
||||
assert_match %r%#{Regexp.escape Gem.ruby}: No such file%,
|
||||
assert_match %r{#{Regexp.escape Gem.ruby}: No such file},
|
||||
File.read(gem_make_out)
|
||||
|
||||
assert_equal cwd, Dir.pwd
|
||||
|
|
|
@ -43,11 +43,11 @@ install (FILES test.txt DESTINATION bin)
|
|||
output = output.join "\n"
|
||||
|
||||
assert_match \
|
||||
%r%^cmake \. -DCMAKE_INSTALL_PREFIX=#{Regexp.escape @dest_path}%, output
|
||||
assert_match %r%#{Regexp.escape @ext}%, output
|
||||
%r{^cmake \. -DCMAKE_INSTALL_PREFIX=#{Regexp.escape @dest_path}}, output
|
||||
assert_match %r{#{Regexp.escape @ext}}, output
|
||||
assert_contains_make_command '', output
|
||||
assert_contains_make_command 'install', output
|
||||
assert_match %r%test\.txt%, output
|
||||
assert_match %r{test\.txt}, output
|
||||
end
|
||||
|
||||
def test_self_build_fail
|
||||
|
@ -66,8 +66,8 @@ install (FILES test.txt DESTINATION bin)
|
|||
|
||||
assert_match 'cmake failed', error.message
|
||||
|
||||
assert_match %r%^#{sh_prefix_cmake}#{Regexp.escape @dest_path}%, output
|
||||
assert_match %r%#{shell_error_msg}%, output
|
||||
assert_match %r{^#{sh_prefix_cmake}#{Regexp.escape @dest_path}}, output
|
||||
assert_match %r{#{shell_error_msg}}, output
|
||||
end
|
||||
|
||||
def test_self_build_has_makefile
|
||||
|
|
|
@ -69,7 +69,7 @@ class TestGemExtConfigureBuilder < Gem::TestCase
|
|||
|
||||
assert_match(/^current directory:/, output.shift)
|
||||
assert_equal "#{sh_prefix_configure}#{@dest_path}", output.shift
|
||||
assert_match %r(#{shell_error_msg}), output.shift
|
||||
assert_match %r{#{shell_error_msg}}, output.shift
|
||||
assert_equal true, output.empty?
|
||||
end
|
||||
|
||||
|
|
|
@ -25,9 +25,9 @@ class TestGemExtRakeBuilder < Gem::TestCase
|
|||
|
||||
output = output.join "\n"
|
||||
|
||||
refute_match %r%^rake failed:%, output
|
||||
assert_match %r%^#{Regexp.escape @@ruby} mkrf_conf\.rb%, output
|
||||
assert_match %r%^#{Regexp.escape rake} RUBYARCHDIR\\=#{Regexp.escape @dest_path} RUBYLIBDIR\\=#{Regexp.escape @dest_path}%, output
|
||||
refute_match %r{^rake failed:}, output
|
||||
assert_match %r{^#{Regexp.escape @@ruby} mkrf_conf\.rb}, output
|
||||
assert_match %r{^#{Regexp.escape rake} RUBYARCHDIR\\=#{Regexp.escape @dest_path} RUBYLIBDIR\\=#{Regexp.escape @dest_path}}, output
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -46,9 +46,9 @@ class TestGemExtRakeBuilder < Gem::TestCase
|
|||
|
||||
output = output.join "\n"
|
||||
|
||||
refute_match %r%^rake failed:%, output
|
||||
assert_match %r%^#{Regexp.escape @@ruby} mkrf_conf\.rb%, output
|
||||
assert_match %r%^#{Regexp.escape rake} RUBYARCHDIR\\=#{Regexp.escape @dest_path} RUBYLIBDIR\\=#{Regexp.escape @dest_path}%, output
|
||||
refute_match %r{^rake failed:}, output
|
||||
assert_match %r{^#{Regexp.escape @@ruby} mkrf_conf\.rb}, output
|
||||
assert_match %r{^#{Regexp.escape rake} RUBYARCHDIR\\=#{Regexp.escape @dest_path} RUBYLIBDIR\\=#{Regexp.escape @dest_path}}, output
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -62,8 +62,8 @@ class TestGemExtRakeBuilder < Gem::TestCase
|
|||
|
||||
output = output.join "\n"
|
||||
|
||||
refute_match %r%^rake failed:%, output
|
||||
assert_match %r%^#{Regexp.escape rake} RUBYARCHDIR\\=#{Regexp.escape @dest_path} RUBYLIBDIR\\=#{Regexp.escape @dest_path} test1 test2%, output
|
||||
refute_match %r{^rake failed:}, output
|
||||
assert_match %r{^#{Regexp.escape rake} RUBYARCHDIR\\=#{Regexp.escape @dest_path} RUBYLIBDIR\\=#{Regexp.escape @dest_path} test1 test2}, output
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -78,7 +78,7 @@ class TestGemExtRakeBuilder < Gem::TestCase
|
|||
end
|
||||
end
|
||||
|
||||
assert_match %r%^rake failed%, error.message
|
||||
assert_match %r{^rake failed}, error.message
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -189,15 +189,15 @@ class TestGemIndexer < Gem::TestCase
|
|||
@indexer.generate_index
|
||||
end
|
||||
|
||||
assert_match %r%^\.\.\.\.\.\.\.\.\.\.\.\.$%, @ui.output
|
||||
assert_match %r%^Generating Marshal quick index gemspecs for 12 gems$%,
|
||||
assert_match %r{^\.\.\.\.\.\.\.\.\.\.\.\.$}, @ui.output
|
||||
assert_match %r{^Generating Marshal quick index gemspecs for 12 gems$},
|
||||
@ui.output
|
||||
assert_match %r%^Complete$%, @ui.output
|
||||
assert_match %r%^Generating specs index$%, @ui.output
|
||||
assert_match %r%^Generating latest specs index$%, @ui.output
|
||||
assert_match %r%^Generating prerelease specs index$%, @ui.output
|
||||
assert_match %r%^Complete$%, @ui.output
|
||||
assert_match %r%^Compressing indices$%, @ui.output
|
||||
assert_match %r{^Complete$}, @ui.output
|
||||
assert_match %r{^Generating specs index$}, @ui.output
|
||||
assert_match %r{^Generating latest specs index$}, @ui.output
|
||||
assert_match %r{^Generating prerelease specs index$}, @ui.output
|
||||
assert_match %r{^Complete$}, @ui.output
|
||||
assert_match %r{^Compressing indices$}, @ui.output
|
||||
|
||||
assert_equal '', @ui.error
|
||||
end
|
||||
|
|
|
@ -98,7 +98,7 @@ end
|
|||
assert_path_exists installed_exec
|
||||
|
||||
wrapper = File.read installed_exec
|
||||
assert_match %r|generated by RubyGems|, wrapper
|
||||
assert_match %r{generated by RubyGems}, wrapper
|
||||
end
|
||||
|
||||
def test_check_executable_overwrite_default_bin_dir
|
||||
|
@ -114,7 +114,7 @@ end
|
|||
end
|
||||
|
||||
conflicted = File.join @gemhome, 'bin', 'executable'
|
||||
assert_match %r%\A"executable" from a conflicts with (?:#{Regexp.quote(conflicted)}|installed executable from conflict)\z%,
|
||||
assert_match %r{\A"executable" from a conflicts with (?:#{Regexp.quote(conflicted)}|installed executable from conflict)\z},
|
||||
e.message
|
||||
end
|
||||
end
|
||||
|
@ -156,7 +156,7 @@ gem 'other', version
|
|||
assert_path_exists installed_exec
|
||||
|
||||
wrapper = File.read installed_exec
|
||||
assert_match %r|generated by RubyGems|, wrapper
|
||||
assert_match %r{generated by RubyGems}, wrapper
|
||||
ensure
|
||||
Gem::Installer.exec_format = nil
|
||||
end
|
||||
|
@ -191,7 +191,7 @@ gem 'other', version
|
|||
assert_path_exists installed_exec
|
||||
|
||||
wrapper = File.read installed_exec
|
||||
assert_match %r|generated by RubyGems|, wrapper
|
||||
assert_match %r{generated by RubyGems}, wrapper
|
||||
end
|
||||
|
||||
def test_check_executable_overwrite_other_non_gem
|
||||
|
@ -206,7 +206,7 @@ gem 'other', version
|
|||
assert_path_exists installed_exec
|
||||
|
||||
wrapper = File.read installed_exec
|
||||
assert_match %r|generated by RubyGems|, wrapper
|
||||
assert_match %r{generated by RubyGems}, wrapper
|
||||
end unless Gem.win_platform?
|
||||
|
||||
def test_check_that_user_bin_dir_is_in_path
|
||||
|
@ -342,7 +342,7 @@ gem 'other', version
|
|||
assert_equal mask, File.stat(installed_exec).mode unless win_platform?
|
||||
|
||||
wrapper = File.read installed_exec
|
||||
assert_match %r|generated by RubyGems|, wrapper
|
||||
assert_match %r{generated by RubyGems}, wrapper
|
||||
end
|
||||
|
||||
def test_generate_bin_bindir_with_user_install_warning
|
||||
|
@ -385,7 +385,7 @@ gem 'other', version
|
|||
assert_equal mask, File.stat(installed_exec).mode unless win_platform?
|
||||
|
||||
wrapper = File.read installed_exec
|
||||
assert_match %r|generated by RubyGems|, wrapper
|
||||
assert_match %r{generated by RubyGems}, wrapper
|
||||
end
|
||||
|
||||
def test_generate_bin_script_format
|
||||
|
@ -444,7 +444,7 @@ gem 'other', version
|
|||
assert_equal mask, File.stat(installed_exec).mode unless win_platform?
|
||||
|
||||
wrapper = File.read installed_exec
|
||||
assert_match %r|generated by RubyGems|, wrapper
|
||||
assert_match %r{generated by RubyGems}, wrapper
|
||||
end
|
||||
|
||||
def test_generate_bin_script_no_execs
|
||||
|
@ -501,7 +501,7 @@ gem 'other', version
|
|||
assert_equal mask, File.stat(installed_exec).mode unless win_platform?
|
||||
|
||||
wrapper = File.read installed_exec
|
||||
assert_match %r|generated by RubyGems|, wrapper
|
||||
assert_match %r{generated by RubyGems}, wrapper
|
||||
# HACK some gems don't have #! in their executables, restore 2008/06
|
||||
#assert_no_match %r|generated by RubyGems|, wrapper
|
||||
end
|
||||
|
@ -527,9 +527,9 @@ gem 'other', version
|
|||
assert_path_exists installed_exec
|
||||
assert_equal mask, File.stat(installed_exec).mode unless win_platform?
|
||||
|
||||
assert_match %r|generated by RubyGems|, File.read(installed_exec)
|
||||
assert_match %r{generated by RubyGems}, File.read(installed_exec)
|
||||
|
||||
refute_match %r|generated by RubyGems|, File.read(real_exec),
|
||||
refute_match %r{generated by RubyGems}, File.read(real_exec),
|
||||
'real executable overwritten'
|
||||
end
|
||||
|
||||
|
@ -1251,7 +1251,7 @@ gem 'other', version
|
|||
installer.install
|
||||
end
|
||||
|
||||
assert_match %r|I am a shiny gem!|, @ui.output
|
||||
assert_match %r{I am a shiny gem!}, @ui.output
|
||||
end
|
||||
|
||||
def test_install_with_skipped_message
|
||||
|
@ -1265,7 +1265,7 @@ gem 'other', version
|
|||
installer.install
|
||||
end
|
||||
|
||||
refute_match %r|I am a shiny gem!|, @ui.output
|
||||
refute_match %r{I am a shiny gem!}, @ui.output
|
||||
end
|
||||
|
||||
def test_install_extension_dir
|
||||
|
@ -1469,7 +1469,7 @@ gem 'other', version
|
|||
end
|
||||
|
||||
# empty depend file for no auto dependencies
|
||||
@spec.files += %W"depend #{@spec.name}.c".each do |file|
|
||||
@spec.files += %W[depend #{@spec.name}.c].each do |file|
|
||||
write_file File.join(@tempdir, file)
|
||||
end
|
||||
|
||||
|
@ -1909,7 +1909,7 @@ gem 'other', version
|
|||
if win_platform?
|
||||
""
|
||||
else
|
||||
%w(/usr/bin/env /bin/env).find {|f| File.executable?(f) }
|
||||
%w[/usr/bin/env /bin/env].find {|f| File.executable?(f) }
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -2057,7 +2057,7 @@ gem 'other', version
|
|||
def test_dir
|
||||
installer = setup_base_installer
|
||||
|
||||
assert_match %r!/gemhome/gems/a-2$!, installer.dir
|
||||
assert_match %r{/gemhome/gems/a-2$}, installer.dir
|
||||
end
|
||||
|
||||
def test_default_gem_loaded_from
|
||||
|
@ -2097,7 +2097,7 @@ gem 'other', version
|
|||
assert_path_exists installed_exec
|
||||
|
||||
wrapper = File.read installed_exec
|
||||
refute_match %r|generated by RubyGems|, wrapper
|
||||
refute_match %r{generated by RubyGems}, wrapper
|
||||
end
|
||||
|
||||
def test_default_gem_with_wrappers
|
||||
|
@ -2117,7 +2117,7 @@ gem 'other', version
|
|||
assert_path_exists installed_exec
|
||||
|
||||
wrapper = File.read installed_exec
|
||||
assert_match %r|generated by RubyGems|, wrapper
|
||||
assert_match %r{generated by RubyGems}, wrapper
|
||||
end
|
||||
|
||||
def test_default_gem_with_exe_as_bindir
|
||||
|
|
|
@ -929,8 +929,8 @@ class TestGemPackage < Gem::Package::TarTestCase
|
|||
package.verify
|
||||
end
|
||||
|
||||
assert_match %r%^No such file or directory%, e.message
|
||||
assert_match %r%nonexistent.gem$%, e.message
|
||||
assert_match %r{^No such file or directory}, e.message
|
||||
assert_match %r{nonexistent.gem$}, e.message
|
||||
end
|
||||
|
||||
def test_verify_duplicate_file
|
||||
|
|
|
@ -499,7 +499,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
|
|||
fetcher.fetch_path url
|
||||
end
|
||||
|
||||
assert_match %r|ECONNREFUSED:.*connect\(2\) \(#{Regexp.escape url}\)\z|,
|
||||
assert_match %r{ECONNREFUSED:.*connect\(2\) \(#{Regexp.escape url}\)\z},
|
||||
e.message
|
||||
assert_equal url, e.uri
|
||||
end
|
||||
|
|
|
@ -251,11 +251,11 @@ class TestGemRequest < Gem::TestCase
|
|||
def test_user_agent
|
||||
ua = make_request(@uri, nil, nil, nil).user_agent
|
||||
|
||||
assert_match %r%^RubyGems/\S+ \S+ Ruby/\S+ \(.*?\)%, ua
|
||||
assert_match %r%RubyGems/#{Regexp.escape Gem::VERSION}%, ua
|
||||
assert_match %r% #{Regexp.escape Gem::Platform.local.to_s} %, ua
|
||||
assert_match %r%Ruby/#{Regexp.escape RUBY_VERSION}%, ua
|
||||
assert_match %r%\(#{Regexp.escape RUBY_RELEASE_DATE} %, ua
|
||||
assert_match %r{^RubyGems/\S+ \S+ Ruby/\S+ \(.*?\)}, ua
|
||||
assert_match %r{RubyGems/#{Regexp.escape Gem::VERSION}}, ua
|
||||
assert_match %r{ #{Regexp.escape Gem::Platform.local.to_s} }, ua
|
||||
assert_match %r{Ruby/#{Regexp.escape RUBY_VERSION}}, ua
|
||||
assert_match %r{\(#{Regexp.escape RUBY_RELEASE_DATE} }, ua
|
||||
end
|
||||
|
||||
def test_user_agent_engine
|
||||
|
@ -266,7 +266,7 @@ class TestGemRequest < Gem::TestCase
|
|||
|
||||
ua = make_request(@uri, nil, nil, nil).user_agent
|
||||
|
||||
assert_match %r%\) vroom%, ua
|
||||
assert_match %r{\) vroom}, ua
|
||||
ensure
|
||||
util_restore_version
|
||||
end
|
||||
|
@ -279,7 +279,7 @@ class TestGemRequest < Gem::TestCase
|
|||
|
||||
ua = make_request(@uri, nil, nil, nil).user_agent
|
||||
|
||||
assert_match %r%\)%, ua
|
||||
assert_match %r{\)}, ua
|
||||
ensure
|
||||
util_restore_version
|
||||
end
|
||||
|
@ -292,7 +292,7 @@ class TestGemRequest < Gem::TestCase
|
|||
|
||||
ua = make_request(@uri, nil, nil, nil).user_agent
|
||||
|
||||
assert_match %r% patchlevel 5\)%, ua
|
||||
assert_match %r{ patchlevel 5\)}, ua
|
||||
ensure
|
||||
util_restore_version
|
||||
end
|
||||
|
@ -307,8 +307,8 @@ class TestGemRequest < Gem::TestCase
|
|||
|
||||
ua = make_request(@uri, nil, nil, nil).user_agent
|
||||
|
||||
assert_match %r% revision 6\)%, ua
|
||||
assert_match %r%Ruby/#{Regexp.escape RUBY_VERSION}dev%, ua
|
||||
assert_match %r{ revision 6\)}, ua
|
||||
assert_match %r{Ruby/#{Regexp.escape RUBY_VERSION}dev}, ua
|
||||
ensure
|
||||
util_restore_version
|
||||
end
|
||||
|
@ -322,7 +322,7 @@ class TestGemRequest < Gem::TestCase
|
|||
|
||||
ua = make_request(@uri, nil, nil, nil).user_agent
|
||||
|
||||
assert_match %r%\(#{Regexp.escape RUBY_RELEASE_DATE}\)%, ua
|
||||
assert_match %r{\(#{Regexp.escape RUBY_RELEASE_DATE}\)}, ua
|
||||
ensure
|
||||
util_restore_version
|
||||
end
|
||||
|
|
|
@ -493,7 +493,7 @@ ruby "0"
|
|||
rs.resolve StaticSet.new([a, b, c])
|
||||
|
||||
names = rs.sorted_requests.map { |s| s.full_name }
|
||||
assert_equal %w!c-2 b-2 a-2!, names
|
||||
assert_equal %w[c-2 b-2 a-2], names
|
||||
end
|
||||
|
||||
def test_install
|
||||
|
@ -551,7 +551,7 @@ ruby "0"
|
|||
assert_path_exists File.join @tempdir, 'specifications', 'a-1.gemspec'
|
||||
assert_path_exists File.join @tempdir, 'specifications', 'b-1.gemspec'
|
||||
|
||||
assert_equal %w!b-1 a-1!, installed.map { |s| s.full_name }
|
||||
assert_equal %w[b-1 a-1], installed.map { |s| s.full_name }
|
||||
end
|
||||
|
||||
def test_install_into_development_shallow
|
||||
|
|
|
@ -49,7 +49,7 @@ class TestGemRequestSetGemDependencyAPI < Gem::TestCase
|
|||
s.add_runtime_dependency 'bar', '>= 1.6.0', '< 1.6.4'
|
||||
end
|
||||
@gda.gemspec
|
||||
assert_equal %w{ foo bar }.sort, @set.dependencies.map(&:name).sort
|
||||
assert_equal %w[ foo bar ].sort, @set.dependencies.map(&:name).sort
|
||||
bar = @set.dependencies.find { |d| d.name == 'bar' }
|
||||
assert_equal [["<", Gem::Version.create('1.6.4')],
|
||||
[">=", Gem::Version.create('1.6.0')]], bar.requirement.requirements.sort
|
||||
|
|
|
@ -546,7 +546,7 @@ class TestGemResolver < Gem::TestCase
|
|||
|
||||
dependency = e.conflict.dependency
|
||||
|
||||
assert_includes %w(a b), dependency.name
|
||||
assert_includes %w[a b], dependency.name
|
||||
assert_equal req('>= 0'), dependency.requirement
|
||||
|
||||
activated = e.conflict.activated
|
||||
|
|
|
@ -191,7 +191,7 @@ toqvglr0kdbknSRRjBVLK6tsgr07aLT9gNP7mTW2PA==
|
|||
signer.sign 'hello'
|
||||
end
|
||||
|
||||
assert_match %r%certificate /CN=nobody/DC=example not valid%, e.message
|
||||
assert_match %r{certificate /CN=nobody/DC=example not valid}, e.message
|
||||
end
|
||||
|
||||
def test_sign_no_key
|
||||
|
|
|
@ -88,7 +88,7 @@ class TestGemServer < Gem::TestCase
|
|||
end
|
||||
|
||||
assert_equal 200, @res.status, @res.body
|
||||
assert_match %r| \d\d:\d\d:\d\d |, @res['date']
|
||||
assert_match %r{ \d\d:\d\d:\d\d }, @res['date']
|
||||
assert_equal 'application/octet-stream', @res['content-type']
|
||||
assert_equal [['a', Gem::Version.new(2), Gem::Platform::RUBY]],
|
||||
Marshal.load(@res.body)
|
||||
|
@ -127,7 +127,7 @@ class TestGemServer < Gem::TestCase
|
|||
end
|
||||
|
||||
assert_equal 200, @res.status, @res.body
|
||||
assert_match %r| \d\d:\d\d:\d\d |, @res['date']
|
||||
assert_match %r{ \d\d:\d\d:\d\d }, @res['date']
|
||||
assert_equal 'application/x-gzip', @res['content-type']
|
||||
assert_equal [['a', Gem::Version.new(2), Gem::Platform::RUBY]],
|
||||
Marshal.load(Gem::Util.gunzip(@res.body))
|
||||
|
@ -162,7 +162,7 @@ class TestGemServer < Gem::TestCase
|
|||
end
|
||||
|
||||
assert_equal 200, @res.status, @res.body
|
||||
assert_match %r| \d\d:\d\d:\d\d |, @res['date']
|
||||
assert_match %r{ \d\d:\d\d:\d\d }, @res['date']
|
||||
assert_equal 'application/octet-stream', @res['content-type']
|
||||
assert_equal [['a', v('3.a'), Gem::Platform::RUBY]],
|
||||
Marshal.load(@res.body)
|
||||
|
@ -177,7 +177,7 @@ class TestGemServer < Gem::TestCase
|
|||
end
|
||||
|
||||
assert_equal 200, @res.status, @res.body
|
||||
assert_match %r| \d\d:\d\d:\d\d |, @res['date']
|
||||
assert_match %r{ \d\d:\d\d:\d\d }, @res['date']
|
||||
assert_equal 'application/x-gzip', @res['content-type']
|
||||
assert_equal [['a', v('3.a'), Gem::Platform::RUBY]],
|
||||
Marshal.load(Gem::Util.gunzip(@res.body))
|
||||
|
@ -223,7 +223,7 @@ class TestGemServer < Gem::TestCase
|
|||
@server.quick @req, @res
|
||||
|
||||
assert_equal 404, @res.status, @res.body
|
||||
assert_match %r| \d\d:\d\d:\d\d |, @res['date']
|
||||
assert_match %r{ \d\d:\d\d:\d\d }, @res['date']
|
||||
assert_equal 'text/plain', @res['content-type']
|
||||
assert_equal 'No gems found matching "z-9"', @res.body
|
||||
assert_equal 404, @res.status
|
||||
|
@ -320,7 +320,7 @@ class TestGemServer < Gem::TestCase
|
|||
@server.rdoc @req, @res
|
||||
|
||||
assert_equal 200, @res.status, @res.body
|
||||
assert_match %r|No documentation found|, @res.body
|
||||
assert_match %r{No documentation found}, @res.body
|
||||
assert_equal 'text/html', @res['content-type']
|
||||
end
|
||||
|
||||
|
@ -331,7 +331,7 @@ class TestGemServer < Gem::TestCase
|
|||
@server.root @req, @res
|
||||
|
||||
assert_equal 200, @res.status, @res.body
|
||||
assert_match %r| \d\d:\d\d:\d\d |, @res['date']
|
||||
assert_match %r{ \d\d:\d\d:\d\d }, @res['date']
|
||||
assert_equal 'text/html', @res['content-type']
|
||||
end
|
||||
|
||||
|
@ -529,7 +529,7 @@ class TestGemServer < Gem::TestCase
|
|||
@server.specs @req, @res
|
||||
|
||||
assert_equal 200, @res.status, @res.body
|
||||
assert_match %r| \d\d:\d\d:\d\d |, @res['date']
|
||||
assert_match %r{ \d\d:\d\d:\d\d }, @res['date']
|
||||
assert_equal 'application/octet-stream', @res['content-type']
|
||||
|
||||
assert_equal [['a', Gem::Version.new(1), Gem::Platform::RUBY],
|
||||
|
@ -569,7 +569,7 @@ class TestGemServer < Gem::TestCase
|
|||
@server.specs @req, @res
|
||||
|
||||
assert_equal 200, @res.status, @res.body
|
||||
assert_match %r| \d\d:\d\d:\d\d |, @res['date']
|
||||
assert_match %r{ \d\d:\d\d:\d\d }, @res['date']
|
||||
assert_equal 'application/x-gzip', @res['content-type']
|
||||
|
||||
assert_equal [['a', Gem::Version.new(1), Gem::Platform::RUBY],
|
||||
|
@ -591,7 +591,7 @@ class TestGemServer < Gem::TestCase
|
|||
|
||||
@server.root @req, @res
|
||||
|
||||
refute_match %r|%3A%2F%2F|, @res.body
|
||||
refute_match %r{%3A%2F%2F}, @res.body
|
||||
end
|
||||
|
||||
def util_listen
|
||||
|
|
|
@ -140,12 +140,12 @@ end
|
|||
install_specs c1, c2, b1, b2, a1
|
||||
|
||||
a1.activate
|
||||
assert_equal %w(a-1), loaded_spec_names
|
||||
assert_equal %w[a-1], loaded_spec_names
|
||||
assert_equal ["b (> 0)"], unresolved_names
|
||||
|
||||
require "d#{$$}"
|
||||
|
||||
assert_equal %w(a-1 b-2 c-2), loaded_spec_names
|
||||
assert_equal %w[a-1 b-2 c-2], loaded_spec_names
|
||||
assert_equal [], unresolved_names
|
||||
end
|
||||
end
|
||||
|
@ -187,12 +187,12 @@ end
|
|||
install_specs c1, c2, b1, b2, a1
|
||||
|
||||
a1.activate
|
||||
assert_equal %w(a-1), loaded_spec_names
|
||||
assert_equal %w[a-1], loaded_spec_names
|
||||
assert_equal ["b (> 0)"], unresolved_names
|
||||
|
||||
require "d#{$$}"
|
||||
|
||||
assert_equal %w(a-1 b-2 c-2), loaded_spec_names
|
||||
assert_equal %w[a-1 b-2 c-2], loaded_spec_names
|
||||
assert_equal [], unresolved_names
|
||||
end
|
||||
end
|
||||
|
@ -209,12 +209,12 @@ end
|
|||
install_specs c1, b1, a1, a2, c2, b2
|
||||
|
||||
a2.activate
|
||||
assert_equal %w(a-2), loaded_spec_names
|
||||
assert_equal %w[a-2], loaded_spec_names
|
||||
assert_equal ["b (> 0)"], unresolved_names
|
||||
|
||||
require "d#{$$}"
|
||||
|
||||
assert_equal %w(a-2 b-1 c-1), loaded_spec_names
|
||||
assert_equal %w[a-2 b-1 c-1], loaded_spec_names
|
||||
assert_equal [], unresolved_names
|
||||
end
|
||||
end
|
||||
|
@ -231,12 +231,12 @@ end
|
|||
install_specs d1, c1, c2, b1, b2, a1
|
||||
|
||||
a1.activate
|
||||
assert_equal %w(a-1), loaded_spec_names
|
||||
assert_equal %w[a-1], loaded_spec_names
|
||||
assert_equal ["b (> 0)"], unresolved_names
|
||||
|
||||
require "d#{$$}"
|
||||
|
||||
assert_equal %w(a-1 d-1), loaded_spec_names
|
||||
assert_equal %w[a-1 d-1], loaded_spec_names
|
||||
assert_equal ["b (> 0)"], unresolved_names
|
||||
end
|
||||
end
|
||||
|
@ -255,7 +255,7 @@ end
|
|||
|
||||
require "c#{$$}"
|
||||
|
||||
assert_equal %w(a-1 b-2 c-2), loaded_spec_names
|
||||
assert_equal %w[a-1 b-2 c-2], loaded_spec_names
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -275,7 +275,7 @@ end
|
|||
|
||||
require "d#{$$}"
|
||||
|
||||
assert_equal %w(a-1 b-2 c-2 d-2), loaded_spec_names
|
||||
assert_equal %w[a-1 b-2 c-2 d-2], loaded_spec_names
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -296,7 +296,7 @@ end
|
|||
|
||||
require "d#{$$}"
|
||||
|
||||
assert_equal %w(a-1 b-2 c-2 d-2), loaded_spec_names
|
||||
assert_equal %w[a-1 b-2 c-2 d-2], loaded_spec_names
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -318,7 +318,7 @@ end
|
|||
|
||||
require "d#{$$}"
|
||||
|
||||
assert_equal %w(a-1 b-2 c-2 d-2), loaded_spec_names
|
||||
assert_equal %w[a-1 b-2 c-2 d-2], loaded_spec_names
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -336,12 +336,12 @@ end
|
|||
install_specs c1, c2, c3, b1, b2, a1, a2, base
|
||||
|
||||
base.activate
|
||||
assert_equal %w(0-1), loaded_spec_names
|
||||
assert_equal %w[0-1], loaded_spec_names
|
||||
assert_equal ["A (>= 1)"], unresolved_names
|
||||
|
||||
require "d#{$$}"
|
||||
|
||||
assert_equal %w(0-1 A-2 b-2 c-2), loaded_spec_names
|
||||
assert_equal %w[0-1 A-2 b-2 c-2], loaded_spec_names
|
||||
assert_equal [], unresolved_names
|
||||
end
|
||||
end
|
||||
|
@ -364,7 +364,7 @@ end
|
|||
|
||||
require "d#{$$}"
|
||||
|
||||
assert_includes [%w(a-1 b-2 c-3 d-2),%w(a-1 b-2 d-2)], loaded_spec_names
|
||||
assert_includes [%w[a-1 b-2 c-3 d-2],%w[a-1 b-2 d-2]], loaded_spec_names
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -386,7 +386,7 @@ end
|
|||
|
||||
require "d#{$$}"
|
||||
|
||||
assert_includes [%w(a-1 b-2 d-2 xc-3), %w(a-1 b-2 d-2)], loaded_spec_names
|
||||
assert_includes [%w[a-1 b-2 d-2 xc-3], %w[a-1 b-2 d-2]], loaded_spec_names
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -515,7 +515,7 @@ end
|
|||
require "b/c"
|
||||
end
|
||||
|
||||
assert_equal %w(a-1 b-1), loaded_spec_names
|
||||
assert_equal %w[a-1 b-1], loaded_spec_names
|
||||
end
|
||||
|
||||
def test_self_activate_via_require_wtf
|
||||
|
@ -532,7 +532,7 @@ end
|
|||
|
||||
a1.activate
|
||||
|
||||
assert_equal %w(a-1), loaded_spec_names
|
||||
assert_equal %w[a-1], loaded_spec_names
|
||||
assert_equal ["b (> 0)", "d (> 0)"], unresolved_names
|
||||
|
||||
require "b#{$$}"
|
||||
|
@ -543,7 +543,7 @@ end
|
|||
|
||||
assert_equal "unable to find a version of 'd' to activate", e.message
|
||||
|
||||
assert_equal %w(a-1 b-2 c-2), loaded_spec_names
|
||||
assert_equal %w[a-1 b-2 c-2], loaded_spec_names
|
||||
assert_equal ["d (> 0)"], unresolved_names
|
||||
end
|
||||
end
|
||||
|
@ -558,7 +558,7 @@ end
|
|||
install_specs c1, c2, b1, b2, a1
|
||||
|
||||
a1.activate
|
||||
assert_equal %w(a-1 b-1 c-1), loaded_spec_names
|
||||
assert_equal %w[a-1 b-1 c-1], loaded_spec_names
|
||||
end
|
||||
|
||||
def test_self_activate_loaded
|
||||
|
@ -795,7 +795,7 @@ bindir:
|
|||
op = spec.dependencies.first.requirement.requirements.first.first
|
||||
refute_kind_of YAML::Syck::DefaultKey, op
|
||||
|
||||
refute_match %r%DefaultKey%, spec.to_ruby
|
||||
refute_match %r{DefaultKey}, spec.to_ruby
|
||||
end
|
||||
|
||||
def test_self_from_yaml_cleans_up_defaultkey
|
||||
|
@ -829,7 +829,7 @@ bindir:
|
|||
op = spec.dependencies.first.requirement.requirements.first.first
|
||||
refute_kind_of YAML::Syck::DefaultKey, op
|
||||
|
||||
refute_match %r%DefaultKey%, spec.to_ruby
|
||||
refute_match %r{DefaultKey}, spec.to_ruby
|
||||
end
|
||||
|
||||
def test_self_from_yaml_cleans_up_defaultkey_from_newer_192
|
||||
|
@ -863,7 +863,7 @@ bindir:
|
|||
op = spec.dependencies.first.requirement.requirements.first.first
|
||||
refute_kind_of YAML::Syck::DefaultKey, op
|
||||
|
||||
refute_match %r%DefaultKey%, spec.to_ruby
|
||||
refute_match %r{DefaultKey}, spec.to_ruby
|
||||
end
|
||||
|
||||
def test_self_from_yaml_cleans_up_Date_objects
|
||||
|
@ -1886,11 +1886,11 @@ dependencies: []
|
|||
end
|
||||
|
||||
def test_files
|
||||
@a1.files = %w(files bin/common)
|
||||
@a1.test_files = %w(test_files bin/common)
|
||||
@a1.executables = %w(executables common)
|
||||
@a1.extra_rdoc_files = %w(extra_rdoc_files bin/common)
|
||||
@a1.extensions = %w(extensions bin/common)
|
||||
@a1.files = %w[files bin/common]
|
||||
@a1.test_files = %w[test_files bin/common]
|
||||
@a1.executables = %w[executables common]
|
||||
@a1.extra_rdoc_files = %w[extra_rdoc_files bin/common]
|
||||
@a1.extensions = %w[extensions bin/common]
|
||||
|
||||
expected = %w[
|
||||
bin/common
|
||||
|
@ -1904,11 +1904,11 @@ dependencies: []
|
|||
end
|
||||
|
||||
def test_files_append
|
||||
@a1.files = %w(files bin/common)
|
||||
@a1.test_files = %w(test_files bin/common)
|
||||
@a1.executables = %w(executables common)
|
||||
@a1.extra_rdoc_files = %w(extra_rdoc_files bin/common)
|
||||
@a1.extensions = %w(extensions bin/common)
|
||||
@a1.files = %w[files bin/common]
|
||||
@a1.test_files = %w[test_files bin/common]
|
||||
@a1.executables = %w[executables common]
|
||||
@a1.extra_rdoc_files = %w[extra_rdoc_files bin/common]
|
||||
@a1.extensions = %w[extensions bin/common]
|
||||
|
||||
expected = %w[
|
||||
bin/common
|
||||
|
@ -2297,12 +2297,12 @@ dependencies: []
|
|||
install_specs a1 # , a2, b1, b2, c1, c2
|
||||
|
||||
a1.activate
|
||||
assert_equal %w(a-1), loaded_spec_names
|
||||
assert_equal %w[a-1], loaded_spec_names
|
||||
assert_equal [], unresolved_names
|
||||
|
||||
assert require "d#{$$}"
|
||||
|
||||
assert_equal %w(a-1), loaded_spec_names
|
||||
assert_equal %w[a-1], loaded_spec_names
|
||||
assert_equal [], unresolved_names
|
||||
end
|
||||
end
|
||||
|
@ -2320,12 +2320,12 @@ dependencies: []
|
|||
|
||||
a1.activate
|
||||
c1.activate
|
||||
assert_equal %w(a-1 c-1), loaded_spec_names
|
||||
assert_equal %w[a-1 c-1], loaded_spec_names
|
||||
assert_equal ["b (> 0)"], unresolved_names
|
||||
|
||||
assert require "d#{$$}"
|
||||
|
||||
assert_equal %w(a-1 c-1), loaded_spec_names
|
||||
assert_equal %w[a-1 c-1], loaded_spec_names
|
||||
assert_equal ["b (> 0)"], unresolved_names
|
||||
end
|
||||
end
|
||||
|
@ -2661,7 +2661,7 @@ end
|
|||
def test_to_yaml_platform_empty_string
|
||||
@a1.instance_variable_set :@original_platform, ''
|
||||
|
||||
assert_match %r|^platform: ruby$|, @a1.to_yaml
|
||||
assert_match %r{^platform: ruby$}, @a1.to_yaml
|
||||
end
|
||||
|
||||
def test_to_yaml_platform_legacy
|
||||
|
@ -2679,7 +2679,7 @@ end
|
|||
def test_to_yaml_platform_nil
|
||||
@a1.instance_variable_set :@original_platform, nil
|
||||
|
||||
assert_match %r|^platform: ruby$|, @a1.to_yaml
|
||||
assert_match %r{^platform: ruby$}, @a1.to_yaml
|
||||
end
|
||||
|
||||
def test_validate
|
||||
|
@ -2723,7 +2723,7 @@ end
|
|||
@a1.validate
|
||||
end
|
||||
|
||||
assert_equal %{"#{f}" or "#{t}" is not an author}, e.message
|
||||
assert_equal %("#{f}" or "#{t}" is not an author), e.message
|
||||
|
||||
@a1.authors = ["#{t} (who is writing this software)"]
|
||||
|
||||
|
@ -2731,7 +2731,7 @@ end
|
|||
@a1.validate
|
||||
end
|
||||
|
||||
assert_equal %{"#{f}" or "#{t}" is not an author}, e.message
|
||||
assert_equal %("#{f}" or "#{t}" is not an author), e.message
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -2883,7 +2883,7 @@ duplicate dependency on c (>= 1.2.3, development), (~> 1.2) use:
|
|||
@a1.validate
|
||||
end
|
||||
|
||||
assert_equal %{"#{f}" or "#{t}" is not a description}, e.message
|
||||
assert_equal %("#{f}" or "#{t}" is not a description), e.message
|
||||
|
||||
@a1.description = "#{t} (describe your package)"
|
||||
|
||||
|
@ -2891,7 +2891,7 @@ duplicate dependency on c (>= 1.2.3, development), (~> 1.2) use:
|
|||
@a1.validate
|
||||
end
|
||||
|
||||
assert_equal %{"#{f}" or "#{t}" is not a description}, e.message
|
||||
assert_equal %("#{f}" or "#{t}" is not a description), e.message
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -2905,7 +2905,7 @@ duplicate dependency on c (>= 1.2.3, development), (~> 1.2) use:
|
|||
@a1.validate
|
||||
end
|
||||
|
||||
assert_equal %{"#{f}" or "#{t}" is not an email}, e.message
|
||||
assert_equal %("#{f}" or "#{t}" is not an email), e.message
|
||||
|
||||
@a1.email = "#{t} (your e-mail)"
|
||||
|
||||
|
@ -2913,7 +2913,7 @@ duplicate dependency on c (>= 1.2.3, development), (~> 1.2) use:
|
|||
@a1.validate
|
||||
end
|
||||
|
||||
assert_equal %{"#{f}" or "#{t}" is not an email}, e.message
|
||||
assert_equal %("#{f}" or "#{t}" is not an email), e.message
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -3315,7 +3315,7 @@ Did you mean 'Ruby'?
|
|||
spec.validate
|
||||
end
|
||||
|
||||
assert_match %r%^#{name}%, e.message
|
||||
assert_match %r{^#{name}}, e.message
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -3415,7 +3415,7 @@ Did you mean 'Ruby'?
|
|||
@a1.validate
|
||||
end
|
||||
|
||||
assert_equal %{"#{f}" or "#{t}" is not a summary}, e.message
|
||||
assert_equal %("#{f}" or "#{t}" is not a summary), e.message
|
||||
|
||||
@a1.summary = "#{t} (describe your package)"
|
||||
|
||||
|
@ -3423,7 +3423,7 @@ Did you mean 'Ruby'?
|
|||
@a1.validate
|
||||
end
|
||||
|
||||
assert_equal %{"#{f}" or "#{t}" is not a summary}, e.message
|
||||
assert_equal %("#{f}" or "#{t}" is not a summary), e.message
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ class TestGemUninstaller < Gem::InstallerTestCase
|
|||
FileUtils.mkdir_p 'foo/bar'
|
||||
uninstaller = Gem::Uninstaller.new nil, :install_dir => 'foo//bar'
|
||||
|
||||
assert_match %r|foo/bar$|, uninstaller.instance_variable_get(:@gem_home)
|
||||
assert_match %r{foo/bar$}, uninstaller.instance_variable_get(:@gem_home)
|
||||
end
|
||||
|
||||
def test_ask_if_ok
|
||||
|
@ -458,12 +458,12 @@ create_makefile '#{@spec.name}'
|
|||
lines = ui.output.split("\n")
|
||||
lines.shift
|
||||
|
||||
assert_match %r!You have requested to uninstall the gem:!, lines.shift
|
||||
assert_match %r{You have requested to uninstall the gem:}, lines.shift
|
||||
lines.shift
|
||||
lines.shift
|
||||
|
||||
assert_match %r!r-1 depends on q \(= 1\)!, lines.shift
|
||||
assert_match %r!Successfully uninstalled q-1!, lines.last
|
||||
assert_match %r{r-1 depends on q \(= 1\)}, lines.shift
|
||||
assert_match %r{Successfully uninstalled q-1}, lines.last
|
||||
end
|
||||
|
||||
def test_uninstall_only_lists_unsatisfied_deps
|
||||
|
@ -488,12 +488,12 @@ create_makefile '#{@spec.name}'
|
|||
lines = ui.output.split("\n")
|
||||
lines.shift
|
||||
|
||||
assert_match %r!You have requested to uninstall the gem:!, lines.shift
|
||||
assert_match %r{You have requested to uninstall the gem:}, lines.shift
|
||||
lines.shift
|
||||
lines.shift
|
||||
|
||||
assert_match %r!x-1 depends on q \(= 1.0\)!, lines.shift
|
||||
assert_match %r!Successfully uninstalled q-1.0!, lines.last
|
||||
assert_match %r{x-1 depends on q \(= 1.0\)}, lines.shift
|
||||
assert_match %r{Successfully uninstalled q-1.0}, lines.last
|
||||
end
|
||||
|
||||
def test_uninstall_doesnt_prompt_when_other_gem_satisfies_requirement
|
||||
|
@ -569,12 +569,12 @@ create_makefile '#{@spec.name}'
|
|||
lines = ui.output.split("\n")
|
||||
lines.shift
|
||||
|
||||
assert_match %r!You have requested to uninstall the gem:!, lines.shift
|
||||
assert_match %r{You have requested to uninstall the gem:}, lines.shift
|
||||
lines.shift
|
||||
lines.shift
|
||||
|
||||
assert_match %r!r-1 depends on q \(= 1, development\)!, lines.shift
|
||||
assert_match %r!Successfully uninstalled q-1!, lines.last
|
||||
assert_match %r{r-1 depends on q \(= 1, development\)}, lines.shift
|
||||
assert_match %r{Successfully uninstalled q-1}, lines.last
|
||||
end
|
||||
|
||||
def test_uninstall_prompt_only_lists_the_dependents_that_prevented_uninstallation
|
||||
|
@ -598,12 +598,12 @@ create_makefile '#{@spec.name}'
|
|||
lines = ui.output.split("\n")
|
||||
lines.shift
|
||||
|
||||
assert_match %r!You have requested to uninstall the gem:!, lines.shift
|
||||
assert_match %r{You have requested to uninstall the gem:}, lines.shift
|
||||
lines.shift
|
||||
lines.shift
|
||||
|
||||
assert_match %r!s-1 depends on q \(= 1\)!, lines.shift
|
||||
assert_match %r!Successfully uninstalled q-1!, lines.last
|
||||
assert_match %r{s-1 depends on q \(= 1\)}, lines.shift
|
||||
assert_match %r{Successfully uninstalled q-1}, lines.last
|
||||
end
|
||||
|
||||
def test_uninstall_no_permission
|
||||
|
|
|
@ -70,7 +70,7 @@ class TestGemRequire < Gem::TestCase
|
|||
assert_require 'test_gem_require_a'
|
||||
assert_require 'b/c' # this should be required from -I
|
||||
assert_equal "world", ::Object::HELLO
|
||||
assert_equal %w(a-1 b-1), loaded_spec_names
|
||||
assert_equal %w[a-1 b-1], loaded_spec_names
|
||||
ensure
|
||||
$LOAD_PATH.replace lp
|
||||
Object.send :remove_const, :HELLO if Object.const_defined? :HELLO
|
||||
|
@ -114,7 +114,7 @@ class TestGemRequire < Gem::TestCase
|
|||
assert_require 'b/c'
|
||||
assert_require 'c/c' # this should be required from -I
|
||||
assert_equal "world", ::Object::HELLO
|
||||
assert_equal %w(a-1 b-1), loaded_spec_names
|
||||
assert_equal %w[a-1 b-1], loaded_spec_names
|
||||
ensure
|
||||
$LOAD_PATH.replace lp
|
||||
Object.send :remove_const, :HELLO if Object.const_defined? :HELLO
|
||||
|
@ -171,11 +171,11 @@ class TestGemRequire < Gem::TestCase
|
|||
install_specs b1, b2, a1
|
||||
|
||||
assert_require 'test_gem_require_a'
|
||||
assert_equal %w(a-1 b-1), loaded_spec_names
|
||||
assert_equal %w[a-1 b-1], loaded_spec_names
|
||||
assert_equal unresolved_names, []
|
||||
|
||||
assert_require "b/c"
|
||||
assert_equal %w(a-1 b-1), loaded_spec_names
|
||||
assert_equal %w[a-1 b-1], loaded_spec_names
|
||||
end
|
||||
|
||||
def test_require_is_lazy_with_inexact_req
|
||||
|
@ -186,11 +186,11 @@ class TestGemRequire < Gem::TestCase
|
|||
install_specs b1, b2, a1
|
||||
|
||||
assert_require 'test_gem_require_a'
|
||||
assert_equal %w(a-1), loaded_spec_names
|
||||
assert_equal %w[a-1], loaded_spec_names
|
||||
assert_equal unresolved_names, ["b (>= 1)"]
|
||||
|
||||
assert_require "b/c"
|
||||
assert_equal %w(a-1 b-2), loaded_spec_names
|
||||
assert_equal %w[a-1 b-2], loaded_spec_names
|
||||
end
|
||||
|
||||
def test_require_is_not_lazy_with_one_possible
|
||||
|
@ -200,11 +200,11 @@ class TestGemRequire < Gem::TestCase
|
|||
install_specs b1, a1
|
||||
|
||||
assert_require 'test_gem_require_a'
|
||||
assert_equal %w(a-1 b-1), loaded_spec_names
|
||||
assert_equal %w[a-1 b-1], loaded_spec_names
|
||||
assert_equal unresolved_names, []
|
||||
|
||||
assert_require "b/c"
|
||||
assert_equal %w(a-1 b-1), loaded_spec_names
|
||||
assert_equal %w[a-1 b-1], loaded_spec_names
|
||||
end
|
||||
|
||||
def test_require_can_use_a_pathname_object
|
||||
|
@ -213,7 +213,7 @@ class TestGemRequire < Gem::TestCase
|
|||
install_specs a1
|
||||
|
||||
assert_require Pathname.new 'test_gem_require_a'
|
||||
assert_equal %w(a-1), loaded_spec_names
|
||||
assert_equal %w[a-1], loaded_spec_names
|
||||
assert_equal unresolved_names, []
|
||||
end
|
||||
|
||||
|
@ -246,7 +246,7 @@ class TestGemRequire < Gem::TestCase
|
|||
# This case is fine because our lazy loading is provided exactly
|
||||
# the same behavior as eager loading would have.
|
||||
|
||||
assert_equal %w(a-1 b-2), loaded_spec_names
|
||||
assert_equal %w[a-1 b-2], loaded_spec_names
|
||||
ensure
|
||||
$LOAD_PATH.replace lp unless java_platform?
|
||||
end
|
||||
|
@ -262,12 +262,12 @@ class TestGemRequire < Gem::TestCase
|
|||
|
||||
a1.activate
|
||||
c1.activate
|
||||
assert_equal %w(a-1 c-1), loaded_spec_names
|
||||
assert_equal %w[a-1 c-1], loaded_spec_names
|
||||
assert_equal ["b (> 0)"], unresolved_names
|
||||
|
||||
assert require("ib")
|
||||
|
||||
assert_equal %w(a-1 b-1 c-1), loaded_spec_names
|
||||
assert_equal %w[a-1 b-1 c-1], loaded_spec_names
|
||||
assert_equal [], unresolved_names
|
||||
end
|
||||
|
||||
|
@ -284,7 +284,7 @@ class TestGemRequire < Gem::TestCase
|
|||
|
||||
a1.activate
|
||||
c1.activate
|
||||
assert_equal %w(a-1 c-1), loaded_spec_names
|
||||
assert_equal %w[a-1 c-1], loaded_spec_names
|
||||
assert_equal ["b (> 0)", "x (> 0)"], unresolved_names
|
||||
|
||||
e = assert_raises(Gem::LoadError) do
|
||||
|
@ -307,7 +307,7 @@ class TestGemRequire < Gem::TestCase
|
|||
|
||||
a1.activate
|
||||
c1.activate
|
||||
assert_equal %w(a-1 c-1), loaded_spec_names
|
||||
assert_equal %w[a-1 c-1], loaded_spec_names
|
||||
assert_equal ["b (> 0)"], unresolved_names
|
||||
|
||||
e = assert_raises(Gem::LoadError) do
|
||||
|
@ -338,9 +338,9 @@ class TestGemRequire < Gem::TestCase
|
|||
|
||||
# Require gems that have not been removed.
|
||||
assert_require 'a/b'
|
||||
assert_equal %w(a-1.0), loaded_spec_names
|
||||
assert_equal %w[a-1.0], loaded_spec_names
|
||||
assert_require 'b/d'
|
||||
assert_equal %w(a-1.0 b-2.0), loaded_spec_names
|
||||
assert_equal %w[a-1.0 b-2.0], loaded_spec_names
|
||||
end
|
||||
|
||||
def test_require_doesnt_traverse_development_dependencies
|
||||
|
@ -352,7 +352,7 @@ class TestGemRequire < Gem::TestCase
|
|||
install_specs a, w1, w2, z
|
||||
|
||||
assert gem("z")
|
||||
assert_equal %w(z-1), loaded_spec_names
|
||||
assert_equal %w[z-1], loaded_spec_names
|
||||
assert_equal ["w (> 0)"], unresolved_names
|
||||
|
||||
assert require("a#{$$}")
|
||||
|
@ -363,7 +363,7 @@ class TestGemRequire < Gem::TestCase
|
|||
nil, "default/gem.rb")
|
||||
install_default_specs(default_gem_spec)
|
||||
assert_require "default/gem"
|
||||
assert_equal %w(default-2.0.0.0), loaded_spec_names
|
||||
assert_equal %w[default-2.0.0.0], loaded_spec_names
|
||||
end
|
||||
|
||||
def test_default_gem_require_activates_just_once
|
||||
|
@ -403,7 +403,7 @@ class TestGemRequire < Gem::TestCase
|
|||
"lib/default/gem.rb")
|
||||
install_specs(normal_gem_spec)
|
||||
assert_require "default/gem"
|
||||
assert_equal %w(default-3.0), loaded_spec_names
|
||||
assert_equal %w[default-3.0], loaded_spec_names
|
||||
end
|
||||
|
||||
def test_default_gem_prerelease
|
||||
|
@ -416,7 +416,7 @@ class TestGemRequire < Gem::TestCase
|
|||
install_default_specs(normal_gem_higher_prerelease_spec)
|
||||
|
||||
assert_require "default/gem"
|
||||
assert_equal %w(default-3.0.0.rc2), loaded_spec_names
|
||||
assert_equal %w[default-3.0.0.rc2], loaded_spec_names
|
||||
end
|
||||
|
||||
def loaded_spec_names
|
||||
|
@ -462,7 +462,7 @@ class TestGemRequire < Gem::TestCase
|
|||
end
|
||||
end
|
||||
assert c.send(:require, "default/gem")
|
||||
assert_equal %w(default-2.0.0.0), loaded_spec_names
|
||||
assert_equal %w[default-2.0.0.0], loaded_spec_names
|
||||
end
|
||||
|
||||
def test_require_default_when_gem_defined
|
||||
|
@ -474,7 +474,7 @@ class TestGemRequire < Gem::TestCase
|
|||
end
|
||||
end
|
||||
assert c.send(:require, "a#{$$}")
|
||||
assert_equal %W(a#{$$}-1), loaded_spec_names
|
||||
assert_equal %W[a#{$$}-1], loaded_spec_names
|
||||
end
|
||||
|
||||
def test_require_bundler
|
||||
|
|
Загрузка…
Ссылка в новой задаче