summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/bundler.rb1
-rw-r--r--lib/bundler/bundler.gemspec5
-rw-r--r--lib/bundler/cli.rb46
-rw-r--r--lib/bundler/cli/outdated.rb17
-rw-r--r--lib/bundler/definition.rb89
-rw-r--r--lib/bundler/feature_flag.rb1
-rw-r--r--lib/bundler/friendly_errors.rb2
-rw-r--r--lib/bundler/index.rb3
-rw-r--r--lib/bundler/man/bundle-add.12
-rw-r--r--lib/bundler/man/bundle-binstubs.12
-rw-r--r--lib/bundler/man/bundle-cache.12
-rw-r--r--lib/bundler/man/bundle-check.12
-rw-r--r--lib/bundler/man/bundle-clean.12
-rw-r--r--lib/bundler/man/bundle-config.18
-rw-r--r--lib/bundler/man/bundle-config.1.ronn8
-rw-r--r--lib/bundler/man/bundle-doctor.12
-rw-r--r--lib/bundler/man/bundle-exec.12
-rw-r--r--lib/bundler/man/bundle-gem.12
-rw-r--r--lib/bundler/man/bundle-info.12
-rw-r--r--lib/bundler/man/bundle-init.12
-rw-r--r--lib/bundler/man/bundle-inject.12
-rw-r--r--lib/bundler/man/bundle-install.12
-rw-r--r--lib/bundler/man/bundle-list.12
-rw-r--r--lib/bundler/man/bundle-lock.12
-rw-r--r--lib/bundler/man/bundle-open.12
-rw-r--r--lib/bundler/man/bundle-outdated.12
-rw-r--r--lib/bundler/man/bundle-platform.12
-rw-r--r--lib/bundler/man/bundle-pristine.12
-rw-r--r--lib/bundler/man/bundle-remove.12
-rw-r--r--lib/bundler/man/bundle-show.12
-rw-r--r--lib/bundler/man/bundle-update.12
-rw-r--r--lib/bundler/man/bundle-viz.12
-rw-r--r--lib/bundler/man/bundle.12
-rw-r--r--lib/bundler/man/gemfile.52
-rw-r--r--lib/bundler/plugin/api/source.rb14
-rw-r--r--lib/bundler/resolver.rb109
-rw-r--r--lib/bundler/resolver/spec_group.rb24
-rw-r--r--lib/bundler/rubygems_ext.rb4
-rw-r--r--lib/bundler/settings.rb1
-rw-r--r--lib/bundler/source.rb9
-rw-r--r--lib/bundler/source/rubygems.rb19
-rw-r--r--lib/bundler/source/rubygems_aggregate.rb64
-rw-r--r--lib/bundler/source_list.rb39
-rw-r--r--lib/bundler/source_map.rb58
-rw-r--r--lib/bundler/templates/newgem/newgem.gemspec.tt2
-rw-r--r--lib/bundler/version.rb2
-rw-r--r--lib/rubygems.rb2
-rw-r--r--lib/rubygems/ext/ext_conf_builder.rb8
-rw-r--r--lib/rubygems/specification.rb2
-rw-r--r--lib/rubygems/test_case.rb120
-rw-r--r--spec/bundler/bundler/definition_spec.rb27
-rw-r--r--spec/bundler/commands/cache_spec.rb10
-rw-r--r--spec/bundler/commands/check_spec.rb4
-rw-r--r--spec/bundler/commands/config_spec.rb4
-rw-r--r--spec/bundler/commands/exec_spec.rb2
-rw-r--r--spec/bundler/commands/install_spec.rb6
-rw-r--r--spec/bundler/commands/lock_spec.rb2
-rw-r--r--spec/bundler/commands/outdated_spec.rb4
-rw-r--r--spec/bundler/commands/post_bundle_message_spec.rb30
-rw-r--r--spec/bundler/commands/update_spec.rb4
-rw-r--r--spec/bundler/install/deploy_spec.rb38
-rw-r--r--spec/bundler/install/gemfile/eval_gemfile_spec.rb2
-rw-r--r--spec/bundler/install/gemfile/gemspec_spec.rb57
-rw-r--r--spec/bundler/install/gemfile/git_spec.rb6
-rw-r--r--spec/bundler/install/gemfile/groups_spec.rb42
-rw-r--r--spec/bundler/install/gemfile/path_spec.rb2
-rw-r--r--spec/bundler/install/gemfile/platform_spec.rb2
-rw-r--r--spec/bundler/install/gemfile/sources_spec.rb884
-rw-r--r--spec/bundler/install/gemfile/specific_platform_spec.rb4
-rw-r--r--spec/bundler/install/gems/compact_index_spec.rb41
-rw-r--r--spec/bundler/install/gems/dependency_api_spec.rb42
-rw-r--r--spec/bundler/install/gems/standalone_spec.rb26
-rw-r--r--spec/bundler/install/git_spec.rb4
-rw-r--r--spec/bundler/install/path_spec.rb22
-rw-r--r--spec/bundler/lock/lockfile_spec.rb4
-rw-r--r--spec/bundler/other/major_deprecation_spec.rb62
-rw-r--r--spec/bundler/plugins/install_spec.rb2
-rw-r--r--spec/bundler/plugins/source/example_spec.rb4
-rw-r--r--spec/bundler/quality_spec.rb2
-rw-r--r--spec/bundler/realworld/double_check_spec.rb4
-rw-r--r--spec/bundler/realworld/edgecases_spec.rb6
-rw-r--r--spec/bundler/runtime/inline_spec.rb10
-rw-r--r--spec/bundler/runtime/load_spec.rb2
-rw-r--r--spec/bundler/runtime/platform_spec.rb2
-rw-r--r--spec/bundler/runtime/require_spec.rb2
-rw-r--r--spec/bundler/runtime/setup_spec.rb49
-rw-r--r--spec/bundler/spec_helper.rb1
-rw-r--r--spec/bundler/support/artifice/endpoint.rb4
-rw-r--r--spec/bundler/support/helpers.rb2
-rw-r--r--spec/bundler/support/indexes.rb3
-rw-r--r--spec/bundler/support/matchers.rb2
-rw-r--r--spec/bundler/support/path.rb7
-rw-r--r--test/rubygems/test_bundled_ca.rb4
-rw-r--r--test/rubygems/test_deprecate.rb6
-rw-r--r--test/rubygems/test_gem.rb64
-rw-r--r--test/rubygems/test_gem_bundler_version_finder.rb4
-rw-r--r--test/rubygems/test_gem_command.rb2
-rw-r--r--test/rubygems/test_gem_command_manager.rb10
-rw-r--r--test/rubygems/test_gem_commands_build_command.rb20
-rw-r--r--test/rubygems/test_gem_commands_cert_command.rb72
-rw-r--r--test/rubygems/test_gem_commands_check_command.rb10
-rw-r--r--test/rubygems/test_gem_commands_cleanup_command.rb48
-rw-r--r--test/rubygems/test_gem_commands_contents_command.rb6
-rw-r--r--test/rubygems/test_gem_commands_dependency_command.rb4
-rw-r--r--test/rubygems/test_gem_commands_environment_command.rb2
-rw-r--r--test/rubygems/test_gem_commands_fetch_command.rb18
-rw-r--r--test/rubygems/test_gem_commands_help_command.rb2
-rw-r--r--test/rubygems/test_gem_commands_install_command.rb120
-rw-r--r--test/rubygems/test_gem_commands_list_command.rb2
-rw-r--r--test/rubygems/test_gem_commands_lock_command.rb2
-rw-r--r--test/rubygems/test_gem_commands_open_command.rb17
-rw-r--r--test/rubygems/test_gem_commands_owner_command.rb6
-rw-r--r--test/rubygems/test_gem_commands_pristine_command.rb28
-rw-r--r--test/rubygems/test_gem_commands_push_command.rb12
-rw-r--r--test/rubygems/test_gem_commands_query_command.rb14
-rw-r--r--test/rubygems/test_gem_commands_server_command.rb4
-rw-r--r--test/rubygems/test_gem_commands_setup_command.rb42
-rw-r--r--test/rubygems/test_gem_commands_signin_command.rb12
-rw-r--r--test/rubygems/test_gem_commands_sources_command.rb10
-rw-r--r--test/rubygems/test_gem_commands_specification_command.rb12
-rw-r--r--test/rubygems/test_gem_commands_uninstall_command.rb8
-rw-r--r--test/rubygems/test_gem_commands_unpack_command.rb4
-rw-r--r--test/rubygems/test_gem_commands_update_command.rb20
-rw-r--r--test/rubygems/test_gem_commands_which_command.rb6
-rw-r--r--test/rubygems/test_gem_commands_yank_command.rb2
-rw-r--r--test/rubygems/test_gem_config_file.rb18
-rw-r--r--test/rubygems/test_gem_dependency.rb12
-rw-r--r--test/rubygems/test_gem_dependency_installer.rb8
-rw-r--r--test/rubygems/test_gem_doctor.rb60
-rw-r--r--test/rubygems/test_gem_ext_builder.rb40
-rw-r--r--test/rubygems/test_gem_ext_cmake_builder.rb8
-rw-r--r--test/rubygems/test_gem_ext_configure_builder.rb8
-rw-r--r--test/rubygems/test_gem_ext_ext_conf_builder.rb27
-rw-r--r--test/rubygems/test_gem_ext_rake_builder.rb2
-rw-r--r--test/rubygems/test_gem_gemcutter_utilities.rb16
-rw-r--r--test/rubygems/test_gem_install_update_options.rb18
-rw-r--r--test/rubygems/test_gem_installer.rb282
-rw-r--r--test/rubygems/test_gem_local_remote_options.rb2
-rw-r--r--test/rubygems/test_gem_package.rb96
-rw-r--r--test/rubygems/test_gem_package_old.rb18
-rw-r--r--test/rubygems/test_gem_package_tar_header.rb10
-rw-r--r--test/rubygems/test_gem_package_tar_reader_entry.rb16
-rw-r--r--test/rubygems/test_gem_package_tar_writer.rb38
-rw-r--r--test/rubygems/test_gem_package_task.rb4
-rw-r--r--test/rubygems/test_gem_path_support.rb2
-rw-r--r--test/rubygems/test_gem_rdoc.rb18
-rw-r--r--test/rubygems/test_gem_remote_fetcher.rb35
-rw-r--r--test/rubygems/test_gem_request.rb4
-rw-r--r--test/rubygems/test_gem_request_connection_pools.rb2
-rw-r--r--test/rubygems/test_gem_request_set.rb29
-rw-r--r--test/rubygems/test_gem_request_set_gem_dependency_api.rb32
-rw-r--r--test/rubygems/test_gem_request_set_lockfile.rb6
-rw-r--r--test/rubygems/test_gem_request_set_lockfile_parser.rb6
-rw-r--r--test/rubygems/test_gem_request_set_lockfile_tokenizer.rb8
-rw-r--r--test/rubygems/test_gem_requirement.rb26
-rw-r--r--test/rubygems/test_gem_resolver.rb22
-rw-r--r--test/rubygems/test_gem_resolver_best_set.rb2
-rw-r--r--test/rubygems/test_gem_resolver_git_set.rb2
-rw-r--r--test/rubygems/test_gem_resolver_git_specification.rb4
-rw-r--r--test/rubygems/test_gem_resolver_index_specification.rb2
-rw-r--r--test/rubygems/test_gem_resolver_installer_set.rb8
-rw-r--r--test/rubygems/test_gem_resolver_local_specification.rb2
-rw-r--r--test/rubygems/test_gem_resolver_specification.rb2
-rw-r--r--test/rubygems/test_gem_resolver_vendor_set.rb4
-rw-r--r--test/rubygems/test_gem_security.rb10
-rw-r--r--test/rubygems/test_gem_security_policy.rb54
-rw-r--r--test/rubygems/test_gem_security_signer.rb14
-rw-r--r--test/rubygems/test_gem_security_trust_dir.rb8
-rw-r--r--test/rubygems/test_gem_server.rb4
-rw-r--r--test/rubygems/test_gem_silent_ui.rb18
-rw-r--r--test/rubygems/test_gem_source.rb4
-rw-r--r--test/rubygems/test_gem_source_fetch_problem.rb2
-rw-r--r--test/rubygems/test_gem_source_git.rb22
-rw-r--r--test/rubygems/test_gem_source_specific_file.rb2
-rw-r--r--test/rubygems/test_gem_spec_fetcher.rb2
-rw-r--r--test/rubygems/test_gem_specification.rb186
-rw-r--r--test/rubygems/test_gem_stream_ui.rb2
-rw-r--r--test/rubygems/test_gem_stub_specification.rb8
-rw-r--r--test/rubygems/test_gem_uninstaller.rb32
-rw-r--r--test/rubygems/test_gem_util.rb14
-rw-r--r--test/rubygems/test_gem_version.rb17
-rw-r--r--test/rubygems/test_kernel.rb8
-rw-r--r--test/rubygems/test_project_sanity.rb2
-rw-r--r--test/rubygems/test_remote_fetch_error.rb2
-rw-r--r--test/rubygems/test_require.rb26
185 files changed, 2061 insertions, 2006 deletions
diff --git a/lib/bundler.rb b/lib/bundler.rb
index d370d8a53a..b2363a25f4 100644
--- a/lib/bundler.rb
+++ b/lib/bundler.rb
@@ -69,6 +69,7 @@ module Bundler
autoload :SharedHelpers, File.expand_path("bundler/shared_helpers", __dir__)
autoload :Source, File.expand_path("bundler/source", __dir__)
autoload :SourceList, File.expand_path("bundler/source_list", __dir__)
+ autoload :SourceMap, File.expand_path("bundler/source_map", __dir__)
autoload :SpecSet, File.expand_path("bundler/spec_set", __dir__)
autoload :StubSpecification, File.expand_path("bundler/stub_specification", __dir__)
autoload :UI, File.expand_path("bundler/ui", __dir__)
diff --git a/lib/bundler/bundler.gemspec b/lib/bundler/bundler.gemspec
index f6cb02cea2..1a2ced54d3 100644
--- a/lib/bundler/bundler.gemspec
+++ b/lib/bundler/bundler.gemspec
@@ -34,13 +34,12 @@ Gem::Specification.new do |s|
s.required_ruby_version = ">= 2.3.0"
s.required_rubygems_version = ">= 2.5.2"
- s.files = Dir.glob("{lib,exe}/**/*", File::FNM_DOTMATCH).reject {|f| File.directory?(f) }
+ s.files = Dir.glob("lib/bundler{.rb,/**/*}", File::FNM_DOTMATCH).reject {|f| File.directory?(f) }
- # Include the CHANGELOG.md, LICENSE.md, README.md manually
- s.files += %w[CHANGELOG.md LICENSE.md README.md]
# include the gemspec itself because warbler breaks w/o it
s.files += %w[bundler.gemspec]
+ s.extra_rdoc_files = %w[CHANGELOG.md LICENSE.md README.md]
s.bindir = "exe"
s.executables = %w[bundle bundler]
s.require_paths = ["lib"]
diff --git a/lib/bundler/cli.rb b/lib/bundler/cli.rb
index d6e69afddf..45d4e62481 100644
--- a/lib/bundler/cli.rb
+++ b/lib/bundler/cli.rb
@@ -308,39 +308,19 @@ module Bundler
end
end
- unless Bundler.feature_flag.bundler_3_mode?
- desc "show GEM [OPTIONS]", "Shows all gems that are part of the bundle, or the path to a given gem"
- long_desc <<-D
- Show lists the names and versions of all gems that are required by your Gemfile.
- Calling show with [GEM] will list the exact location of that gem on your machine.
- D
- method_option "paths", :type => :boolean,
- :banner => "List the paths of all gems that are required by your Gemfile."
- method_option "outdated", :type => :boolean,
- :banner => "Show verbose output including whether gems are outdated."
- def show(gem_name = nil)
- if ARGV[0] == "show"
- rest = ARGV[1..-1]
-
- if flag = rest.find{|arg| ["--verbose", "--outdated"].include?(arg) }
- Bundler::SharedHelpers.major_deprecation(2, "the `#{flag}` flag to `bundle show` was undocumented and will be removed without replacement")
- else
- new_command = rest.find {|arg| !arg.start_with?("--") } ? "info" : "list"
-
- new_arguments = rest.map do |arg|
- next arg if arg != "--paths"
- next "--path" if new_command == "info"
- end
-
- old_argv = ARGV.join(" ")
- new_argv = [new_command, *new_arguments.compact].join(" ")
-
- Bundler::SharedHelpers.major_deprecation(2, "use `bundle #{new_argv}` instead of `bundle #{old_argv}`")
- end
- end
- require_relative "cli/show"
- Show.new(options, gem_name).run
- end
+ desc "show GEM [OPTIONS]", "Shows all gems that are part of the bundle, or the path to a given gem"
+ long_desc <<-D
+ Show lists the names and versions of all gems that are required by your Gemfile.
+ Calling show with [GEM] will list the exact location of that gem on your machine.
+ D
+ method_option "paths", :type => :boolean,
+ :banner => "List the paths of all gems that are required by your Gemfile."
+ method_option "outdated", :type => :boolean,
+ :banner => "Show verbose output including whether gems are outdated."
+ def show(gem_name = nil)
+ SharedHelpers.major_deprecation(2, "the `--outdated` flag to `bundle show` was undocumented and will be removed without replacement") if ARGV.include?("--outdated")
+ require_relative "cli/show"
+ Show.new(options, gem_name).run
end
desc "list", "List all gems in the bundle"
diff --git a/lib/bundler/cli/outdated.rb b/lib/bundler/cli/outdated.rb
index e5d9af477c..d86ed2d002 100644
--- a/lib/bundler/cli/outdated.rb
+++ b/lib/bundler/cli/outdated.rb
@@ -146,17 +146,14 @@ module Bundler
end
def retrieve_active_spec(definition, current_spec)
- if strict
- active_spec = definition.find_resolved_spec(current_spec)
- else
- active_specs = definition.find_indexed_specs(current_spec)
- if !current_spec.version.prerelease? && !options[:pre] && active_specs.size > 1
- active_specs.delete_if {|b| b.respond_to?(:version) && b.version.prerelease? }
- end
- active_spec = active_specs.last
- end
+ active_spec = definition.resolve.find_by_name_and_platform(current_spec.name, current_spec.platform)
+ return active_spec if strict
- active_spec
+ active_specs = active_spec.source.specs.search(current_spec.name).select {|spec| spec.match_platform(current_spec.platform) }.sort_by(&:version)
+ if !current_spec.version.prerelease? && !options[:pre] && active_specs.size > 1
+ active_specs.delete_if {|b| b.respond_to?(:version) && b.version.prerelease? }
+ end
+ active_specs.last
end
def print_gems(gems_list)
diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb
index d4d3ce5a2d..bdf287b1e7 100644
--- a/lib/bundler/definition.rb
+++ b/lib/bundler/definition.rb
@@ -219,7 +219,6 @@ module Bundler
Bundler.ui.debug "The definition is missing #{missing.map(&:full_name)}"
true
rescue BundlerError => e
- @index = nil
@resolve = nil
@specs = nil
@gem_version_promoter = nil
@@ -282,50 +281,6 @@ module Bundler
end
end
- def index
- @index ||= Index.build do |idx|
- dependency_names = @dependencies.map(&:name)
-
- sources.all_sources.each do |source|
- source.dependency_names = dependency_names - pinned_spec_names(source)
- idx.add_source source.specs
- dependency_names.concat(source.unmet_deps).uniq!
- end
-
- double_check_for_index(idx, dependency_names)
- end
- end
-
- # Suppose the gem Foo depends on the gem Bar. Foo exists in Source A. Bar has some versions that exist in both
- # sources A and B. At this point, the API request will have found all the versions of Bar in source A,
- # but will not have found any versions of Bar from source B, which is a problem if the requested version
- # of Foo specifically depends on a version of Bar that is only found in source B. This ensures that for
- # each spec we found, we add all possible versions from all sources to the index.
- def double_check_for_index(idx, dependency_names)
- pinned_names = pinned_spec_names
- loop do
- idxcount = idx.size
-
- names = :names # do this so we only have to traverse to get dependency_names from the index once
- unmet_dependency_names = lambda do
- return names unless names == :names
- new_names = sources.all_sources.map(&:dependency_names_to_double_check)
- return names = nil if new_names.compact!
- names = new_names.flatten(1).concat(dependency_names)
- names.uniq!
- names -= pinned_names
- names
- end
-
- sources.all_sources.each do |source|
- source.double_check_for(unmet_dependency_names)
- end
-
- break if idxcount == idx.size
- end
- end
- private :double_check_for_index
-
def has_rubygems_remotes?
sources.rubygems_sources.any? {|s| s.remotes.any? }
end
@@ -532,14 +487,6 @@ module Bundler
end
end
- def find_resolved_spec(current_spec)
- specs.find_by_name_and_platform(current_spec.name, current_spec.platform)
- end
-
- def find_indexed_specs(current_spec)
- index[current_spec.name].select {|spec| spec.match_platform(current_spec.platform) }.sort_by(&:version)
- end
-
attr_reader :sources
private :sources
@@ -556,6 +503,10 @@ module Bundler
private
+ def precompute_source_requirements_for_indirect_dependencies?
+ sources.non_global_rubygems_sources.all?(&:dependency_api_available?) && sources.no_aggregate_global_source?
+ end
+
def current_ruby_platform_locked?
return false unless generic_local_platform == Gem::Platform::RUBY
@@ -681,9 +632,9 @@ module Bundler
changes = false
# If there is a RubyGems source in both
- locked_gem_sources.each do |locked_gem|
+ locked_gem_sources.each do |locked_gem_source|
# Merge the remotes from the Gemfile into the Gemfile.lock
- changes |= locked_gem.replace_remotes(actual_remotes, Bundler.settings[:allow_deployment_source_credential_changes])
+ changes |= locked_gem_source.replace_remotes(actual_remotes, Bundler.settings[:allow_deployment_source_credential_changes])
end
changes
@@ -902,26 +853,22 @@ module Bundler
end
def source_requirements
- # Load all specs from remote sources
- index
-
# Record the specs available in each gem's source, so that those
# specs will be available later when the resolver knows where to
# look for that gemspec (or its dependencies)
- source_requirements = { :default => sources.default_source }.merge(dependency_source_requirements)
+ source_requirements = if precompute_source_requirements_for_indirect_dependencies?
+ { :default => sources.default_source }.merge(source_map.all_requirements)
+ else
+ { :default => Source::RubygemsAggregate.new(sources, source_map) }.merge(source_map.direct_requirements)
+ end
metadata_dependencies.each do |dep|
source_requirements[dep.name] = sources.metadata_source
end
- source_requirements[:global] = index unless Bundler.feature_flag.disable_multisource?
- source_requirements[:default_bundler] = source_requirements["bundler"] || source_requirements[:default]
+ source_requirements[:default_bundler] = source_requirements["bundler"] || sources.default_source
source_requirements["bundler"] = sources.metadata_source # needs to come last to override
source_requirements
end
- def pinned_spec_names(skip = nil)
- dependency_source_requirements.reject {|_, source| source == skip }.keys
- end
-
def requested_groups
groups - Bundler.settings[:without] - @optional_groups + Bundler.settings[:with]
end
@@ -977,16 +924,8 @@ module Bundler
Bundler.settings[:allow_deployment_source_credential_changes] && source.equivalent_remotes?(sources.rubygems_remotes)
end
- def dependency_source_requirements
- @dependency_source_requirements ||= begin
- source_requirements = {}
- default = sources.default_source
- dependencies.each do |dep|
- dep_source = dep.source || default
- source_requirements[dep.name] = dep_source
- end
- source_requirements
- end
+ def source_map
+ @source_map ||= SourceMap.new(sources, dependencies)
end
end
end
diff --git a/lib/bundler/feature_flag.rb b/lib/bundler/feature_flag.rb
index 3f9a502179..53d76b8ae8 100644
--- a/lib/bundler/feature_flag.rb
+++ b/lib/bundler/feature_flag.rb
@@ -32,7 +32,6 @@ module Bundler
settings_flag(:cache_all) { bundler_3_mode? }
settings_flag(:default_install_uses_path) { bundler_3_mode? }
settings_flag(:deployment_means_frozen) { bundler_3_mode? }
- settings_flag(:disable_multisource) { bundler_3_mode? }
settings_flag(:forget_cli_options) { bundler_3_mode? }
settings_flag(:global_gem_cache) { bundler_3_mode? }
settings_flag(:path_relative_to_cwd) { bundler_3_mode? }
diff --git a/lib/bundler/friendly_errors.rb b/lib/bundler/friendly_errors.rb
index 5d0bb905bc..c5a19d3eea 100644
--- a/lib/bundler/friendly_errors.rb
+++ b/lib/bundler/friendly_errors.rb
@@ -112,7 +112,7 @@ module Bundler
#{issues_url(e)}
If there aren't any reports for this error yet, please create copy and paste the report template above into a new issue. Don't forget to anonymize any private data! The new issue form is located at:
- https://github.com/rubygems/rubygems/issues/new?labels=Bundler
+ https://github.com/rubygems/rubygems/issues/new?labels=Bundler&template=bundler-related-issue.md
EOS
end
diff --git a/lib/bundler/index.rb b/lib/bundler/index.rb
index f945176037..36520c0a43 100644
--- a/lib/bundler/index.rb
+++ b/lib/bundler/index.rb
@@ -122,10 +122,9 @@ module Bundler
names
end
- # returns a list of the dependencies
def unmet_dependency_names
dependency_names.select do |name|
- name != "bundler" && search(name).empty?
+ search(name).empty?
end
end
diff --git a/lib/bundler/man/bundle-add.1 b/lib/bundler/man/bundle-add.1
index ffcd63bbcc..a8d3420d59 100644
--- a/lib/bundler/man/bundle-add.1
+++ b/lib/bundler/man/bundle-add.1
@@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
-.TH "BUNDLE\-ADD" "1" "April 2021" "" ""
+.TH "BUNDLE\-ADD" "1" "May 2021" "" ""
.
.SH "NAME"
\fBbundle\-add\fR \- Add gem to the Gemfile and run bundle install
diff --git a/lib/bundler/man/bundle-binstubs.1 b/lib/bundler/man/bundle-binstubs.1
index 23c371b7de..3493770304 100644
--- a/lib/bundler/man/bundle-binstubs.1
+++ b/lib/bundler/man/bundle-binstubs.1
@@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
-.TH "BUNDLE\-BINSTUBS" "1" "April 2021" "" ""
+.TH "BUNDLE\-BINSTUBS" "1" "May 2021" "" ""
.
.SH "NAME"
\fBbundle\-binstubs\fR \- Install the binstubs of the listed gems
diff --git a/lib/bundler/man/bundle-cache.1 b/lib/bundler/man/bundle-cache.1
index 9bb8011a8a..7bfbaa6a4e 100644
--- a/lib/bundler/man/bundle-cache.1
+++ b/lib/bundler/man/bundle-cache.1
@@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
-.TH "BUNDLE\-CACHE" "1" "April 2021" "" ""
+.TH "BUNDLE\-CACHE" "1" "May 2021" "" ""
.
.SH "NAME"
\fBbundle\-cache\fR \- Package your needed \fB\.gem\fR files into your application
diff --git a/lib/bundler/man/bundle-check.1 b/lib/bundler/man/bundle-check.1
index 6696479fef..bae888df27 100644
--- a/lib/bundler/man/bundle-check.1
+++ b/lib/bundler/man/bundle-check.1
@@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
-.TH "BUNDLE\-CHECK" "1" "April 2021" "" ""
+.TH "BUNDLE\-CHECK" "1" "May 2021" "" ""
.
.SH "NAME"
\fBbundle\-check\fR \- Verifies if dependencies are satisfied by installed gems
diff --git a/lib/bundler/man/bundle-clean.1 b/lib/bundler/man/bundle-clean.1
index 625d87c580..2e2bb615c4 100644
--- a/lib/bundler/man/bundle-clean.1
+++ b/lib/bundler/man/bundle-clean.1
@@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
-.TH "BUNDLE\-CLEAN" "1" "April 2021" "" ""
+.TH "BUNDLE\-CLEAN" "1" "May 2021" "" ""
.
.SH "NAME"
\fBbundle\-clean\fR \- Cleans up unused gems in your bundler directory
diff --git a/lib/bundler/man/bundle-config.1 b/lib/bundler/man/bundle-config.1
index 3a1cee9b81..26e9418c0c 100644
--- a/lib/bundler/man/bundle-config.1
+++ b/lib/bundler/man/bundle-config.1
@@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
-.TH "BUNDLE\-CONFIG" "1" "April 2021" "" ""
+.TH "BUNDLE\-CONFIG" "1" "May 2021" "" ""
.
.SH "NAME"
\fBbundle\-config\fR \- Set bundler configuration options
@@ -56,9 +56,6 @@ Executing \fBbundle config unset \-\-local <name> <value>\fR will delete the con
.P
Executing bundle with the \fBBUNDLE_IGNORE_CONFIG\fR environment variable set will cause it to ignore all configuration\.
.
-.P
-Executing \fBbundle config set \-\-local disable_multisource true\fR upgrades the warning about the Gemfile containing multiple primary sources to an error\. Executing \fBbundle config unset disable_multisource\fR downgrades this error to a warning\.
-.
.SH "REMEMBERING OPTIONS"
Flags passed to \fBbundle install\fR or the Bundler runtime, such as \fB\-\-path foo\fR or \fB\-\-without production\fR, are remembered between commands and saved to your local application\'s configuration (normally, \fB\./\.bundle/config\fR)\.
.
@@ -184,9 +181,6 @@ The following is a list of all configuration keys and their purpose\. You can le
\fBdisable_local_revision_check\fR (\fBBUNDLE_DISABLE_LOCAL_REVISION_CHECK\fR): Allow Bundler to use a local git override without checking if the revision present in the lockfile is present in the repository\.
.
.IP "\(bu" 4
-\fBdisable_multisource\fR (\fBBUNDLE_DISABLE_MULTISOURCE\fR): When set, Gemfiles containing multiple sources will produce errors instead of warnings\. Use \fBbundle config unset disable_multisource\fR to unset\.
-.
-.IP "\(bu" 4
\fBdisable_shared_gems\fR (\fBBUNDLE_DISABLE_SHARED_GEMS\fR): Stop Bundler from accessing gems installed to RubyGems\' normal location\.
.
.IP "\(bu" 4
diff --git a/lib/bundler/man/bundle-config.1.ronn b/lib/bundler/man/bundle-config.1.ronn
index 15bc5af778..cffd87a160 100644
--- a/lib/bundler/man/bundle-config.1.ronn
+++ b/lib/bundler/man/bundle-config.1.ronn
@@ -47,10 +47,6 @@ configuration only from the local application.
Executing bundle with the `BUNDLE_IGNORE_CONFIG` environment variable set will
cause it to ignore all configuration.
-Executing `bundle config set --local disable_multisource true` upgrades the warning about
-the Gemfile containing multiple primary sources to an error. Executing `bundle
-config unset disable_multisource` downgrades this error to a warning.
-
## REMEMBERING OPTIONS
Flags passed to `bundle install` or the Bundler runtime, such as `--path foo` or
@@ -178,10 +174,6 @@ learn more about their operation in [bundle install(1)](bundle-install.1.html).
* `disable_local_revision_check` (`BUNDLE_DISABLE_LOCAL_REVISION_CHECK`):
Allow Bundler to use a local git override without checking if the revision
present in the lockfile is present in the repository.
-* `disable_multisource` (`BUNDLE_DISABLE_MULTISOURCE`):
- When set, Gemfiles containing multiple sources will produce errors
- instead of warnings.
- Use `bundle config unset disable_multisource` to unset.
* `disable_shared_gems` (`BUNDLE_DISABLE_SHARED_GEMS`):
Stop Bundler from accessing gems installed to RubyGems' normal location.
* `disable_version_check` (`BUNDLE_DISABLE_VERSION_CHECK`):
diff --git a/lib/bundler/man/bundle-doctor.1 b/lib/bundler/man/bundle-doctor.1
index 8e4c47c683..0c8ff27d3e 100644
--- a/lib/bundler/man/bundle-doctor.1
+++ b/lib/bundler/man/bundle-doctor.1
@@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
-.TH "BUNDLE\-DOCTOR" "1" "April 2021" "" ""
+.TH "BUNDLE\-DOCTOR" "1" "May 2021" "" ""
.
.SH "NAME"
\fBbundle\-doctor\fR \- Checks the bundle for common problems
diff --git a/lib/bundler/man/bundle-exec.1 b/lib/bundler/man/bundle-exec.1
index 863b76e4b7..c8d51cd4a2 100644
--- a/lib/bundler/man/bundle-exec.1
+++ b/lib/bundler/man/bundle-exec.1
@@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
-.TH "BUNDLE\-EXEC" "1" "April 2021" "" ""
+.TH "BUNDLE\-EXEC" "1" "May 2021" "" ""
.
.SH "NAME"
\fBbundle\-exec\fR \- Execute a command in the context of the bundle
diff --git a/lib/bundler/man/bundle-gem.1 b/lib/bundler/man/bundle-gem.1
index e71ccb4832..4b7e5a088c 100644
--- a/lib/bundler/man/bundle-gem.1
+++ b/lib/bundler/man/bundle-gem.1
@@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
-.TH "BUNDLE\-GEM" "1" "April 2021" "" ""
+.TH "BUNDLE\-GEM" "1" "May 2021" "" ""
.
.SH "NAME"
\fBbundle\-gem\fR \- Generate a project skeleton for creating a rubygem
diff --git a/lib/bundler/man/bundle-info.1 b/lib/bundler/man/bundle-info.1
index 168d021112..4039ec9c94 100644
--- a/lib/bundler/man/bundle-info.1
+++ b/lib/bundler/man/bundle-info.1
@@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
-.TH "BUNDLE\-INFO" "1" "April 2021" "" ""
+.TH "BUNDLE\-INFO" "1" "May 2021" "" ""
.
.SH "NAME"
\fBbundle\-info\fR \- Show information for the given gem in your bundle
diff --git a/lib/bundler/man/bundle-init.1 b/lib/bundler/man/bundle-init.1
index 5d3e61d05b..f538b06bf6 100644
--- a/lib/bundler/man/bundle-init.1
+++ b/lib/bundler/man/bundle-init.1
@@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
-.TH "BUNDLE\-INIT" "1" "April 2021" "" ""
+.TH "BUNDLE\-INIT" "1" "May 2021" "" ""
.
.SH "NAME"
\fBbundle\-init\fR \- Generates a Gemfile into the current working directory
diff --git a/lib/bundler/man/bundle-inject.1 b/lib/bundler/man/bundle-inject.1
index 37acabfa9a..85549b4585 100644
--- a/lib/bundler/man/bundle-inject.1
+++ b/lib/bundler/man/bundle-inject.1
@@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
-.TH "BUNDLE\-INJECT" "1" "April 2021" "" ""
+.TH "BUNDLE\-INJECT" "1" "May 2021" "" ""
.
.SH "NAME"
\fBbundle\-inject\fR \- Add named gem(s) with version requirements to Gemfile
diff --git a/lib/bundler/man/bundle-install.1 b/lib/bundler/man/bundle-install.1
index 2dcb4d3ac6..867a41d70d 100644
--- a/lib/bundler/man/bundle-install.1
+++ b/lib/bundler/man/bundle-install.1
@@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
-.TH "BUNDLE\-INSTALL" "1" "April 2021" "" ""
+.TH "BUNDLE\-INSTALL" "1" "May 2021" "" ""
.
.SH "NAME"
\fBbundle\-install\fR \- Install the dependencies specified in your Gemfile
diff --git a/lib/bundler/man/bundle-list.1 b/lib/bundler/man/bundle-list.1
index 7c93b89dc3..0b67785a21 100644
--- a/lib/bundler/man/bundle-list.1
+++ b/lib/bundler/man/bundle-list.1
@@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
-.TH "BUNDLE\-LIST" "1" "April 2021" "" ""
+.TH "BUNDLE\-LIST" "1" "May 2021" "" ""
.
.SH "NAME"
\fBbundle\-list\fR \- List all the gems in the bundle
diff --git a/lib/bundler/man/bundle-lock.1 b/lib/bundler/man/bundle-lock.1
index a4dfda9c86..860a2e07ef 100644
--- a/lib/bundler/man/bundle-lock.1
+++ b/lib/bundler/man/bundle-lock.1
@@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
-.TH "BUNDLE\-LOCK" "1" "April 2021" "" ""
+.TH "BUNDLE\-LOCK" "1" "May 2021" "" ""
.
.SH "NAME"
\fBbundle\-lock\fR \- Creates / Updates a lockfile without installing
diff --git a/lib/bundler/man/bundle-open.1 b/lib/bundler/man/bundle-open.1
index 0511bc655b..b907e2d544 100644
--- a/lib/bundler/man/bundle-open.1
+++ b/lib/bundler/man/bundle-open.1
@@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
-.TH "BUNDLE\-OPEN" "1" "April 2021" "" ""
+.TH "BUNDLE\-OPEN" "1" "May 2021" "" ""
.
.SH "NAME"
\fBbundle\-open\fR \- Opens the source directory for a gem in your bundle
diff --git a/lib/bundler/man/bundle-outdated.1 b/lib/bundler/man/bundle-outdated.1
index 268b4b157c..5427a2ab77 100644
--- a/lib/bundler/man/bundle-outdated.1
+++ b/lib/bundler/man/bundle-outdated.1
@@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
-.TH "BUNDLE\-OUTDATED" "1" "April 2021" "" ""
+.TH "BUNDLE\-OUTDATED" "1" "May 2021" "" ""
.
.SH "NAME"
\fBbundle\-outdated\fR \- List installed gems with newer versions available
diff --git a/lib/bundler/man/bundle-platform.1 b/lib/bundler/man/bundle-platform.1
index 77638b2b4b..2a80abb8d6 100644
--- a/lib/bundler/man/bundle-platform.1
+++ b/lib/bundler/man/bundle-platform.1
@@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
-.TH "BUNDLE\-PLATFORM" "1" "April 2021" "" ""
+.TH "BUNDLE\-PLATFORM" "1" "May 2021" "" ""
.
.SH "NAME"
\fBbundle\-platform\fR \- Displays platform compatibility information
diff --git a/lib/bundler/man/bundle-pristine.1 b/lib/bundler/man/bundle-pristine.1
index 0fcf9fdb39..7fff665de0 100644
--- a/lib/bundler/man/bundle-pristine.1
+++ b/lib/bundler/man/bundle-pristine.1
@@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
-.TH "BUNDLE\-PRISTINE" "1" "April 2021" "" ""
+.TH "BUNDLE\-PRISTINE" "1" "May 2021" "" ""
.
.SH "NAME"
\fBbundle\-pristine\fR \- Restores installed gems to their pristine condition
diff --git a/lib/bundler/man/bundle-remove.1 b/lib/bundler/man/bundle-remove.1
index ca366b81a9..17de5ed5a9 100644
--- a/lib/bundler/man/bundle-remove.1
+++ b/lib/bundler/man/bundle-remove.1
@@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
-.TH "BUNDLE\-REMOVE" "1" "April 2021" "" ""
+.TH "BUNDLE\-REMOVE" "1" "May 2021" "" ""
.
.SH "NAME"
\fBbundle\-remove\fR \- Removes gems from the Gemfile
diff --git a/lib/bundler/man/bundle-show.1 b/lib/bundler/man/bundle-show.1
index e403ae980f..fbbe18741f 100644
--- a/lib/bundler/man/bundle-show.1
+++ b/lib/bundler/man/bundle-show.1
@@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
-.TH "BUNDLE\-SHOW" "1" "April 2021" "" ""
+.TH "BUNDLE\-SHOW" "1" "May 2021" "" ""
.
.SH "NAME"
\fBbundle\-show\fR \- Shows all the gems in your bundle, or the path to a gem
diff --git a/lib/bundler/man/bundle-update.1 b/lib/bundler/man/bundle-update.1
index 5546b51792..3c9af3dcc1 100644
--- a/lib/bundler/man/bundle-update.1
+++ b/lib/bundler/man/bundle-update.1
@@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
-.TH "BUNDLE\-UPDATE" "1" "April 2021" "" ""
+.TH "BUNDLE\-UPDATE" "1" "May 2021" "" ""
.
.SH "NAME"
\fBbundle\-update\fR \- Update your gems to the latest available versions
diff --git a/lib/bundler/man/bundle-viz.1 b/lib/bundler/man/bundle-viz.1
index 645c45b607..fbc48aa902 100644
--- a/lib/bundler/man/bundle-viz.1
+++ b/lib/bundler/man/bundle-viz.1
@@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
-.TH "BUNDLE\-VIZ" "1" "April 2021" "" ""
+.TH "BUNDLE\-VIZ" "1" "May 2021" "" ""
.
.SH "NAME"
\fBbundle\-viz\fR \- Generates a visual dependency graph for your Gemfile
diff --git a/lib/bundler/man/bundle.1 b/lib/bundler/man/bundle.1
index 5c1bc96572..5b6c9afe78 100644
--- a/lib/bundler/man/bundle.1
+++ b/lib/bundler/man/bundle.1
@@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
-.TH "BUNDLE" "1" "April 2021" "" ""
+.TH "BUNDLE" "1" "May 2021" "" ""
.
.SH "NAME"
\fBbundle\fR \- Ruby Dependency Management
diff --git a/lib/bundler/man/gemfile.5 b/lib/bundler/man/gemfile.5
index 480d38f39c..2497fad234 100644
--- a/lib/bundler/man/gemfile.5
+++ b/lib/bundler/man/gemfile.5
@@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
-.TH "GEMFILE" "5" "April 2021" "" ""
+.TH "GEMFILE" "5" "May 2021" "" ""
.
.SH "NAME"
\fBGemfile\fR \- A format for describing gem dependencies for Ruby programs
diff --git a/lib/bundler/plugin/api/source.rb b/lib/bundler/plugin/api/source.rb
index d70a16f4bc..f6f4ac4f0a 100644
--- a/lib/bundler/plugin/api/source.rb
+++ b/lib/bundler/plugin/api/source.rb
@@ -244,6 +244,20 @@ module Bundler
specs.unmet_dependency_names
end
+ # Used by definition.
+ #
+ # Note: Do not override if you don't know what you are doing.
+ def spec_names
+ specs.spec_names
+ end
+
+ # Used by definition.
+ #
+ # Note: Do not override if you don't know what you are doing.
+ def add_dependency_names(names)
+ @dependencies |= Array(names)
+ end
+
# Note: Do not override if you don't know what you are doing.
def can_lock?(spec)
spec.source == self
diff --git a/lib/bundler/resolver.rb b/lib/bundler/resolver.rb
index 69899dc6c3..9a25e49d4b 100644
--- a/lib/bundler/resolver.rb
+++ b/lib/bundler/resolver.rb
@@ -21,17 +21,11 @@ module Bundler
base = SpecSet.new(base) unless base.is_a?(SpecSet)
resolver = new(source_requirements, base, gem_version_promoter, additional_base_requirements, platforms)
result = resolver.start(requirements)
- SpecSet.new(result)
+ SpecSet.new(result).for(requirements.reject{|dep| dep.name.end_with?("\0") })
end
def initialize(source_requirements, base, gem_version_promoter, additional_base_requirements, platforms)
@source_requirements = source_requirements
-
- @index_requirements = source_requirements.each_with_object({}) do |source_requirement, index_requirements|
- name, source = source_requirement
- index_requirements[name] = name == :global ? source : source.specs
- end
-
@base = base
@resolver = Molinillo::Resolver.new(self, self)
@search_for = {}
@@ -45,10 +39,6 @@ module Bundler
@resolving_only_for_ruby = platforms == [Gem::Platform::RUBY]
@gem_version_promoter = gem_version_promoter
@use_gvp = Bundler.feature_flag.use_gem_version_promoter_for_major_updates? || !@gem_version_promoter.major?
- @no_aggregate_global_source = @source_requirements[:global].nil?
-
- @variant_specific_names = []
- @generic_names = ["Ruby\0", "RubyGems\0"]
end
def start(requirements)
@@ -58,7 +48,6 @@ module Bundler
verify_gemfile_dependencies_are_found!(requirements)
dg = @resolver.resolve(requirements, @base_dg)
dg.
- tap {|resolved| validate_resolved_specs!(resolved) }.
map(&:payload).
reject {|sg| sg.name.end_with?("\0") }.
map(&:to_specs).
@@ -112,24 +101,14 @@ module Bundler
include Molinillo::SpecificationProvider
def dependencies_for(specification)
- all_dependencies = specification.dependencies_for_activated_platforms
-
- if @variant_specific_names.include?(specification.name)
- @variant_specific_names |= all_dependencies.map(&:name) - @generic_names
- else
- generic_names, variant_specific_names = specification.partitioned_dependency_names_for_activated_platforms
- @variant_specific_names |= variant_specific_names - @generic_names
- @generic_names |= generic_names
- end
-
- all_dependencies
+ specification.dependencies_for_activated_platforms
end
def search_for(dependency_proxy)
platform = dependency_proxy.__platform
dependency = dependency_proxy.dep
name = dependency.name
- search_result = @search_for[dependency_proxy] ||= begin
+ @search_for[dependency_proxy] ||= begin
results = results_for(dependency, @base[name])
if vertex = @base_dg.vertex_named(name)
@@ -181,35 +160,14 @@ module Bundler
@gem_version_promoter.sort_versions(dependency, spec_groups)
end
end
-
- unless search_result.empty?
- specific_dependency = @variant_specific_names.include?(name)
- return search_result unless specific_dependency
-
- search_result.each do |sg|
- if @generic_names.include?(name)
- @variant_specific_names -= [name]
- sg.activate_all_platforms!
- else
- sg.activate_platform!(platform)
- end
- end
- end
-
- search_result
end
def index_for(dependency)
- source = @index_requirements[dependency.name]
- if source
- source
- elsif @no_aggregate_global_source
- Index.build do |idx|
- dependency.all_sources.each {|s| idx.add_source(s.specs) }
- end
- else
- @index_requirements[:global]
- end
+ source_for(dependency.name).specs
+ end
+
+ def source_for(name)
+ @source_requirements[name] || @source_requirements[:default]
end
def results_for(dependency, base)
@@ -240,23 +198,10 @@ module Bundler
dependencies.map(&:dep) == other_dependencies.map(&:dep)
end
- def relevant_sources_for_vertex(vertex)
- if vertex.root?
- [@source_requirements[vertex.name]]
- elsif @no_aggregate_global_source
- vertex.recursive_predecessors.map do |v|
- @source_requirements[v.name]
- end.compact << @source_requirements[:default]
- else
- []
- end
- end
-
def sort_dependencies(dependencies, activated, conflicts)
dependencies.sort_by do |dependency|
name = name_for(dependency)
vertex = activated.vertex_named(name)
- dependency.all_sources = relevant_sources_for_vertex(vertex)
[
@base_dg.vertex_named(name) ? 0 : 1,
vertex.payload ? 0 : 1,
@@ -398,7 +343,7 @@ module Bundler
if other_bundler_required
o << "\n\n"
- candidate_specs = @index_requirements[:default_bundler].search(conflict_dependency)
+ candidate_specs = source_for(:default_bundler).specs.search(conflict_dependency)
if candidate_specs.any?
target_version = candidate_specs.last.version
new_command = [File.basename($PROGRAM_NAME), "_#{target_version}_", *ARGV].join(" ")
@@ -415,11 +360,7 @@ module Bundler
elsif !conflict.existing
o << "\n"
- relevant_sources = if conflict.requirement.source
- [conflict.requirement.source]
- else
- conflict.requirement.all_sources
- end.compact.map(&:to_s).uniq.sort
+ relevant_source = conflict.requirement.source || source_for(name)
metadata_requirement = name.end_with?("\0")
@@ -432,12 +373,10 @@ module Bundler
end
o << " "
- o << if relevant_sources.empty?
- "in any of the sources.\n"
- elsif metadata_requirement
- "is not available in #{relevant_sources.join(" or ")}"
+ o << if metadata_requirement
+ "is not available in #{relevant_source}"
else
- "in any of the relevant sources:\n #{relevant_sources * "\n "}\n"
+ "in #{relevant_source}.\n"
end
end
end,
@@ -451,27 +390,5 @@ module Bundler
end
)
end
-
- def validate_resolved_specs!(resolved_specs)
- resolved_specs.each do |v|
- name = v.name
- sources = relevant_sources_for_vertex(v)
- next unless sources.any?
- if default_index = sources.index(@source_requirements[:default])
- sources.delete_at(default_index)
- end
- sources.reject! {|s| s.specs.search(name).empty? }
- sources.uniq!
- next if sources.size <= 1
-
- msg = ["The gem '#{name}' was found in multiple relevant sources."]
- msg.concat sources.map {|s| " * #{s}" }.sort
- msg << "You #{@no_aggregate_global_source ? :must : :should} add this gem to the source block for the source you wish it to be installed from."
- msg = msg.join("\n")
-
- raise SecurityError, msg if @no_aggregate_global_source
- Bundler.ui.warn "Warning: #{msg}"
- end
- end
end
end
diff --git a/lib/bundler/resolver/spec_group.rb b/lib/bundler/resolver/spec_group.rb
index 73ffec5838..8f4fd18c46 100644
--- a/lib/bundler/resolver/spec_group.rb
+++ b/lib/bundler/resolver/spec_group.rb
@@ -21,14 +21,10 @@ module Bundler
@version = exemplary_spec.version
@source = exemplary_spec.source
- @all_platforms = relevant_platforms
@activated_platforms = relevant_platforms
@dependencies = Hash.new do |dependencies, platforms|
dependencies[platforms] = dependencies_for(platforms)
end
- @partitioned_dependency_names = Hash.new do |partitioned_dependency_names, platforms|
- partitioned_dependency_names[platforms] = partitioned_dependency_names_for(platforms)
- end
@specs = specs
end
@@ -45,14 +41,6 @@ module Bundler
end.flatten.compact.uniq
end
- def activate_platform!(platform)
- self.activated_platforms = [platform]
- end
-
- def activate_all_platforms!
- self.activated_platforms = @all_platforms
- end
-
def to_s
activated_platforms_string = sorted_activated_platforms.join(", ")
"#{name} (#{version}) (#{activated_platforms_string})"
@@ -62,10 +50,6 @@ module Bundler
@dependencies[activated_platforms]
end
- def partitioned_dependency_names_for_activated_platforms
- @partitioned_dependency_names[activated_platforms]
- end
-
def ==(other)
return unless other.is_a?(SpecGroup)
name == other.name &&
@@ -100,14 +84,6 @@ module Bundler
end.flatten
end
- def partitioned_dependency_names_for(platforms)
- return @dependencies[platforms].map(&:name), [] if platforms.size == 1
-
- @dependencies[platforms].partition do |dep_proxy|
- @dependencies[platforms].count {|dp| dp.dep == dep_proxy.dep } == platforms.size
- end.map {|deps| deps.map(&:name) }
- end
-
def __dependencies(platform)
dependencies = []
@specs[platform].first.dependencies.each do |dep|
diff --git a/lib/bundler/rubygems_ext.rb b/lib/bundler/rubygems_ext.rb
index 2bd2dcb451..c95664965c 100644
--- a/lib/bundler/rubygems_ext.rb
+++ b/lib/bundler/rubygems_ext.rb
@@ -105,7 +105,7 @@ module Gem
end
class Dependency
- attr_accessor :source, :groups, :all_sources
+ attr_accessor :source, :groups
alias_method :eql?, :==
@@ -116,7 +116,7 @@ module Gem
end
def to_yaml_properties
- instance_variables.reject {|p| ["@source", "@groups", "@all_sources"].include?(p.to_s) }
+ instance_variables.reject {|p| ["@source", "@groups"].include?(p.to_s) }
end
def to_lock
diff --git a/lib/bundler/settings.rb b/lib/bundler/settings.rb
index 612c56f041..0702a80440 100644
--- a/lib/bundler/settings.rb
+++ b/lib/bundler/settings.rb
@@ -21,7 +21,6 @@ module Bundler
disable_exec_load
disable_local_branch_check
disable_local_revision_check
- disable_multisource
disable_shared_gems
disable_version_check
force_ruby_platform
diff --git a/lib/bundler/source.rb b/lib/bundler/source.rb
index a3f4b09cce..f39072791c 100644
--- a/lib/bundler/source.rb
+++ b/lib/bundler/source.rb
@@ -7,6 +7,7 @@ module Bundler
autoload :Metadata, File.expand_path("source/metadata", __dir__)
autoload :Path, File.expand_path("source/path", __dir__)
autoload :Rubygems, File.expand_path("source/rubygems", __dir__)
+ autoload :RubygemsAggregate, File.expand_path("source/rubygems_aggregate", __dir__)
attr_accessor :dependency_names
@@ -39,6 +40,10 @@ module Bundler
def remote!; end
+ def add_dependency_names(names)
+ @dependency_names = Array(dependency_names) | Array(names)
+ end
+
# it's possible that gems from one source depend on gems from some
# other source, so now we download gemspecs and iterate over those
# dependencies, looking for gems we don't have info on yet.
@@ -48,6 +53,10 @@ module Bundler
specs.dependency_names
end
+ def spec_names
+ specs.spec_names
+ end
+
def include?(other)
other == self
end
diff --git a/lib/bundler/source/rubygems.rb b/lib/bundler/source/rubygems.rb
index 2b7cfd53b9..a11a89cf72 100644
--- a/lib/bundler/source/rubygems.rb
+++ b/lib/bundler/source/rubygems.rb
@@ -259,8 +259,16 @@ module Bundler
!equivalent
end
+ def spec_names
+ if @allow_remote && dependency_api_available?
+ remote_specs.spec_names
+ else
+ []
+ end
+ end
+
def unmet_deps
- if @allow_remote && api_fetchers.any?
+ if @allow_remote && dependency_api_available?
remote_specs.unmet_dependency_names
else
[]
@@ -276,7 +284,7 @@ module Bundler
def double_check_for(unmet_dependency_names)
return unless @allow_remote
- return unless api_fetchers.any?
+ return unless dependency_api_available?
unmet_dependency_names = unmet_dependency_names.call
unless unmet_dependency_names.nil?
@@ -298,17 +306,20 @@ module Bundler
remote_specs.each do |spec|
case spec
when EndpointSpecification, Gem::Specification, StubSpecification, LazySpecification
- names.concat(spec.runtime_dependencies)
+ names.concat(spec.runtime_dependencies.map(&:name))
when RemoteSpecification # from the full index
return nil
else
raise "unhandled spec type (#{spec.inspect})"
end
end
- names.map!(&:name) if names
names
end
+ def dependency_api_available?
+ api_fetchers.any?
+ end
+
protected
def credless_remotes
diff --git a/lib/bundler/source/rubygems_aggregate.rb b/lib/bundler/source/rubygems_aggregate.rb
new file mode 100644
index 0000000000..685bf7e90a
--- /dev/null
+++ b/lib/bundler/source/rubygems_aggregate.rb
@@ -0,0 +1,64 @@
+# frozen_string_literal: true
+
+module Bundler
+ class Source
+ class RubygemsAggregate
+ attr_reader :source_map, :sources
+
+ def initialize(sources, source_map)
+ @sources = sources
+ @source_map = source_map
+
+ @index = build_index
+ end
+
+ def specs
+ @index
+ end
+
+ def to_s
+ "any of the sources"
+ end
+
+ private
+
+ def build_index
+ Index.build do |idx|
+ dependency_names = source_map.pinned_spec_names
+
+ sources.all_sources.each do |source|
+ source.dependency_names = dependency_names - source_map.pinned_spec_names(source)
+ idx.add_source source.specs
+ dependency_names.concat(source.unmet_deps).uniq!
+ end
+
+ double_check_for_index(idx, dependency_names)
+ end
+ end
+
+ # Suppose the gem Foo depends on the gem Bar. Foo exists in Source A. Bar has some versions that exist in both
+ # sources A and B. At this point, the API request will have found all the versions of Bar in source A,
+ # but will not have found any versions of Bar from source B, which is a problem if the requested version
+ # of Foo specifically depends on a version of Bar that is only found in source B. This ensures that for
+ # each spec we found, we add all possible versions from all sources to the index.
+ def double_check_for_index(idx, dependency_names)
+ pinned_names = source_map.pinned_spec_names
+
+ names = :names # do this so we only have to traverse to get dependency_names from the index once
+ unmet_dependency_names = lambda do
+ return names unless names == :names
+ new_names = sources.all_sources.map(&:dependency_names_to_double_check)
+ return names = nil if new_names.compact!
+ names = new_names.flatten(1).concat(dependency_names)
+ names.uniq!
+ names -= pinned_names
+ names
+ end
+
+ sources.all_sources.each do |source|
+ source.double_check_for(unmet_dependency_names)
+ end
+ end
+ end
+ end
+end
diff --git a/lib/bundler/source_list.rb b/lib/bundler/source_list.rb
index 6f5636f41e..f7eb3a1c03 100644
--- a/lib/bundler/source_list.rb
+++ b/lib/bundler/source_list.rb
@@ -21,15 +21,19 @@ module Bundler
@rubygems_sources = []
@metadata_source = Source::Metadata.new
- @disable_multisource = true
+ @merged_gem_lockfile_sections = false
end
- def disable_multisource?
- @disable_multisource
+ def merged_gem_lockfile_sections?
+ @merged_gem_lockfile_sections
end
def merged_gem_lockfile_sections!
- @disable_multisource = false
+ @merged_gem_lockfile_sections = true
+ end
+
+ def no_aggregate_global_source?
+ global_rubygems_source.remotes.size <= 1
end
def add_path_source(options = {})
@@ -70,7 +74,11 @@ module Bundler
end
def rubygems_sources
- @rubygems_sources + [global_rubygems_source]
+ non_global_rubygems_sources + [global_rubygems_source]
+ end
+
+ def non_global_rubygems_sources
+ @rubygems_sources
end
def rubygems_remotes
@@ -81,16 +89,27 @@ module Bundler
path_sources + git_sources + plugin_sources + rubygems_sources + [metadata_source]
end
+ def non_default_explicit_sources
+ all_sources - [default_source, metadata_source]
+ end
+
def get(source)
source_list_for(source).find {|s| equal_source?(source, s) || equivalent_source?(source, s) }
end
def lock_sources
- lock_sources = (path_sources + git_sources + plugin_sources).sort_by(&:to_s)
- if disable_multisource?
- lock_sources + rubygems_sources.sort_by(&:to_s).uniq
+ lock_other_sources + lock_rubygems_sources
+ end
+
+ def lock_other_sources
+ (path_sources + git_sources + plugin_sources).sort_by(&:to_s)
+ end
+
+ def lock_rubygems_sources
+ if merged_gem_lockfile_sections?
+ [combine_rubygems_sources]
else
- lock_sources << combine_rubygems_sources
+ rubygems_sources.sort_by(&:to_s).uniq
end
end
@@ -104,7 +123,7 @@ module Bundler
end
end
- replacement_rubygems = !disable_multisource? &&
+ replacement_rubygems = merged_gem_lockfile_sections? &&
replacement_sources.detect {|s| s.is_a?(Source::Rubygems) }
@global_rubygems_source = replacement_rubygems if replacement_rubygems
diff --git a/lib/bundler/source_map.rb b/lib/bundler/source_map.rb
new file mode 100644
index 0000000000..a554f26f76
--- /dev/null
+++ b/lib/bundler/source_map.rb
@@ -0,0 +1,58 @@
+# frozen_string_literal: true
+
+module Bundler
+ class SourceMap
+ attr_reader :sources, :dependencies
+
+ def initialize(sources, dependencies)
+ @sources = sources
+ @dependencies = dependencies
+ end
+
+ def pinned_spec_names(skip = nil)
+ direct_requirements.reject {|_, source| source == skip }.keys
+ end
+
+ def all_requirements
+ requirements = direct_requirements.dup
+
+ unmet_deps = sources.non_default_explicit_sources.map do |source|
+ (source.spec_names - pinned_spec_names).each do |indirect_dependency_name|
+ previous_source = requirements[indirect_dependency_name]
+ if previous_source.nil?
+ requirements[indirect_dependency_name] = source
+ else
+ no_ambiguous_sources = Bundler.feature_flag.bundler_3_mode?
+
+ msg = ["The gem '#{indirect_dependency_name}' was found in multiple relevant sources."]
+ msg.concat [previous_source, source].map {|s| " * #{s}" }.sort
+ msg << "You #{no_ambiguous_sources ? :must : :should} add this gem to the source block for the source you wish it to be installed from."
+ msg = msg.join("\n")
+
+ raise SecurityError, msg if no_ambiguous_sources
+ Bundler.ui.warn "Warning: #{msg}"
+ end
+ end
+
+ source.unmet_deps
+ end
+
+ sources.default_source.add_dependency_names(unmet_deps.flatten - requirements.keys)
+
+ requirements
+ end
+
+ def direct_requirements
+ @direct_requirements ||= begin
+ requirements = {}
+ default = sources.default_source
+ dependencies.each do |dep|
+ dep_source = dep.source || default
+ dep_source.add_dependency_names(dep.name)
+ requirements[dep.name] = dep_source
+ end
+ requirements
+ end
+ end
+ end
+end
diff --git a/lib/bundler/templates/newgem/newgem.gemspec.tt b/lib/bundler/templates/newgem/newgem.gemspec.tt
index 632b24dda9..7032004076 100644
--- a/lib/bundler/templates/newgem/newgem.gemspec.tt
+++ b/lib/bundler/templates/newgem/newgem.gemspec.tt
@@ -14,7 +14,7 @@ Gem::Specification.new do |spec|
<%- if config[:mit] -%>
spec.license = "MIT"
<%- end -%>
- spec.required_ruby_version = Gem::Requirement.new(">= <%= config[:required_ruby_version] %>")
+ spec.required_ruby_version = ">= <%= config[:required_ruby_version] %>"
spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'"
diff --git a/lib/bundler/version.rb b/lib/bundler/version.rb
index 735cb09c88..8e327e0951 100644
--- a/lib/bundler/version.rb
+++ b/lib/bundler/version.rb
@@ -1,7 +1,7 @@
# frozen_string_literal: false
module Bundler
- VERSION = "2.2.17".freeze
+ VERSION = "2.2.18".freeze
def self.bundler_major_version
@bundler_major_version ||= VERSION.split(".").first.to_i
diff --git a/lib/rubygems.rb b/lib/rubygems.rb
index 48d0117efb..dec57f8309 100644
--- a/lib/rubygems.rb
+++ b/lib/rubygems.rb
@@ -8,7 +8,7 @@
require 'rbconfig'
module Gem
- VERSION = "3.2.17".freeze
+ VERSION = "3.2.18".freeze
end
# Must be first since it unloads the prelude from 1.9.2
diff --git a/lib/rubygems/ext/ext_conf_builder.rb b/lib/rubygems/ext/ext_conf_builder.rb
index fede270417..1f73796351 100644
--- a/lib/rubygems/ext/ext_conf_builder.rb
+++ b/lib/rubygems/ext/ext_conf_builder.rb
@@ -23,11 +23,11 @@ class Gem::Ext::ExtConfBuilder < Gem::Ext::Builder
# spaces do not work.
#
# Details: https://github.com/rubygems/rubygems/issues/977#issuecomment-171544940
- tmp_dest = get_relative_path(tmp_dest, extension_dir)
+ tmp_dest_relative = get_relative_path(tmp_dest.clone, extension_dir)
Tempfile.open %w[siteconf .rb], extension_dir do |siteconf|
siteconf.puts "require 'rbconfig'"
- siteconf.puts "dest_path = #{tmp_dest.dump}"
+ siteconf.puts "dest_path = #{tmp_dest_relative.dump}"
%w[sitearchdir sitelibdir].each do |dir|
siteconf.puts "RbConfig::MAKEFILE_CONFIG['#{dir}'] = dest_path"
siteconf.puts "RbConfig::CONFIG['#{dir}'] = dest_path"
@@ -63,8 +63,8 @@ class Gem::Ext::ExtConfBuilder < Gem::Ext::Builder
make dest_path, results, extension_dir
- if tmp_dest
- full_tmp_dest = File.join(extension_dir, tmp_dest)
+ if tmp_dest_relative
+ full_tmp_dest = File.join(extension_dir, tmp_dest_relative)
# TODO remove in RubyGems 3
if Gem.install_extension_in_lib and lib_dir
diff --git a/lib/rubygems/specification.rb b/lib/rubygems/specification.rb
index 6b569032ba..7206c3eaf0 100644
--- a/lib/rubygems/specification.rb
+++ b/lib/rubygems/specification.rb
@@ -1558,7 +1558,6 @@ class Gem::Specification < Gem::BasicSpecification
def build_extensions # :nodoc:
return if default_gem?
return if extensions.empty?
- return if installed_by_version < Gem::Version.new('2.2.0.preview.2')
return if File.exist? gem_build_complete_path
return if !File.writable?(base_dir)
return if !File.exist?(File.join(base_dir, 'extensions'))
@@ -2129,7 +2128,6 @@ class Gem::Specification < Gem::BasicSpecification
def missing_extensions?
return false if default_gem?
return false if extensions.empty?
- return false if installed_by_version < Gem::Version.new('2.2.0.preview.2')
return false if File.exist? gem_build_complete_path
true
diff --git a/lib/rubygems/test_case.rb b/lib/rubygems/test_case.rb
index e2763561c6..b3e23360ed 100644
--- a/lib/rubygems/test_case.rb
+++ b/lib/rubygems/test_case.rb
@@ -12,7 +12,7 @@ if File.exist?(bundler_gemspec)
end
begin
- gem 'minitest', '~> 5.13'
+ gem 'test-unit', '~> 3.0'
rescue Gem::LoadError
end
@@ -32,16 +32,7 @@ else
require 'bundler'
end
-# Enable server plugin needed for bisection
-if ENV["RG_BISECT_SERVER_PLUGIN"]
- require ENV["RG_BISECT_SERVER_PLUGIN"]
-
- Minitest.extensions << "server"
-end
-
-ENV["MT_NO_PLUGINS"] = "true"
-
-require 'minitest/autorun'
+require 'test/unit'
ENV["JARS_SKIP"] = "true" if Gem.java_platform? # avoid unnecessary and noisy `jar-dependencies` post install hook
@@ -111,7 +102,7 @@ end
# and uninstall gems, fetch remote gems through a stub fetcher and be assured
# your normal set of gems is not affected.
-class Gem::TestCase < Minitest::Test
+class Gem::TestCase < Test::Unit::TestCase
extend Gem::Deprecate
attr_accessor :fetcher # :nodoc:
@@ -140,11 +131,48 @@ class Gem::TestCase < Minitest::Test
end
def assert_directory_exists(path, msg = nil)
- msg = message(msg) { "Expected path '#{path}' to be a directory" }
- assert_path_exists path
+ msg = build_message(msg, "Expected path '#{path}' to be a directory")
+ assert_path_exist path
assert File.directory?(path), msg
end
+ # https://github.com/seattlerb/minitest/blob/21d9e804b63c619f602f3f4ece6c71b48974707a/lib/minitest/assertions.rb#L188
+ def _synchronize
+ yield
+ end
+
+ # https://github.com/seattlerb/minitest/blob/21d9e804b63c619f602f3f4ece6c71b48974707a/lib/minitest/assertions.rb#L546
+ def capture_subprocess_io
+ _synchronize do
+ begin
+ require "tempfile"
+
+ captured_stdout, captured_stderr = Tempfile.new("out"), Tempfile.new("err")
+
+ orig_stdout, orig_stderr = $stdout.dup, $stderr.dup
+ $stdout.reopen captured_stdout
+ $stderr.reopen captured_stderr
+
+ yield
+
+ $stdout.rewind
+ $stderr.rewind
+
+ return captured_stdout.read, captured_stderr.read
+ ensure
+ captured_stdout.unlink
+ captured_stderr.unlink
+ $stdout.reopen orig_stdout
+ $stderr.reopen orig_stderr
+
+ orig_stdout.close
+ orig_stderr.close
+ captured_stdout.close
+ captured_stderr.close
+ end
+ end
+ end
+
##
# Sets the ENABLE_SHARED entry in RbConfig::CONFIG to +value+ and restores
# the original value when the block ends
@@ -262,19 +290,19 @@ class Gem::TestCase < Minitest::Test
def assert_contains_make_command(target, output, msg = nil)
if output.match(/\n/)
- msg = message(msg) do
+ msg = build_message(msg,
"Expected output containing make command \"%s\", but was \n\nBEGIN_OF_OUTPUT\n%sEND_OF_OUTPUT" % [
('%s %s' % [make_command, target]).rstrip,
output,
]
- end
+ )
else
- msg = message(msg) do
+ msg = build_message(msg,
'Expected make command "%s": %s' % [
('%s %s' % [make_command, target]).rstrip,
output,
]
- end
+ )
end
assert scan_make_command_lines(output).any? {|line|
@@ -664,6 +692,28 @@ class Gem::TestCase < Minitest::Test
path
end
+ ##
+ # Load a YAML string, the psych 3 way
+
+ def load_yaml(yaml)
+ if YAML.respond_to?(:unsafe_load)
+ YAML.unsafe_load(yaml)
+ else
+ YAML.load(yaml)
+ end
+ end
+
+ ##
+ # Load a YAML file, the psych 3 way
+
+ def load_yaml_file(file)
+ if YAML.respond_to?(:unsafe_load_file)
+ YAML.unsafe_load_file(file)
+ else
+ YAML.load_file(file)
+ end
+ end
+
def all_spec_names
Gem::Specification.map(&:full_name)
end
@@ -1519,4 +1569,38 @@ Also, a list:
end if Gem::HAVE_OPENSSL
end
+# https://github.com/seattlerb/minitest/blob/13c48a03d84a2a87855a4de0c959f96800100357/lib/minitest/mock.rb#L192
+class Object
+ def stub(name, val_or_callable, *block_args)
+ new_name = "__minitest_stub__#{name}"
+
+ metaclass = class << self; self; end
+
+ if respond_to? name and not methods.map(&:to_s).include? name.to_s
+ metaclass.send :define_method, name do |*args|
+ super(*args)
+ end
+ end
+
+ metaclass.send :alias_method, new_name, name
+
+ metaclass.send :define_method, name do |*args, &blk|
+ if val_or_callable.respond_to? :call
+ val_or_callable.call(*args, &blk)
+ else
+ blk.call(*block_args) if blk
+ val_or_callable
+ end
+ end
+
+ metaclass.send(:ruby2_keywords, name) if metaclass.respond_to?(:ruby2_keywords, true)
+
+ yield self
+ ensure
+ metaclass.send :undef_method, name
+ metaclass.send :alias_method, name, new_name
+ metaclass.send :undef_method, new_name
+ end
+end
+
require 'rubygems/test_utilities'
diff --git a/spec/bundler/bundler/definition_spec.rb b/spec/bundler/bundler/definition_spec.rb
index dcdde75315..67a1536541 100644
--- a/spec/bundler/bundler/definition_spec.rb
+++ b/spec/bundler/bundler/definition_spec.rb
@@ -268,33 +268,6 @@ RSpec.describe Bundler::Definition do
end
end
- describe "find_resolved_spec" do
- it "with no platform set in SpecSet" do
- ss = Bundler::SpecSet.new([build_stub_spec("a", "1.0"), build_stub_spec("b", "1.0")])
- dfn = Bundler::Definition.new(nil, [], mock_source_list, true)
- dfn.instance_variable_set("@specs", ss)
- found = dfn.find_resolved_spec(build_spec("a", "0.9", "ruby").first)
- expect(found.name).to eq "a"
- expect(found.version.to_s).to eq "1.0"
- end
- end
-
- describe "find_indexed_specs" do
- it "with no platform set in indexed specs" do
- index = Bundler::Index.new
- %w[1.0.0 1.0.1 1.1.0].each {|v| index << build_stub_spec("foo", v) }
-
- dfn = Bundler::Definition.new(nil, [], mock_source_list, true)
- dfn.instance_variable_set("@index", index)
- found = dfn.find_indexed_specs(build_spec("foo", "0.9", "ruby").first)
- expect(found.length).to eq 3
- end
- end
-
- def build_stub_spec(name, version)
- Bundler::StubSpecification.new(name, version, nil, nil)
- end
-
def mock_source_list
Class.new do
def all_sources
diff --git a/spec/bundler/commands/cache_spec.rb b/spec/bundler/commands/cache_spec.rb
index f8fab594b8..3816649141 100644
--- a/spec/bundler/commands/cache_spec.rb
+++ b/spec/bundler/commands/cache_spec.rb
@@ -234,7 +234,7 @@ RSpec.describe "bundle cache" do
end
end
- bundle "config --local without wo"
+ bundle "config set --local without wo"
install_gemfile <<-G
source "file:#{gem_repo1}"
gem "rack"
@@ -250,7 +250,7 @@ RSpec.describe "bundle cache" do
expect(the_bundle).to include_gem "rack 1.0"
expect(the_bundle).not_to include_gems "weakling", "uninstallable"
- bundle "config --local without wo"
+ bundle "config set --local without wo"
bundle :install
expect(the_bundle).to include_gem "rack 1.0"
expect(the_bundle).not_to include_gems "weakling", "uninstallable"
@@ -282,7 +282,7 @@ RSpec.describe "bundle cache" do
end
subject do
- bundle "config --local frozen true"
+ bundle "config set --local frozen true"
bundle :cache, :raise_on_error => false
end
@@ -332,8 +332,8 @@ RSpec.describe "bundle install with gem sources" do
simulate_new_machine
FileUtils.rm_rf gem_repo2
- bundle "config --local deployment true"
- bundle "config --local path vendor/bundle"
+ bundle "config set --local deployment true"
+ bundle "config set --local path vendor/bundle"
bundle :install
expect(the_bundle).to include_gems "rack 1.0.0"
end
diff --git a/spec/bundler/commands/check_spec.rb b/spec/bundler/commands/check_spec.rb
index fdf3bc7d51..2fb03186be 100644
--- a/spec/bundler/commands/check_spec.rb
+++ b/spec/bundler/commands/check_spec.rb
@@ -124,7 +124,7 @@ RSpec.describe "bundle check" do
gem "rack", :group => :foo
G
- bundle "config --local without foo"
+ bundle "config set --local without foo"
bundle :install
gemfile <<-G
@@ -217,7 +217,7 @@ RSpec.describe "bundle check" do
gem "foo"
G
- bundle "config --local deployment true"
+ bundle "config set --local deployment true"
bundle "install"
FileUtils.rm(bundled_app_lock)
diff --git a/spec/bundler/commands/config_spec.rb b/spec/bundler/commands/config_spec.rb
index 33677cf4ad..2f4488a552 100644
--- a/spec/bundler/commands/config_spec.rb
+++ b/spec/bundler/commands/config_spec.rb
@@ -45,7 +45,7 @@ RSpec.describe ".bundle/config" do
it "can be moved with an environment variable" do
ENV["BUNDLE_APP_CONFIG"] = tmp("foo/bar").to_s
- bundle "config --local path vendor/bundle"
+ bundle "config set --local path vendor/bundle"
bundle "install"
expect(bundled_app(".bundle")).not_to exist
@@ -57,7 +57,7 @@ RSpec.describe ".bundle/config" do
FileUtils.mkdir_p bundled_app("omg")
ENV["BUNDLE_APP_CONFIG"] = "../foo"
- bundle "config --local path vendor/bundle"
+ bundle "config set --local path vendor/bundle"
bundle "install", :dir => bundled_app("omg")
expect(bundled_app(".bundle")).not_to exist
diff --git a/spec/bundler/commands/exec_spec.rb b/spec/bundler/commands/exec_spec.rb
index 5fa68b96d5..0d104ad304 100644
--- a/spec/bundler/commands/exec_spec.rb
+++ b/spec/bundler/commands/exec_spec.rb
@@ -295,7 +295,7 @@ RSpec.describe "bundle exec" do
end
it "handles gems installed with --without" do
- bundle "config --local without middleware"
+ bundle "config set --local without middleware"
install_gemfile <<-G
source "#{file_uri_for(gem_repo1)}"
gem "rack" # rack 0.9.1 and 1.0 exist
diff --git a/spec/bundler/commands/install_spec.rb b/spec/bundler/commands/install_spec.rb
index f12d32d6a8..c91864dbb8 100644
--- a/spec/bundler/commands/install_spec.rb
+++ b/spec/bundler/commands/install_spec.rb
@@ -291,7 +291,7 @@ RSpec.describe "bundle install with gem sources" do
end
it "works" do
- bundle "config --local path vendor"
+ bundle "config set --local path vendor"
bundle "install"
expect(the_bundle).to include_gems "rack 1.0"
end
@@ -614,7 +614,7 @@ RSpec.describe "bundle install with gem sources" do
it "should display a proper message to explain the problem" do
FileUtils.chmod(0o500, cache_path)
- bundle "config --local path vendor"
+ bundle "config set --local path vendor"
bundle :install, :raise_on_error => false
expect(err).to include(cache_path.to_s)
expect(err).to include("grant write permissions")
@@ -627,7 +627,7 @@ RSpec.describe "bundle install with gem sources" do
source "#{file_uri_for(gem_repo1)}"
gem "rack"
G
- bundle "config --local path bundle"
+ bundle "config set --local path bundle"
bundle "install", :standalone => true
end
diff --git a/spec/bundler/commands/lock_spec.rb b/spec/bundler/commands/lock_spec.rb
index 264af30f6c..21eb6e5456 100644
--- a/spec/bundler/commands/lock_spec.rb
+++ b/spec/bundler/commands/lock_spec.rb
@@ -533,7 +533,7 @@ RSpec.describe "bundle lock" do
#{Bundler::VERSION}
L
- bundle "lock --add-platform x86_64-linux", :artifice => :compact_index, :env => { "BUNDLER_SPEC_GEM_REPO" => gem_repo4.to_s }
+ bundle "lock --add-platform x86_64-linux", :artifice => "compact_index", :env => { "BUNDLER_SPEC_GEM_REPO" => gem_repo4.to_s }
end
context "when an update is available" do
diff --git a/spec/bundler/commands/outdated_spec.rb b/spec/bundler/commands/outdated_spec.rb
index b0f0448655..fd54e18b6c 100644
--- a/spec/bundler/commands/outdated_spec.rb
+++ b/spec/bundler/commands/outdated_spec.rb
@@ -205,8 +205,8 @@ RSpec.describe "bundle outdated" do
end
it "works" do
- bundle :install, :artifice => :compact_index
- bundle :outdated, :artifice => :compact_index, :raise_on_error => false
+ bundle :install, :artifice => "compact_index"
+ bundle :outdated, :artifice => "compact_index", :raise_on_error => false
expected_output = <<~TABLE
Gem Current Latest Requested Groups
diff --git a/spec/bundler/commands/post_bundle_message_spec.rb b/spec/bundler/commands/post_bundle_message_spec.rb
index 3092f9a9b7..72f8020b44 100644
--- a/spec/bundler/commands/post_bundle_message_spec.rb
+++ b/spec/bundler/commands/post_bundle_message_spec.rb
@@ -29,21 +29,21 @@ RSpec.describe "post bundle message" do
expect(out).to include(bundle_complete_message)
expect(out).to include(installed_gems_stats)
- bundle "config --local without emo"
+ bundle "config set --local without emo"
bundle :install
expect(out).to include(bundle_show_message)
expect(out).to include("Gems in the group 'emo' were not installed")
expect(out).to include(bundle_complete_message)
expect(out).to include(installed_gems_stats)
- bundle "config --local without emo test"
+ bundle "config set --local without emo test"
bundle :install
expect(out).to include(bundle_show_message)
expect(out).to include("Gems in the groups 'emo' and 'test' were not installed")
expect(out).to include(bundle_complete_message)
expect(out).to include("4 Gemfile dependencies, 3 gems now installed.")
- bundle "config --local without emo obama test"
+ bundle "config set --local without emo obama test"
bundle :install
expect(out).to include(bundle_show_message)
expect(out).to include("Gems in the groups 'emo', 'obama' and 'test' were not installed")
@@ -55,28 +55,28 @@ RSpec.describe "post bundle message" do
let(:bundle_path) { "./vendor" }
it "shows proper messages according to the configured groups" do
- bundle "config --local path vendor"
+ bundle "config set --local path vendor"
bundle :install
expect(out).to include(bundle_show_path_message)
expect(out).to_not include("Gems in the group")
expect(out).to include(bundle_complete_message)
- bundle "config --local path vendor"
- bundle "config --local without emo"
+ bundle "config set --local path vendor"
+ bundle "config set --local without emo"
bundle :install
expect(out).to include(bundle_show_path_message)
expect(out).to include("Gems in the group 'emo' were not installed")
expect(out).to include(bundle_complete_message)
- bundle "config --local path vendor"
- bundle "config --local without emo test"
+ bundle "config set --local path vendor"
+ bundle "config set --local without emo test"
bundle :install
expect(out).to include(bundle_show_path_message)
expect(out).to include("Gems in the groups 'emo' and 'test' were not installed")
expect(out).to include(bundle_complete_message)
- bundle "config --local path vendor"
- bundle "config --local without emo obama test"
+ bundle "config set --local path vendor"
+ bundle "config set --local without emo obama test"
bundle :install
expect(out).to include(bundle_show_path_message)
expect(out).to include("Gems in the groups 'emo', 'obama' and 'test' were not installed")
@@ -88,7 +88,7 @@ RSpec.describe "post bundle message" do
let(:bundle_path) { bundled_app("cache") }
it "shows proper messages according to the configured groups" do
- bundle "config --local path #{bundle_path}"
+ bundle "config set --local path #{bundle_path}"
bundle :install
expect(out).to include("Bundled gems are installed into `./cache`")
expect(out).to_not include("Gems in the group")
@@ -100,7 +100,7 @@ RSpec.describe "post bundle message" do
let(:bundle_path) { tmp("not_bundled_app") }
it "shows proper messages according to the configured groups" do
- bundle "config --local path #{bundle_path}"
+ bundle "config set --local path #{bundle_path}"
bundle :install
expect(out).to include("Bundled gems are installed into `#{tmp("not_bundled_app")}`")
expect(out).to_not include("Gems in the group")
@@ -184,19 +184,19 @@ The source does not contain any versions of 'not-a-gem'
expect(out).not_to include("Gems in the groups")
expect(out).to include(bundle_updated_message)
- bundle "config --local without emo"
+ bundle "config set --local without emo"
bundle :install
bundle :update, :all => true
expect(out).to include("Gems in the group 'emo' were not updated")
expect(out).to include(bundle_updated_message)
- bundle "config --local without emo test"
+ bundle "config set --local without emo test"
bundle :install
bundle :update, :all => true
expect(out).to include("Gems in the groups 'emo' and 'test' were not updated")
expect(out).to include(bundle_updated_message)
- bundle "config --local without emo obama test"
+ bundle "config set --local without emo obama test"
bundle :install
bundle :update, :all => true
expect(out).to include("Gems in the groups 'emo', 'obama' and 'test' were not updated")
diff --git a/spec/bundler/commands/update_spec.rb b/spec/bundler/commands/update_spec.rb
index 51a0b925a3..4d5bab063d 100644
--- a/spec/bundler/commands/update_spec.rb
+++ b/spec/bundler/commands/update_spec.rb
@@ -649,8 +649,8 @@ RSpec.describe "bundle update" do
end
it "works" do
- bundle :install, :artifice => :compact_index
- bundle "update oj", :artifice => :compact_index
+ bundle :install, :artifice => "compact_index"
+ bundle "update oj", :artifice => "compact_index"
expect(out).to include("Bundle updated!")
expect(the_bundle).to include_gems "oj 3.11.5"
diff --git a/spec/bundler/install/deploy_spec.rb b/spec/bundler/install/deploy_spec.rb
index 3e3bbe816f..8f6298b301 100644
--- a/spec/bundler/install/deploy_spec.rb
+++ b/spec/bundler/install/deploy_spec.rb
@@ -44,8 +44,8 @@ RSpec.describe "install in deployment or frozen mode" do
it "still works if you are not in the app directory and specify --gemfile" do
bundle "install"
simulate_new_machine
- bundle "config --local deployment true"
- bundle "config --local path vendor/bundle"
+ bundle "config set --local deployment true"
+ bundle "config set --local path vendor/bundle"
bundle "install --gemfile #{tmp}/bundled_app/Gemfile", :dir => tmp
expect(the_bundle).to include_gems "rack 1.0"
end
@@ -58,8 +58,8 @@ RSpec.describe "install in deployment or frozen mode" do
end
G
bundle :install
- bundle "config --local deployment true"
- bundle "config --local without test"
+ bundle "config set --local deployment true"
+ bundle "config set --local without test"
bundle :install
end
@@ -67,7 +67,7 @@ RSpec.describe "install in deployment or frozen mode" do
skip "doesn't find bundle" if Gem.win_platform?
bundle :install
- bundle "config --local deployment true"
+ bundle "config set --local deployment true"
bundle :install
bundle "exec bundle check", :env => { "PATH" => path }
end
@@ -81,7 +81,7 @@ RSpec.describe "install in deployment or frozen mode" do
G
bundle :install
- bundle "config --local deployment true"
+ bundle "config set --local deployment true"
bundle :install
end
@@ -104,7 +104,7 @@ RSpec.describe "install in deployment or frozen mode" do
gem "rack-obama", ">= 1.0"
G
- bundle "config --local deployment true"
+ bundle "config set --local deployment true"
bundle :install, :artifice => "endpoint_strict_basic_authentication"
end
@@ -115,7 +115,7 @@ RSpec.describe "install in deployment or frozen mode" do
end
G
- bundle "config --local deployment true"
+ bundle "config set --local deployment true"
bundle :install
expect(the_bundle).to include_gems "rack 1.0"
@@ -123,7 +123,7 @@ RSpec.describe "install in deployment or frozen mode" do
context "when replacing a host with the same host with credentials" do
before do
- bundle "config --local path vendor/bundle"
+ bundle "config set --local path vendor/bundle"
bundle "install"
gemfile <<-G
source "http://user_name:password@localgemserver.test/"
@@ -227,7 +227,7 @@ RSpec.describe "install in deployment or frozen mode" do
gem "rack-obama"
G
- bundle "config --local deployment true"
+ bundle "config set --local deployment true"
bundle :install, :raise_on_error => false
expect(err).to include("deployment mode")
expect(err).to include("You have added to the Gemfile")
@@ -246,9 +246,9 @@ RSpec.describe "install in deployment or frozen mode" do
expect(the_bundle).to include_gems "path_gem 1.0"
FileUtils.rm_r lib_path("path_gem-1.0")
- bundle "config --local path .bundle"
- bundle "config --local without development"
- bundle "config --local deployment true"
+ bundle "config set --local path .bundle"
+ bundle "config set --local without development"
+ bundle "config set --local deployment true"
bundle :install, :env => { "DEBUG" => "1" }
run "puts :WIN"
expect(out).to eq("WIN")
@@ -264,8 +264,8 @@ RSpec.describe "install in deployment or frozen mode" do
expect(the_bundle).to include_gems "path_gem 1.0"
FileUtils.rm_r lib_path("path_gem-1.0")
- bundle "config --local path .bundle"
- bundle "config --local deployment true"
+ bundle "config set --local path .bundle"
+ bundle "config set --local deployment true"
bundle :install, :raise_on_error => false
expect(err).to include("The path `#{lib_path("path_gem-1.0")}` does not exist.")
end
@@ -336,7 +336,7 @@ RSpec.describe "install in deployment or frozen mode" do
gem "activesupport"
G
- bundle "config --local deployment true"
+ bundle "config set --local deployment true"
bundle :install, :raise_on_error => false
expect(err).to include("deployment mode")
expect(err).to include("You have added to the Gemfile:\n* activesupport\n\n")
@@ -350,7 +350,7 @@ RSpec.describe "install in deployment or frozen mode" do
gem "rack", :git => "git://hubz.com"
G
- bundle "config --local deployment true"
+ bundle "config set --local deployment true"
bundle :install, :raise_on_error => false
expect(err).to include("deployment mode")
expect(err).to include("You have added to the Gemfile:\n* source: git://hubz.com")
@@ -370,7 +370,7 @@ RSpec.describe "install in deployment or frozen mode" do
gem "rack"
G
- bundle "config --local deployment true"
+ bundle "config set --local deployment true"
bundle :install, :raise_on_error => false
expect(err).to include("deployment mode")
expect(err).to include("You have deleted from the Gemfile:\n* source: #{lib_path("rack-1.0")}")
@@ -394,7 +394,7 @@ RSpec.describe "install in deployment or frozen mode" do
gem "foo", :git => "#{lib_path("rack")}"
G
- bundle "config --local deployment true"
+ bundle "config set --local deployment true"
bundle :install, :raise_on_error => false
expect(err).to include("deployment mode")
expect(err).to include("You have changed in the Gemfile:\n* rack from `no specified source` to `#{lib_path("rack")}`")
diff --git a/spec/bundler/install/gemfile/eval_gemfile_spec.rb b/spec/bundler/install/gemfile/eval_gemfile_spec.rb
index c42ae7ef79..102f61dc12 100644
--- a/spec/bundler/install/gemfile/eval_gemfile_spec.rb
+++ b/spec/bundler/install/gemfile/eval_gemfile_spec.rb
@@ -47,7 +47,7 @@ RSpec.describe "bundle install with gemfile that uses eval_gemfile" do
# parsed lockfile and the evaluated gemfile.
it "bundles with deployment mode configured" do
bundle :install
- bundle "config --local deployment true"
+ bundle "config set --local deployment true"
bundle :install
end
end
diff --git a/spec/bundler/install/gemfile/gemspec_spec.rb b/spec/bundler/install/gemfile/gemspec_spec.rb
index b04db18f49..32dd7d24b8 100644
--- a/spec/bundler/install/gemfile/gemspec_spec.rb
+++ b/spec/bundler/install/gemfile/gemspec_spec.rb
@@ -291,7 +291,7 @@ RSpec.describe "bundle install from an existing gemspec" do
s.add_dependency "activesupport", ">= 1.0.1"
end
- bundle "config --local deployment true"
+ bundle "config set --local deployment true"
bundle :install, :raise_on_error => false
expect(err).to include("changed")
@@ -557,7 +557,7 @@ RSpec.describe "bundle install from an existing gemspec" do
it "installs the ruby platform gemspec and skips dev deps with `without development` configured" do
simulate_platform "ruby"
- bundle "config --local without development"
+ bundle "config set --local without development"
install_gemfile <<-G
source "#{file_uri_for(gem_repo1)}"
gemspec :path => '#{tmp.join("foo")}', :name => 'foo'
@@ -567,4 +567,57 @@ RSpec.describe "bundle install from an existing gemspec" do
expect(the_bundle).not_to include_gem "rack"
end
end
+
+ context "with multiple platforms and resolving for more specific platforms" do
+ before do
+ build_lib("chef", :path => tmp.join("chef")) do |s|
+ s.version = "17.1.17"
+ s.write "chef-universal-mingw32.gemspec", build_spec("chef", "17.1.17", "universal-mingw32") {|sw| sw.runtime "win32-api", "~> 1.5.3" }.first.to_ruby
+ end
+ end
+
+ it "does not remove the platform specific specs from the lockfile when updating" do
+ build_repo4 do
+ build_gem "win32-api", "1.5.3" do |s|
+ s.platform = "universal-mingw32"
+ end
+ end
+
+ gemfile <<-G
+ source "#{file_uri_for(gem_repo4)}"
+ gemspec :path => "../chef"
+ G
+
+ initial_lockfile = <<~L
+ PATH
+ remote: ../chef
+ specs:
+ chef (17.1.17)
+ chef (17.1.17-universal-mingw32)
+ win32-api (~> 1.5.3)
+
+ GEM
+ remote: #{file_uri_for(gem_repo4)}/
+ specs:
+ win32-api (1.5.3-universal-mingw32)
+
+ PLATFORMS
+ ruby
+ x64-mingw32
+ x86-mingw32
+
+ DEPENDENCIES
+ chef!
+
+ BUNDLED WITH
+ #{Bundler::VERSION}
+ L
+
+ lockfile initial_lockfile
+
+ bundle "update"
+
+ expect(lockfile).to eq initial_lockfile
+ end
+ end
end
diff --git a/spec/bundler/install/gemfile/git_spec.rb b/spec/bundler/install/gemfile/git_spec.rb
index 8477089608..ba8f253b0e 100644
--- a/spec/bundler/install/gemfile/git_spec.rb
+++ b/spec/bundler/install/gemfile/git_spec.rb
@@ -128,7 +128,7 @@ RSpec.describe "bundle install with git sources" do
end
it "still works after moving the application directory" do
- bundle "config --local path vendor/bundle"
+ bundle "config set --local path vendor/bundle"
bundle "install"
FileUtils.mv bundled_app, tmp("bundled_app.bck")
@@ -137,7 +137,7 @@ RSpec.describe "bundle install with git sources" do
end
it "can still install after moving the application directory" do
- bundle "config --local path vendor/bundle"
+ bundle "config set --local path vendor/bundle"
bundle "install"
FileUtils.mv bundled_app, tmp("bundled_app.bck")
@@ -1080,7 +1080,7 @@ RSpec.describe "bundle install with git sources" do
simulate_new_machine
- bundle "config --local deployment true"
+ bundle "config set --local deployment true"
bundle :install
end
end
diff --git a/spec/bundler/install/gemfile/groups_spec.rb b/spec/bundler/install/gemfile/groups_spec.rb
index 567a9b1172..c92b5dcc57 100644
--- a/spec/bundler/install/gemfile/groups_spec.rb
+++ b/spec/bundler/install/gemfile/groups_spec.rb
@@ -86,7 +86,7 @@ RSpec.describe "bundle install with groups" do
end
it "installs gems in the default group" do
- bundle "config --local without emo"
+ bundle "config set --local without emo"
bundle :install
expect(the_bundle).to include_gems "rack 1.0.0", :groups => [:default]
end
@@ -117,7 +117,7 @@ RSpec.describe "bundle install with groups" do
end
it "does not install gems from the excluded group" do
- bundle "config --local without emo"
+ bundle "config set --local without emo"
bundle :install
expect(the_bundle).not_to include_gems "activesupport 2.3.5", :groups => [:default]
end
@@ -130,13 +130,13 @@ RSpec.describe "bundle install with groups" do
end
it "does not say it installed gems from the excluded group" do
- bundle "config --local without emo"
+ bundle "config set --local without emo"
bundle :install
expect(out).not_to include("activesupport")
end
it "allows Bundler.setup for specific groups" do
- bundle "config --local without emo"
+ bundle "config set --local without emo"
bundle :install
run("require 'rack'; puts RACK", :default)
expect(out).to eq("1.0.0")
@@ -151,7 +151,7 @@ RSpec.describe "bundle install with groups" do
end
G
- bundle "config --local without emo"
+ bundle "config set --local without emo"
bundle :install
expect(the_bundle).to include_gems "activesupport 2.3.2", :groups => [:default]
end
@@ -188,7 +188,7 @@ RSpec.describe "bundle install with groups" do
end
it "installs gems from the optional group when requested" do
- bundle "config --local with debugging"
+ bundle "config set --local with debugging"
bundle :install
expect(the_bundle).to include_gems "thin 1.0"
end
@@ -214,13 +214,13 @@ RSpec.describe "bundle install with groups" do
end
it "removes groups from without when passed at --with", :bundler => "< 3" do
- bundle "config --local without emo"
+ bundle "config set --local without emo"
bundle "install --with emo"
expect(the_bundle).to include_gems "activesupport 2.3.5"
end
it "removes groups from with when passed at --without", :bundler => "< 3" do
- bundle "config --local with debugging"
+ bundle "config set --local with debugging"
bundle "install --without debugging", :raise_on_error => false
expect(the_bundle).not_to include_gem "thin 1.0"
end
@@ -251,13 +251,13 @@ RSpec.describe "bundle install with groups" do
end
it "has no effect when listing a not optional group in with" do
- bundle "config --local with emo"
+ bundle "config set --local with emo"
bundle :install
expect(the_bundle).to include_gems "activesupport 2.3.5"
end
it "has no effect when listing an optional group in without" do
- bundle "config --local without debugging"
+ bundle "config set --local without debugging"
bundle :install
expect(the_bundle).not_to include_gems "thin 1.0"
end
@@ -275,13 +275,13 @@ RSpec.describe "bundle install with groups" do
end
it "installs gems in the default group" do
- bundle "config --local without emo lolercoaster"
+ bundle "config set --local without emo lolercoaster"
bundle :install
expect(the_bundle).to include_gems "rack 1.0.0"
end
it "installs the gem if any of its groups are installed" do
- bundle "config --local without emo"
+ bundle "config set --local without emo"
bundle :install
expect(the_bundle).to include_gems "rack 1.0.0", "activesupport 2.3.5"
end
@@ -303,19 +303,19 @@ RSpec.describe "bundle install with groups" do
end
it "installs the gem unless all groups are excluded" do
- bundle "config --local without emo"
+ bundle "config set --local without emo"
bundle :install
expect(the_bundle).to include_gems "activesupport 2.3.5"
- bundle "config --local without lolercoaster"
+ bundle "config set --local without lolercoaster"
bundle :install
expect(the_bundle).to include_gems "activesupport 2.3.5"
- bundle "config --local without emo lolercoaster"
+ bundle "config set --local without emo lolercoaster"
bundle :install
expect(the_bundle).not_to include_gems "activesupport 2.3.5"
- bundle "config --local without 'emo lolercoaster'"
+ bundle "config set --local without 'emo lolercoaster'"
bundle :install
expect(the_bundle).not_to include_gems "activesupport 2.3.5"
end
@@ -336,13 +336,13 @@ RSpec.describe "bundle install with groups" do
end
it "installs gems in the default group" do
- bundle "config --local without emo lolercoaster"
+ bundle "config set --local without emo lolercoaster"
bundle :install
expect(the_bundle).to include_gems "rack 1.0.0"
end
it "installs the gem if any of its groups are installed" do
- bundle "config --local without emo"
+ bundle "config set --local without emo"
bundle :install
expect(the_bundle).to include_gems "rack 1.0.0", "activesupport 2.3.5"
end
@@ -358,7 +358,7 @@ RSpec.describe "bundle install with groups" do
G
ruby <<-R
- require "#{lib_dir}/bundler"
+ require "#{entrypoint}"
Bundler.setup :default
Bundler.require :default
puts RACK
@@ -380,7 +380,7 @@ RSpec.describe "bundle install with groups" do
system_gems "rack-0.9.1"
- bundle "config --local without rack"
+ bundle "config set --local without rack"
install_gemfile <<-G
source "#{file_uri_for(gem_repo2)}"
gem "rack"
@@ -404,7 +404,7 @@ RSpec.describe "bundle install with groups" do
it "does not hit the remote a second time" do
FileUtils.rm_rf gem_repo2
- bundle "config --local without rack"
+ bundle "config set --local without rack"
bundle :install, :verbose => true
expect(last_command.stdboth).not_to match(/fetching/i)
end
diff --git a/spec/bundler/install/gemfile/path_spec.rb b/spec/bundler/install/gemfile/path_spec.rb
index 5772c4edc6..1c77b3a37e 100644
--- a/spec/bundler/install/gemfile/path_spec.rb
+++ b/spec/bundler/install/gemfile/path_spec.rb
@@ -131,7 +131,7 @@ RSpec.describe "bundle install with explicit source paths" do
gem 'foo', :path => File.expand_path("../foo-1.0", __FILE__)
G
- bundle "config --local frozen true"
+ bundle "config set --local frozen true"
bundle :install
end
diff --git a/spec/bundler/install/gemfile/platform_spec.rb b/spec/bundler/install/gemfile/platform_spec.rb
index 9b4bbba016..c49594183e 100644
--- a/spec/bundler/install/gemfile/platform_spec.rb
+++ b/spec/bundler/install/gemfile/platform_spec.rb
@@ -278,7 +278,7 @@ RSpec.describe "bundle install across platforms" do
gem "rack", "1.0.0"
G
- bundle "config --local path vendor/bundle"
+ bundle "config set --local path vendor/bundle"
bundle :install
FileUtils.mv(vendored_gems, bundled_app("vendor/bundle", Gem.ruby_engine, "1.8"))
diff --git a/spec/bundler/install/gemfile/sources_spec.rb b/spec/bundler/install/gemfile/sources_spec.rb
index bf150c115a..d13ba0e607 100644
--- a/spec/bundler/install/gemfile/sources_spec.rb
+++ b/spec/bundler/install/gemfile/sources_spec.rb
@@ -20,23 +20,23 @@ RSpec.describe "bundle install with gems on multiple sources" do
before do
gemfile <<-G
- source "#{file_uri_for(gem_repo3)}"
- source "#{file_uri_for(gem_repo1)}"
+ source "https://gem.repo3"
+ source "https://gem.repo1"
gem "rack-obama"
gem "rack"
G
end
it "warns about ambiguous gems, but installs anyway, prioritizing sources last to first", :bundler => "< 3" do
- bundle :install
+ bundle :install, :artifice => "compact_index"
expect(err).to include("Warning: the gem 'rack' was found in multiple sources.")
- expect(err).to include("Installed from: #{file_uri_for(gem_repo1)}")
+ expect(err).to include("Installed from: https://gem.repo1")
expect(the_bundle).to include_gems("rack-obama 1.0.0", "rack 1.0.0", :source => "remote1")
end
it "fails", :bundler => "3" do
- bundle :instal, :raise_on_error => false
+ bundle :instal, :artifice => "compact_index", :raise_on_error => false
expect(err).to include("Each source after the first must include a block")
expect(exitstatus).to eq(4)
end
@@ -47,22 +47,22 @@ RSpec.describe "bundle install with gems on multiple sources" do
before do
gemfile <<-G
- source "#{file_uri_for(gem_repo3)}"
- source "#{file_uri_for(gem_repo1)}"
+ source "https://gem.repo3"
+ source "https://gem.repo1"
gem "rack-obama"
gem "rack", "1.0.0" # force it to install the working version in repo1
G
end
it "warns about ambiguous gems, but installs anyway", :bundler => "< 3" do
- bundle :install
+ bundle :install, :artifice => "compact_index"
expect(err).to include("Warning: the gem 'rack' was found in multiple sources.")
- expect(err).to include("Installed from: #{file_uri_for(gem_repo1)}")
+ expect(err).to include("Installed from: https://gem.repo1")
expect(the_bundle).to include_gems("rack-obama 1.0.0", "rack 1.0.0", :source => "remote1")
end
it "fails", :bundler => "3" do
- bundle :install, :raise_on_error => false
+ bundle :install, :artifice => "compact_index", :raise_on_error => false
expect(err).to include("Each source after the first must include a block")
expect(exitstatus).to eq(4)
end
@@ -85,8 +85,8 @@ RSpec.describe "bundle install with gems on multiple sources" do
end
gemfile <<-G
- source "#{file_uri_for(gem_repo3)}"
- source "#{file_uri_for(gem_repo1)}" do
+ source "https://gem.repo3"
+ source "https://gem.repo1" do
gem "thin" # comes first to test name sorting
gem "rack"
end
@@ -95,20 +95,20 @@ RSpec.describe "bundle install with gems on multiple sources" do
end
it "installs the gems without any warning" do
- bundle :install
+ bundle :install, :artifice => "compact_index"
expect(err).not_to include("Warning")
expect(the_bundle).to include_gems("rack-obama 1.0.0")
expect(the_bundle).to include_gems("rack 1.0.0", :source => "remote1")
end
it "can cache and deploy" do
- bundle :cache
+ bundle :cache, :artifice => "compact_index"
expect(bundled_app("vendor/cache/rack-1.0.0.gem")).to exist
expect(bundled_app("vendor/cache/rack-obama-1.0.gem")).to exist
- bundle "config --local deployment true"
- bundle :install
+ bundle "config set --local deployment true"
+ bundle :install, :artifice => "compact_index"
expect(the_bundle).to include_gems("rack-obama 1.0.0", "rack 1.0.0")
end
@@ -128,10 +128,10 @@ RSpec.describe "bundle install with gems on multiple sources" do
end
end
- install_gemfile <<-G
- source "#{file_uri_for(gem_repo3)}"
+ install_gemfile <<-G, :artifice => "compact_index"
+ source "https://gem.repo3"
gem "rack-obama" # should come from repo3!
- gem "rack", :source => "#{file_uri_for(gem_repo1)}"
+ gem "rack", :source => "https://gem.repo1"
G
end
@@ -155,8 +155,8 @@ RSpec.describe "bundle install with gems on multiple sources" do
end
gemfile <<-G
- source "#{file_uri_for(gem_repo2)}"
- source "#{file_uri_for(gem_repo3)}" do
+ source "https://gem.repo2"
+ source "https://gem.repo3" do
gem "depends_on_rack"
end
G
@@ -168,7 +168,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
end
it "installs from the same source without any warning" do
- bundle :install
+ bundle :install, :artifice => "compact_index"
expect(err).not_to include("Warning")
expect(the_bundle).to include_gems("depends_on_rack 1.0.1", "rack 1.0.0", :source => "remote3")
end
@@ -185,7 +185,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
end
it "installs from the same source without any warning" do
- bundle :install
+ bundle :install, :artifice => "compact_index"
expect(err).not_to include("Warning: the gem 'rack' was found in multiple sources.")
expect(the_bundle).to include_gems("depends_on_rack 1.0.1", "rack 1.0.0", :source => "remote3")
@@ -193,7 +193,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
# In https://github.com/bundler/bundler/issues/3585 this failed
# when there is already a lock file, and the gems are missing, so try again
system_gems []
- bundle :install
+ bundle :install, :artifice => "compact_index"
expect(err).not_to include("Warning: the gem 'rack' was found in multiple sources.")
expect(the_bundle).to include_gems("depends_on_rack 1.0.1", "rack 1.0.0", :source => "remote3")
@@ -218,9 +218,9 @@ RSpec.describe "bundle install with gems on multiple sources" do
context "and not in any other sources" do
before do
- install_gemfile <<-G
- source "#{file_uri_for(gem_repo2)}"
- source "#{file_uri_for(gem_repo3)}" do
+ install_gemfile <<-G, :artifice => "compact_index"
+ source "https://gem.repo2"
+ source "https://gem.repo3" do
gem "depends_on_rack"
end
G
@@ -235,23 +235,23 @@ RSpec.describe "bundle install with gems on multiple sources" do
context "and in yet another source" do
before do
gemfile <<-G
- source "#{file_uri_for(gem_repo1)}"
- source "#{file_uri_for(gem_repo2)}"
- source "#{file_uri_for(gem_repo3)}" do
+ source "https://gem.repo1"
+ source "https://gem.repo2"
+ source "https://gem.repo3" do
gem "depends_on_rack"
end
G
end
it "installs from the other source and warns about ambiguous gems", :bundler => "< 3" do
- bundle :install
+ bundle :install, :artifice => "compact_index"
expect(err).to include("Warning: the gem 'rack' was found in multiple sources.")
- expect(err).to include("Installed from: #{file_uri_for(gem_repo2)}")
+ expect(err).to include("Installed from: https://gem.repo2")
expect(the_bundle).to include_gems("depends_on_rack 1.0.1", "rack 1.0.0")
end
it "fails", :bundler => "3" do
- bundle :install, :raise_on_error => false
+ bundle :install, :artifice => "compact_index", :raise_on_error => false
expect(err).to include("Each source after the first must include a block")
expect(exitstatus).to eq(4)
end
@@ -267,16 +267,16 @@ RSpec.describe "bundle install with gems on multiple sources" do
end
gemfile <<-G
- source "#{file_uri_for(gem_repo3)}" # contains depends_on_rack
- source "#{file_uri_for(gem_repo2)}" # contains broken rack
+ source "https://gem.repo3" # contains depends_on_rack
+ source "https://gem.repo2" # contains broken rack
gem "depends_on_rack" # installed from gem_repo3
- gem "rack", :source => "#{file_uri_for(gem_repo1)}"
+ gem "rack", :source => "https://gem.repo1"
G
end
it "installs the dependency from the pinned source without warning", :bundler => "< 3" do
- bundle :install
+ bundle :install, :artifice => "compact_index"
expect(err).not_to include("Warning: the gem 'rack' was found in multiple sources.")
expect(the_bundle).to include_gems("depends_on_rack 1.0.1", "rack 1.0.0")
@@ -284,14 +284,14 @@ RSpec.describe "bundle install with gems on multiple sources" do
# In https://github.com/rubygems/bundler/issues/3585 this failed
# when there is already a lock file, and the gems are missing, so try again
system_gems []
- bundle :install
+ bundle :install, :artifice => "compact_index"
expect(err).not_to include("Warning: the gem 'rack' was found in multiple sources.")
expect(the_bundle).to include_gems("depends_on_rack 1.0.1", "rack 1.0.0")
end
it "fails", :bundler => "3" do
- bundle :install, :raise_on_error => false
+ bundle :install, :artifice => "compact_index", :raise_on_error => false
expect(err).to include("Each source after the first must include a block")
expect(exitstatus).to eq(4)
end
@@ -308,360 +308,457 @@ RSpec.describe "bundle install with gems on multiple sources" do
end
gemfile <<-G
- source "#{file_uri_for(gem_repo2)}"
+ source "https://gem.repo2"
gem "private_gem_1"
- source "#{file_uri_for(gem_repo3)}" do
+ source "https://gem.repo3" do
gem "private_gem_2"
end
G
end
it "fails" do
- bundle :install, :raise_on_error => false
- expect(err).to include("Could not find gem 'private_gem_1' in rubygems repository #{file_uri_for(gem_repo2)}/ or installed locally.")
+ bundle :install, :artifice => "compact_index", :raise_on_error => false
+ expect(err).to include("Could not find gem 'private_gem_1' in rubygems repository https://gem.repo2/ or installed locally.")
expect(err).to include("The source does not contain any versions of 'private_gem_1'")
end
end
- context "when a top-level gem has an indirect dependency" do
- context "when disable_multisource is set" do
- before do
- bundle "config set disable_multisource true"
+ context "when an indirect dependency can't be found in the aggregate rubygems source", :bundler => "< 3" do
+ before do
+ build_repo2
+
+ build_repo gem_repo3 do
+ build_gem "depends_on_missing", "1.0.1" do |s|
+ s.add_dependency "missing"
+ end
end
- before do
- build_repo gem_repo2 do
- build_gem "depends_on_rack", "1.0.1" do |s|
- s.add_dependency "rack"
- end
+ gemfile <<-G
+ source "https://gem.repo2"
+
+ source "https://gem.repo3"
+
+ gem "depends_on_missing"
+ G
+ end
+
+ it "fails" do
+ bundle :install, :artifice => "compact_index", :raise_on_error => false
+ expect(err).to include("Could not find gem 'missing', which is required by gem 'depends_on_missing', in any of the sources.")
+ end
+ end
+
+ context "when a top-level gem has an indirect dependency" do
+ before do
+ build_repo gem_repo2 do
+ build_gem "depends_on_rack", "1.0.1" do |s|
+ s.add_dependency "rack"
end
+ end
+
+ build_repo gem_repo3 do
+ build_gem "unrelated_gem", "1.0.0"
+ end
- build_repo gem_repo3 do
- build_gem "unrelated_gem", "1.0.0"
+ gemfile <<-G
+ source "https://gem.repo2"
+
+ gem "depends_on_rack"
+
+ source "https://gem.repo3" do
+ gem "unrelated_gem"
end
+ G
+ end
- gemfile <<-G
- source "#{file_uri_for(gem_repo2)}"
+ context "and the dependency is only in the top-level source" do
+ before do
+ update_repo gem_repo2 do
+ build_gem "rack", "1.0.0"
+ end
+ end
- gem "depends_on_rack"
+ it "installs the dependency from the top-level source without warning" do
+ bundle :install, :artifice => "compact_index"
+ expect(err).not_to include("Warning")
+ expect(the_bundle).to include_gems("depends_on_rack 1.0.1", "rack 1.0.0", "unrelated_gem 1.0.0")
+ expect(the_bundle).to include_gems("depends_on_rack 1.0.1", "rack 1.0.0", :source => "remote2")
+ expect(the_bundle).to include_gems("unrelated_gem 1.0.0", :source => "remote3")
+ end
+ end
- source "#{file_uri_for(gem_repo3)}" do
- gem "unrelated_gem"
+ context "and the dependency is only in a pinned source" do
+ before do
+ update_repo gem_repo3 do
+ build_gem "rack", "1.0.0" do |s|
+ s.write "lib/rack.rb", "RACK = 'FAIL'"
end
- G
+ end
end
- context "and the dependency is only in the top-level source" do
- before do
- update_repo gem_repo2 do
- build_gem "rack", "1.0.0"
- end
+ it "does not find the dependency" do
+ bundle :install, :artifice => "compact_index", :raise_on_error => false
+ expect(err).to include(
+ "Could not find gem 'rack', which is required by gem 'depends_on_rack', in rubygems repository https://gem.repo2/ or installed locally."
+ )
+ end
+ end
+
+ context "and the dependency is in both the top-level and a pinned source" do
+ before do
+ update_repo gem_repo2 do
+ build_gem "rack", "1.0.0"
end
- it "installs all gems without warning" do
- bundle :install
- expect(err).not_to include("Warning")
- expect(the_bundle).to include_gems("depends_on_rack 1.0.1", "rack 1.0.0", "unrelated_gem 1.0.0")
+ update_repo gem_repo3 do
+ build_gem "rack", "1.0.0" do |s|
+ s.write "lib/rack.rb", "RACK = 'FAIL'"
+ end
end
end
- context "and the dependency is only in a pinned source" do
- before do
- update_repo gem_repo3 do
- build_gem "rack", "1.0.0" do |s|
- s.write "lib/rack.rb", "RACK = 'FAIL'"
- end
- end
+ it "installs the dependency from the top-level source without warning" do
+ bundle :install, :artifice => "compact_index"
+ expect(err).not_to include("Warning")
+ expect(run("require 'rack'; puts RACK")).to eq("1.0.0")
+ expect(the_bundle).to include_gems("depends_on_rack 1.0.1", "rack 1.0.0", "unrelated_gem 1.0.0")
+ expect(the_bundle).to include_gems("depends_on_rack 1.0.1", "rack 1.0.0", :source => "remote2")
+ expect(the_bundle).to include_gems("unrelated_gem 1.0.0", :source => "remote3")
+ end
+ end
+ end
+
+ context "when a scoped gem has a deeply nested indirect dependency" do
+ before do
+ build_repo gem_repo3 do
+ build_gem "depends_on_depends_on_rack", "1.0.1" do |s|
+ s.add_dependency "depends_on_rack"
end
- it "does not find the dependency" do
- bundle :install, :raise_on_error => false
- expect(err).to include("Could not find gem 'rack', which is required by gem 'depends_on_rack', in any of the relevant sources")
+ build_gem "depends_on_rack", "1.0.1" do |s|
+ s.add_dependency "rack"
end
end
- context "and the dependency is in both the top-level and a pinned source" do
- before do
- update_repo gem_repo2 do
- build_gem "rack", "1.0.0"
- end
+ gemfile <<-G
+ source "https://gem.repo2"
- update_repo gem_repo3 do
- build_gem "rack", "1.0.0" do |s|
- s.write "lib/rack.rb", "RACK = 'FAIL'"
- end
- end
+ source "https://gem.repo3" do
+ gem "depends_on_depends_on_rack"
end
+ G
+ end
- it "installs the dependency from the top-level source without warning" do
- bundle :install
- expect(err).not_to include("Warning")
- expect(the_bundle).to include_gems("depends_on_rack 1.0.1", "rack 1.0.0", "unrelated_gem 1.0.0")
+ context "and the dependency is only in the top-level source" do
+ before do
+ update_repo gem_repo2 do
+ build_gem "rack", "1.0.0"
end
end
+
+ it "installs the dependency from the top-level source" do
+ bundle :install, :artifice => "compact_index"
+ expect(the_bundle).to include_gems("depends_on_depends_on_rack 1.0.1", "depends_on_rack 1.0.1", "rack 1.0.0")
+ expect(the_bundle).to include_gems("rack 1.0.0", :source => "remote2")
+ expect(the_bundle).to include_gems("depends_on_depends_on_rack 1.0.1", "depends_on_rack 1.0.1", :source => "remote3")
+ end
end
- context "when the lockfile has aggregated rubygems sources and newer versions of dependencies are available" do
+ context "and the dependency is only in a pinned source" do
before do
- build_repo gem_repo2 do
- build_gem "activesupport", "6.0.3.4" do |s|
- s.add_dependency "concurrent-ruby", "~> 1.0", ">= 1.0.2"
- s.add_dependency "i18n", ">= 0.7", "< 2"
- s.add_dependency "minitest", "~> 5.1"
- s.add_dependency "tzinfo", "~> 1.1"
- s.add_dependency "zeitwerk", "~> 2.2", ">= 2.2.2"
- end
+ build_repo2
- build_gem "activesupport", "6.1.2.1" do |s|
- s.add_dependency "concurrent-ruby", "~> 1.0", ">= 1.0.2"
- s.add_dependency "i18n", ">= 1.6", "< 2"
- s.add_dependency "minitest", ">= 5.1"
- s.add_dependency "tzinfo", "~> 2.0"
- s.add_dependency "zeitwerk", "~> 2.3"
- end
+ update_repo gem_repo3 do
+ build_gem "rack", "1.0.0"
+ end
+ end
- build_gem "concurrent-ruby", "1.1.8"
- build_gem "concurrent-ruby", "1.1.9"
- build_gem "connection_pool", "2.2.3"
+ it "installs the dependency from the pinned source" do
+ bundle :install, :artifice => "compact_index"
+ expect(the_bundle).to include_gems("depends_on_depends_on_rack 1.0.1", "depends_on_rack 1.0.1", "rack 1.0.0", :source => "remote3")
+ end
+ end
- build_gem "i18n", "1.8.9" do |s|
- s.add_dependency "concurrent-ruby", "~> 1.0"
+ context "and the dependency is in both the top-level and a pinned source" do
+ before do
+ update_repo gem_repo2 do
+ build_gem "rack", "1.0.0" do |s|
+ s.write "lib/rack.rb", "RACK = 'FAIL'"
end
+ end
- build_gem "minitest", "5.14.3"
- build_gem "rack", "2.2.3"
- build_gem "redis", "4.2.5"
+ update_repo gem_repo3 do
+ build_gem "rack", "1.0.0"
+ end
+ end
- build_gem "sidekiq", "6.1.3" do |s|
- s.add_dependency "connection_pool", ">= 2.2.2"
- s.add_dependency "rack", "~> 2.0"
- s.add_dependency "redis", ">= 4.2.0"
- end
+ it "installs the dependency from the pinned source without warning" do
+ bundle :install, :artifice => "compact_index"
+ expect(the_bundle).to include_gems("depends_on_depends_on_rack 1.0.1", "depends_on_rack 1.0.1", "rack 1.0.0", :source => "remote3")
+ end
+ end
+ end
- build_gem "thread_safe", "0.3.6"
+ context "when the lockfile has aggregated rubygems sources and newer versions of dependencies are available" do
+ before do
+ build_repo gem_repo2 do
+ build_gem "activesupport", "6.0.3.4" do |s|
+ s.add_dependency "concurrent-ruby", "~> 1.0", ">= 1.0.2"
+ s.add_dependency "i18n", ">= 0.7", "< 2"
+ s.add_dependency "minitest", "~> 5.1"
+ s.add_dependency "tzinfo", "~> 1.1"
+ s.add_dependency "zeitwerk", "~> 2.2", ">= 2.2.2"
+ end
- build_gem "tzinfo", "1.2.9" do |s|
- s.add_dependency "thread_safe", "~> 0.1"
- end
+ build_gem "activesupport", "6.1.2.1" do |s|
+ s.add_dependency "concurrent-ruby", "~> 1.0", ">= 1.0.2"
+ s.add_dependency "i18n", ">= 1.6", "< 2"
+ s.add_dependency "minitest", ">= 5.1"
+ s.add_dependency "tzinfo", "~> 2.0"
+ s.add_dependency "zeitwerk", "~> 2.3"
+ end
- build_gem "tzinfo", "2.0.4" do |s|
- s.add_dependency "concurrent-ruby", "~> 1.0"
- end
+ build_gem "concurrent-ruby", "1.1.8"
+ build_gem "concurrent-ruby", "1.1.9"
+ build_gem "connection_pool", "2.2.3"
- build_gem "zeitwerk", "2.4.2"
+ build_gem "i18n", "1.8.9" do |s|
+ s.add_dependency "concurrent-ruby", "~> 1.0"
end
- build_repo gem_repo3 do
- build_gem "sidekiq-pro", "5.2.1" do |s|
- s.add_dependency "connection_pool", ">= 2.2.3"
- s.add_dependency "sidekiq", ">= 6.1.0"
- end
+ build_gem "minitest", "5.14.3"
+ build_gem "rack", "2.2.3"
+ build_gem "redis", "4.2.5"
+
+ build_gem "sidekiq", "6.1.3" do |s|
+ s.add_dependency "connection_pool", ">= 2.2.2"
+ s.add_dependency "rack", "~> 2.0"
+ s.add_dependency "redis", ">= 4.2.0"
end
- gemfile <<-G
- # frozen_string_literal: true
+ build_gem "thread_safe", "0.3.6"
- source "#{file_uri_for(gem_repo2)}"
+ build_gem "tzinfo", "1.2.9" do |s|
+ s.add_dependency "thread_safe", "~> 0.1"
+ end
- gem "activesupport"
+ build_gem "tzinfo", "2.0.4" do |s|
+ s.add_dependency "concurrent-ruby", "~> 1.0"
+ end
- source "#{file_uri_for(gem_repo3)}" do
- gem "sidekiq-pro"
- end
- G
+ build_gem "zeitwerk", "2.4.2"
+ end
- lockfile <<~L
- GEM
- remote: #{file_uri_for(gem_repo2)}/
- remote: #{file_uri_for(gem_repo3)}/
- specs:
- activesupport (6.0.3.4)
- concurrent-ruby (~> 1.0, >= 1.0.2)
- i18n (>= 0.7, < 2)
- minitest (~> 5.1)
- tzinfo (~> 1.1)
- zeitwerk (~> 2.2, >= 2.2.2)
- concurrent-ruby (1.1.8)
- connection_pool (2.2.3)
- i18n (1.8.9)
- concurrent-ruby (~> 1.0)
- minitest (5.14.3)
- rack (2.2.3)
- redis (4.2.5)
- sidekiq (6.1.3)
- connection_pool (>= 2.2.2)
- rack (~> 2.0)
- redis (>= 4.2.0)
- sidekiq-pro (5.2.1)
- connection_pool (>= 2.2.3)
- sidekiq (>= 6.1.0)
- thread_safe (0.3.6)
- tzinfo (1.2.9)
- thread_safe (~> 0.1)
- zeitwerk (2.4.2)
-
- PLATFORMS
- #{specific_local_platform}
-
- DEPENDENCIES
- activesupport
- sidekiq-pro!
-
- BUNDLED WITH
- #{Bundler::VERSION}
- L
+ build_repo gem_repo3 do
+ build_gem "sidekiq-pro", "5.2.1" do |s|
+ s.add_dependency "connection_pool", ">= 2.2.3"
+ s.add_dependency "sidekiq", ">= 6.1.0"
+ end
end
- it "does not install newer versions or generate lockfile changes when running bundle install, and warns", :bundler => "< 3" do
- initial_lockfile = lockfile
+ gemfile <<-G
+ # frozen_string_literal: true
- bundle :install
+ source "https://gem.repo2"
- expect(err).to include("Your lockfile contains a single rubygems source section with multiple remotes, which is insecure.")
+ gem "activesupport"
- expect(the_bundle).to include_gems("activesupport 6.0.3.4")
- expect(the_bundle).not_to include_gems("activesupport 6.1.2.1")
- expect(the_bundle).to include_gems("tzinfo 1.2.9")
- expect(the_bundle).not_to include_gems("tzinfo 2.0.4")
- expect(the_bundle).to include_gems("concurrent-ruby 1.1.8")
- expect(the_bundle).not_to include_gems("concurrent-ruby 1.1.9")
+ source "https://gem.repo3" do
+ gem "sidekiq-pro"
+ end
+ G
- expect(lockfile).to eq(initial_lockfile)
- end
+ lockfile <<~L
+ GEM
+ remote: https://gem.repo2/
+ remote: https://gem.repo3/
+ specs:
+ activesupport (6.0.3.4)
+ concurrent-ruby (~> 1.0, >= 1.0.2)
+ i18n (>= 0.7, < 2)
+ minitest (~> 5.1)
+ tzinfo (~> 1.1)
+ zeitwerk (~> 2.2, >= 2.2.2)
+ concurrent-ruby (1.1.8)
+ connection_pool (2.2.3)
+ i18n (1.8.9)
+ concurrent-ruby (~> 1.0)
+ minitest (5.14.3)
+ rack (2.2.3)
+ redis (4.2.5)
+ sidekiq (6.1.3)
+ connection_pool (>= 2.2.2)
+ rack (~> 2.0)
+ redis (>= 4.2.0)
+ sidekiq-pro (5.2.1)
+ connection_pool (>= 2.2.3)
+ sidekiq (>= 6.1.0)
+ thread_safe (0.3.6)
+ tzinfo (1.2.9)
+ thread_safe (~> 0.1)
+ zeitwerk (2.4.2)
- it "fails when running bundle install", :bundler => "3" do
- initial_lockfile = lockfile
+ PLATFORMS
+ #{specific_local_platform}
- bundle :install, :raise_on_error => false
+ DEPENDENCIES
+ activesupport
+ sidekiq-pro!
- expect(err).to include("Your lockfile contains a single rubygems source section with multiple remotes, which is insecure.")
+ BUNDLED WITH
+ #{Bundler::VERSION}
+ L
+ end
- expect(lockfile).to eq(initial_lockfile)
- end
+ it "does not install newer versions or generate lockfile changes when running bundle install, and warns", :bundler => "< 3" do
+ initial_lockfile = lockfile
- it "splits sections and upgrades gems when running bundle update, and doesn't warn" do
- bundle "update --all"
- expect(err).to be_empty
-
- expect(the_bundle).not_to include_gems("activesupport 6.0.3.4")
- expect(the_bundle).to include_gems("activesupport 6.1.2.1")
- expect(the_bundle).not_to include_gems("tzinfo 1.2.9")
- expect(the_bundle).to include_gems("tzinfo 2.0.4")
- expect(the_bundle).not_to include_gems("concurrent-ruby 1.1.8")
- expect(the_bundle).to include_gems("concurrent-ruby 1.1.9")
-
- expect(lockfile).to eq <<~L
- GEM
- remote: #{file_uri_for(gem_repo2)}/
- specs:
- activesupport (6.1.2.1)
- concurrent-ruby (~> 1.0, >= 1.0.2)
- i18n (>= 1.6, < 2)
- minitest (>= 5.1)
- tzinfo (~> 2.0)
- zeitwerk (~> 2.3)
- concurrent-ruby (1.1.9)
- connection_pool (2.2.3)
- i18n (1.8.9)
- concurrent-ruby (~> 1.0)
- minitest (5.14.3)
- rack (2.2.3)
- redis (4.2.5)
- sidekiq (6.1.3)
- connection_pool (>= 2.2.2)
- rack (~> 2.0)
- redis (>= 4.2.0)
- tzinfo (2.0.4)
- concurrent-ruby (~> 1.0)
- zeitwerk (2.4.2)
-
- GEM
- remote: #{file_uri_for(gem_repo3)}/
- specs:
- sidekiq-pro (5.2.1)
- connection_pool (>= 2.2.3)
- sidekiq (>= 6.1.0)
-
- PLATFORMS
- #{specific_local_platform}
-
- DEPENDENCIES
- activesupport
- sidekiq-pro!
-
- BUNDLED WITH
- #{Bundler::VERSION}
- L
- end
+ bundle :install, :artifice => "compact_index"
- it "it keeps the current lockfile format and upgrades the requested gem when running bundle update with an argument, and warns", :bundler => "< 3" do
- bundle "update concurrent-ruby"
- expect(err).to include("Your lockfile contains a single rubygems source section with multiple remotes, which is insecure.")
-
- expect(the_bundle).to include_gems("activesupport 6.0.3.4")
- expect(the_bundle).not_to include_gems("activesupport 6.1.2.1")
- expect(the_bundle).to include_gems("tzinfo 1.2.9")
- expect(the_bundle).not_to include_gems("tzinfo 2.0.4")
- expect(the_bundle).to include_gems("concurrent-ruby 1.1.9")
- expect(the_bundle).not_to include_gems("concurrent-ruby 1.1.8")
-
- expect(lockfile).to eq <<~L
- GEM
- remote: #{file_uri_for(gem_repo2)}/
- remote: #{file_uri_for(gem_repo3)}/
- specs:
- activesupport (6.0.3.4)
- concurrent-ruby (~> 1.0, >= 1.0.2)
- i18n (>= 0.7, < 2)
- minitest (~> 5.1)
- tzinfo (~> 1.1)
- zeitwerk (~> 2.2, >= 2.2.2)
- concurrent-ruby (1.1.9)
- connection_pool (2.2.3)
- i18n (1.8.9)
- concurrent-ruby (~> 1.0)
- minitest (5.14.3)
- rack (2.2.3)
- redis (4.2.5)
- sidekiq (6.1.3)
- connection_pool (>= 2.2.2)
- rack (~> 2.0)
- redis (>= 4.2.0)
- sidekiq-pro (5.2.1)
- connection_pool (>= 2.2.3)
- sidekiq (>= 6.1.0)
- thread_safe (0.3.6)
- tzinfo (1.2.9)
- thread_safe (~> 0.1)
- zeitwerk (2.4.2)
-
- PLATFORMS
- #{specific_local_platform}
-
- DEPENDENCIES
- activesupport
- sidekiq-pro!
-
- BUNDLED WITH
- #{Bundler::VERSION}
- L
- end
+ expect(err).to include("Your lockfile contains a single rubygems source section with multiple remotes, which is insecure.")
- it "fails when running bundle update with an argument", :bundler => "3" do
- initial_lockfile = lockfile
+ expect(the_bundle).to include_gems("activesupport 6.0.3.4")
+ expect(the_bundle).not_to include_gems("activesupport 6.1.2.1")
+ expect(the_bundle).to include_gems("tzinfo 1.2.9")
+ expect(the_bundle).not_to include_gems("tzinfo 2.0.4")
+ expect(the_bundle).to include_gems("concurrent-ruby 1.1.8")
+ expect(the_bundle).not_to include_gems("concurrent-ruby 1.1.9")
- bundle "update concurrent-ruby", :raise_on_error => false
+ expect(lockfile).to eq(initial_lockfile)
+ end
- expect(err).to include("Your lockfile contains a single rubygems source section with multiple remotes, which is insecure.")
+ it "fails when running bundle install", :bundler => "3" do
+ initial_lockfile = lockfile
- expect(lockfile).to eq(initial_lockfile)
- end
+ bundle :install, :artifice => "compact_index", :raise_on_error => false
+
+ expect(err).to include("Your lockfile contains a single rubygems source section with multiple remotes, which is insecure.")
+
+ expect(lockfile).to eq(initial_lockfile)
+ end
+
+ it "splits sections and upgrades gems when running bundle update, and doesn't warn" do
+ bundle "update --all", :artifice => "compact_index"
+ expect(err).to be_empty
+
+ expect(the_bundle).not_to include_gems("activesupport 6.0.3.4")
+ expect(the_bundle).to include_gems("activesupport 6.1.2.1")
+ expect(the_bundle).not_to include_gems("tzinfo 1.2.9")
+ expect(the_bundle).to include_gems("tzinfo 2.0.4")
+ expect(the_bundle).not_to include_gems("concurrent-ruby 1.1.8")
+ expect(the_bundle).to include_gems("concurrent-ruby 1.1.9")
+
+ expect(lockfile).to eq <<~L
+ GEM
+ remote: https://gem.repo2/
+ specs:
+ activesupport (6.1.2.1)
+ concurrent-ruby (~> 1.0, >= 1.0.2)
+ i18n (>= 1.6, < 2)
+ minitest (>= 5.1)
+ tzinfo (~> 2.0)
+ zeitwerk (~> 2.3)
+ concurrent-ruby (1.1.9)
+ connection_pool (2.2.3)
+ i18n (1.8.9)
+ concurrent-ruby (~> 1.0)
+ minitest (5.14.3)
+ rack (2.2.3)
+ redis (4.2.5)
+ sidekiq (6.1.3)
+ connection_pool (>= 2.2.2)
+ rack (~> 2.0)
+ redis (>= 4.2.0)
+ tzinfo (2.0.4)
+ concurrent-ruby (~> 1.0)
+ zeitwerk (2.4.2)
+
+ GEM
+ remote: https://gem.repo3/
+ specs:
+ sidekiq-pro (5.2.1)
+ connection_pool (>= 2.2.3)
+ sidekiq (>= 6.1.0)
+
+ PLATFORMS
+ #{specific_local_platform}
+
+ DEPENDENCIES
+ activesupport
+ sidekiq-pro!
+
+ BUNDLED WITH
+ #{Bundler::VERSION}
+ L
+ end
+
+ it "it keeps the current lockfile format and upgrades the requested gem when running bundle update with an argument, and warns", :bundler => "< 3" do
+ bundle "update concurrent-ruby", :artifice => "compact_index"
+ expect(err).to include("Your lockfile contains a single rubygems source section with multiple remotes, which is insecure.")
+
+ expect(the_bundle).to include_gems("activesupport 6.0.3.4")
+ expect(the_bundle).not_to include_gems("activesupport 6.1.2.1")
+ expect(the_bundle).to include_gems("tzinfo 1.2.9")
+ expect(the_bundle).not_to include_gems("tzinfo 2.0.4")
+ expect(the_bundle).to include_gems("concurrent-ruby 1.1.9")
+ expect(the_bundle).not_to include_gems("concurrent-ruby 1.1.8")
+
+ expect(lockfile).to eq <<~L
+ GEM
+ remote: https://gem.repo2/
+ remote: https://gem.repo3/
+ specs:
+ activesupport (6.0.3.4)
+ concurrent-ruby (~> 1.0, >= 1.0.2)
+ i18n (>= 0.7, < 2)
+ minitest (~> 5.1)
+ tzinfo (~> 1.1)
+ zeitwerk (~> 2.2, >= 2.2.2)
+ concurrent-ruby (1.1.9)
+ connection_pool (2.2.3)
+ i18n (1.8.9)
+ concurrent-ruby (~> 1.0)
+ minitest (5.14.3)
+ rack (2.2.3)
+ redis (4.2.5)
+ sidekiq (6.1.3)
+ connection_pool (>= 2.2.2)
+ rack (~> 2.0)
+ redis (>= 4.2.0)
+ sidekiq-pro (5.2.1)
+ connection_pool (>= 2.2.3)
+ sidekiq (>= 6.1.0)
+ thread_safe (0.3.6)
+ tzinfo (1.2.9)
+ thread_safe (~> 0.1)
+ zeitwerk (2.4.2)
+
+ PLATFORMS
+ #{specific_local_platform}
+
+ DEPENDENCIES
+ activesupport
+ sidekiq-pro!
+
+ BUNDLED WITH
+ #{Bundler::VERSION}
+ L
+ end
+
+ it "fails when running bundle update with an argument", :bundler => "3" do
+ initial_lockfile = lockfile
+
+ bundle "update concurrent-ruby", :artifice => "compact_index", :raise_on_error => false
+
+ expect(err).to include("Your lockfile contains a single rubygems source section with multiple remotes, which is insecure.")
+
+ expect(lockfile).to eq(initial_lockfile)
end
end
- context "when a top-level gem has an indirect dependency present in the default source, but with a different version from the one resolved", :bundler => "< 3" do
+ context "when a top-level gem has an indirect dependency present in the default source, but with a different version from the one resolved" do
before do
build_lib "activesupport", "7.0.0.alpha", :path => lib_path("rails/activesupport")
build_lib "rails", "7.0.0.alpha", :path => lib_path("rails") do |s|
@@ -677,7 +774,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
end
gemfile <<-G
- source "#{file_uri_for(gem_repo2)}"
+ source "https://gem.repo2"
gemspec :path => "#{lib_path("rails")}"
@@ -686,7 +783,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
end
it "installs all gems without warning" do
- bundle :install
+ bundle :install, :artifice => "compact_index"
expect(err).not_to include("Warning")
expect(the_bundle).to include_gems("activesupport 7.0.0.alpha", "rails 7.0.0.alpha")
expect(the_bundle).to include_gems("activesupport 7.0.0.alpha", :source => "path@#{lib_path("rails/activesupport")}")
@@ -711,9 +808,9 @@ RSpec.describe "bundle install with gems on multiple sources" do
end
gemfile <<-G
- source "#{file_uri_for(gem_repo2)}"
+ source "https://gem.repo2"
- source "#{file_uri_for(gem_repo3)}" do
+ source "https://gem.repo3" do
gem "handsoap"
end
@@ -724,14 +821,14 @@ RSpec.describe "bundle install with gems on multiple sources" do
it "installs from the default source without any warnings or errors and generates a proper lockfile" do
expected_lockfile = <<~L
GEM
- remote: #{file_uri_for(gem_repo2)}/
+ remote: https://gem.repo2/
specs:
nokogiri (1.11.1)
racca (~> 1.4)
racca (1.5.2)
GEM
- remote: #{file_uri_for(gem_repo3)}/
+ remote: https://gem.repo3/
specs:
handsoap (0.2.5.5)
nokogiri (>= 1.2.3)
@@ -747,7 +844,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
#{Bundler::VERSION}
L
- bundle "install --verbose"
+ bundle "install --verbose", :artifice => "compact_index"
expect(err).not_to include("Warning")
expect(the_bundle).to include_gems("handsoap 0.2.5.5", "nokogiri 1.11.1", "racca 1.5.2")
expect(the_bundle).to include_gems("handsoap 0.2.5.5", :source => "remote3")
@@ -756,7 +853,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
# Even if the gems are already installed
FileUtils.rm bundled_app_lock
- bundle "install --verbose"
+ bundle "install --verbose", :artifice => "compact_index"
expect(err).not_to include("Warning")
expect(the_bundle).to include_gems("handsoap 0.2.5.5", "nokogiri 1.11.1", "racca 1.5.2")
expect(the_bundle).to include_gems("handsoap 0.2.5.5", :source => "remote3")
@@ -771,9 +868,9 @@ RSpec.describe "bundle install with gems on multiple sources" do
build_gem "not_in_repo1", "1.0.0"
end
- install_gemfile <<-G, :raise_on_error => false
- source "#{file_uri_for(gem_repo3)}"
- gem "not_in_repo1", :source => "#{file_uri_for(gem_repo1)}"
+ install_gemfile <<-G, :artifice => "compact_index", :raise_on_error => false
+ source "https://gem.repo3"
+ gem "not_in_repo1", :source => "https://gem.repo1"
G
end
@@ -788,11 +885,11 @@ RSpec.describe "bundle install with gems on multiple sources" do
lockfile <<-L
GEM
- remote: #{file_uri_for(gem_repo1)}
+ remote: https://gem.repo1
specs:
GEM
- remote: #{file_uri_for(gem_repo3)}
+ remote: https://gem.repo3
specs:
rack (0.9.1)
@@ -804,8 +901,8 @@ RSpec.describe "bundle install with gems on multiple sources" do
L
gemfile <<-G
- source "#{file_uri_for(gem_repo1)}"
- source "#{file_uri_for(gem_repo3)}" do
+ source "https://gem.repo1"
+ source "https://gem.repo3" do
gem 'rack'
end
G
@@ -821,8 +918,8 @@ RSpec.describe "bundle install with gems on multiple sources" do
let(:aggregate_gem_section_lockfile) do
<<~L
GEM
- remote: #{file_uri_for(gem_repo1)}/
- remote: #{file_uri_for(gem_repo3)}/
+ remote: https://gem.repo1/
+ remote: https://gem.repo3/
specs:
rack (0.9.1)
@@ -840,11 +937,11 @@ RSpec.describe "bundle install with gems on multiple sources" do
let(:split_gem_section_lockfile) do
<<~L
GEM
- remote: #{file_uri_for(gem_repo1)}/
+ remote: https://gem.repo1/
specs:
GEM
- remote: #{file_uri_for(gem_repo3)}/
+ remote: https://gem.repo3/
specs:
rack (0.9.1)
@@ -865,8 +962,8 @@ RSpec.describe "bundle install with gems on multiple sources" do
end
gemfile <<-G
- source "#{file_uri_for(gem_repo1)}"
- source "#{file_uri_for(gem_repo3)}" do
+ source "https://gem.repo1"
+ source "https://gem.repo3" do
gem 'rack'
end
G
@@ -877,7 +974,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
it "installs the existing lockfile but prints a warning", :bundler => "< 3" do
bundle "config set --local deployment true"
- bundle "install"
+ bundle "install", :artifice => "compact_index"
expect(lockfile).to eq(aggregate_gem_section_lockfile)
expect(err).to include("Your lockfile contains a single rubygems source section with multiple remotes, which is insecure.")
@@ -887,7 +984,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
it "refuses to install the existing lockfile and prints an error", :bundler => "3" do
bundle "config set --local deployment true"
- bundle "install", :raise_on_error =>false
+ bundle "install", :artifice => "compact_index", :raise_on_error =>false
expect(lockfile).to eq(aggregate_gem_section_lockfile)
expect(err).to include("Your lockfile contains a single rubygems source section with multiple remotes, which is insecure.")
@@ -900,13 +997,13 @@ RSpec.describe "bundle install with gems on multiple sources" do
build_lib "foo"
gemfile <<-G
- gem "rack", :source => "#{file_uri_for(gem_repo1)}"
+ gem "rack", :source => "https://gem.repo1"
gem "foo", :path => "#{lib_path("foo-1.0")}"
G
end
it "does not unlock the non-path gem after install" do
- bundle :install
+ bundle :install, :artifice => "compact_index"
bundle %(exec ruby -e 'puts "OK"')
@@ -919,8 +1016,8 @@ RSpec.describe "bundle install with gems on multiple sources" do
before do
system_gems "rack-0.9.1"
- install_gemfile <<-G
- source "#{file_uri_for(gem_repo1)}"
+ install_gemfile <<-G, :artifice => "compact_index"
+ source "https://gem.repo1"
gem "rack" # should come from repo1!
G
end
@@ -941,14 +1038,14 @@ RSpec.describe "bundle install with gems on multiple sources" do
# Installing this gemfile...
gemfile <<-G
- source '#{file_uri_for(gem_repo1)}'
+ source 'https://gem.repo1'
gem 'rack'
- gem 'foo', '~> 0.1', :source => '#{file_uri_for(gem_repo4)}'
- gem 'bar', '~> 0.1', :source => '#{file_uri_for(gem_repo4)}'
+ gem 'foo', '~> 0.1', :source => 'https://gem.repo4'
+ gem 'bar', '~> 0.1', :source => 'https://gem.repo4'
G
- bundle "config --local path ../gems/system"
- bundle :install
+ bundle "config set --local path ../gems/system"
+ bundle :install, :artifice => "compact_index"
# And then we add some new versions...
update_repo4 do
@@ -959,11 +1056,11 @@ RSpec.describe "bundle install with gems on multiple sources" do
it "allows them to be unlocked separately" do
# And install this gemfile, updating only foo.
- install_gemfile <<-G
- source '#{file_uri_for(gem_repo1)}'
+ install_gemfile <<-G, :artifice => "compact_index"
+ source 'https://gem.repo1'
gem 'rack'
- gem 'foo', '~> 0.2', :source => '#{file_uri_for(gem_repo4)}'
- gem 'bar', '~> 0.1', :source => '#{file_uri_for(gem_repo4)}'
+ gem 'foo', '~> 0.2', :source => 'https://gem.repo4'
+ gem 'bar', '~> 0.1', :source => 'https://gem.repo4'
G
# It should update foo to 0.2, but not the (locked) bar 0.1
@@ -983,11 +1080,11 @@ RSpec.describe "bundle install with gems on multiple sources" do
build_git "git1"
build_git "git2"
- install_gemfile <<-G
- source "#{file_uri_for(gem_repo1)}"
+ install_gemfile <<-G, :artifice => "compact_index"
+ source "https://gem.repo1"
gem "rails"
- source "#{file_uri_for(gem_repo3)}" do
+ source "https://gem.repo3" do
gem "rack"
end
@@ -999,7 +1096,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
end
it "does not re-resolve" do
- bundle :install, :verbose => true
+ bundle :install, :artifice => "compact_index", :verbose => true
expect(out).to include("using resolution from the lockfile")
expect(out).not_to include("re-resolving dependencies")
end
@@ -1008,27 +1105,24 @@ RSpec.describe "bundle install with gems on multiple sources" do
context "when a gem is installed to system gems" do
before do
- install_gemfile <<-G
- source "#{file_uri_for(gem_repo1)}"
+ install_gemfile <<-G, :artifice => "compact_index"
+ source "https://gem.repo1"
gem "rack"
G
end
context "and the gemfile changes" do
it "is still able to find that gem from remote sources" do
- source_uri = file_uri_for(gem_repo1)
- second_uri = file_uri_for(gem_repo4)
-
build_repo4 do
build_gem "rack", "2.0.1.1.forked"
build_gem "thor", "0.19.1.1.forked"
end
# When this gemfile is installed...
- install_gemfile <<-G
- source "#{source_uri}"
+ install_gemfile <<-G, :artifice => "compact_index"
+ source "https://gem.repo1"
- source "#{second_uri}" do
+ source "https://gem.repo4" do
gem "rack", "2.0.1.1.forked"
gem "thor"
end
@@ -1037,9 +1131,9 @@ RSpec.describe "bundle install with gems on multiple sources" do
# Then we change the Gemfile by adding a version to thor
gemfile <<-G
- source "#{source_uri}"
+ source "https://gem.repo1"
- source "#{second_uri}" do
+ source "https://gem.repo4" do
gem "rack", "2.0.1.1.forked"
gem "thor", "0.19.1.1.forked"
end
@@ -1047,15 +1141,15 @@ RSpec.describe "bundle install with gems on multiple sources" do
G
# But we should still be able to find rack 2.0.1.1.forked and install it
- bundle :install
+ bundle :install, :artifice => "compact_index"
end
end
end
describe "source changed to one containing a higher version of a dependency" do
before do
- install_gemfile <<-G
- source "#{file_uri_for(gem_repo1)}"
+ install_gemfile <<-G, :artifice => "compact_index"
+ source "https://gem.repo1"
gem "rack"
G
@@ -1072,8 +1166,8 @@ RSpec.describe "bundle install with gems on multiple sources" do
s.add_dependency "bar", "=1.0.0"
end
- install_gemfile <<-G
- source "#{file_uri_for(gem_repo2)}"
+ install_gemfile <<-G, :artifice => "compact_index"
+ source "https://gem.repo2"
gem "rack"
gemspec :path => "#{tmp.join("gemspec_test")}"
G
@@ -1093,10 +1187,10 @@ RSpec.describe "bundle install with gems on multiple sources" do
build_gem "example", "1.0.2"
end
- install_gemfile <<-G
- source "#{file_uri_for(gem_repo4)}"
+ install_gemfile <<-G, :artifice => "compact_index"
+ source "https://gem.repo4"
- gem "example", :source => "#{file_uri_for(gem_repo2)}"
+ gem "example", :source => "https://gem.repo2"
G
bundle "info example"
@@ -1104,12 +1198,41 @@ RSpec.describe "bundle install with gems on multiple sources" do
system_gems "example-1.0.2", :path => default_bundle_path, :gem_repo => gem_repo4
- bundle "update example --verbose"
+ bundle "update example --verbose", :artifice => "compact_index"
expect(out).not_to include("Using example 1.0.2")
expect(out).to include("Using example 0.1.0")
end
- context "when a gem is available from multiple ambiguous sources", :bundler => "3" do
+ context "when an indirect dependency is available from multiple ambiguous sources", :bundler => "< 3" do
+ it "succeeds but warns, suggesting a source block" do
+ build_repo4 do
+ build_gem "depends_on_rack" do |s|
+ s.add_dependency "rack"
+ end
+ build_gem "rack"
+ end
+
+ install_gemfile <<-G, :artifice => "compact_index", :raise_on_error => false
+ source "https://gem.repo4" do
+ gem "depends_on_rack"
+ end
+
+ source "https://gem.repo1" do
+ gem "thin"
+ end
+ G
+ expect(err).to eq strip_whitespace(<<-EOS).strip
+ Warning: The gem 'rack' was found in multiple relevant sources.
+ * rubygems repository https://gem.repo1/ or installed locally
+ * rubygems repository https://gem.repo4/ or installed locally
+ You should add this gem to the source block for the source you wish it to be installed from.
+ EOS
+ expect(last_command).to be_success
+ expect(the_bundle).to be_locked
+ end
+ end
+
+ context "when an indirect dependency is available from multiple ambiguous sources", :bundler => "3" do
it "raises, suggesting a source block" do
build_repo4 do
build_gem "depends_on_rack" do |s|
@@ -1118,18 +1241,19 @@ RSpec.describe "bundle install with gems on multiple sources" do
build_gem "rack"
end
- install_gemfile <<-G, :raise_on_error => false
- source "#{file_uri_for(gem_repo4)}"
- source "#{file_uri_for(gem_repo1)}" do
+ install_gemfile <<-G, :artifice => "compact_index", :raise_on_error => false
+ source "https://gem.repo4" do
+ gem "depends_on_rack"
+ end
+ source "https://gem.repo1" do
gem "thin"
end
- gem "depends_on_rack"
G
expect(last_command).to be_failure
expect(err).to eq strip_whitespace(<<-EOS).strip
The gem 'rack' was found in multiple relevant sources.
- * rubygems repository #{file_uri_for(gem_repo1)}/ or installed locally
- * rubygems repository #{file_uri_for(gem_repo4)}/ or installed locally
+ * rubygems repository https://gem.repo1/ or installed locally
+ * rubygems repository https://gem.repo4/ or installed locally
You must add this gem to the source block for the source you wish it to be installed from.
EOS
expect(the_bundle).not_to be_locked
diff --git a/spec/bundler/install/gemfile/specific_platform_spec.rb b/spec/bundler/install/gemfile/specific_platform_spec.rb
index a5b78443b9..c6e526a95e 100644
--- a/spec/bundler/install/gemfile/specific_platform_spec.rb
+++ b/spec/bundler/install/gemfile/specific_platform_spec.rb
@@ -141,10 +141,10 @@ RSpec.describe "bundle install with specific platforms" do
2.1.4
L
- bundle "install --verbose", :artifice => :compact_index, :env => { "BUNDLER_VERSION" => "2.1.4", "BUNDLER_SPEC_GEM_REPO" => gem_repo2.to_s }
+ bundle "install --verbose", :artifice => "compact_index", :env => { "BUNDLER_VERSION" => "2.1.4", "BUNDLER_SPEC_GEM_REPO" => gem_repo2.to_s }
expect(out).to include("Installing libv8 8.4.255.0 (universal-darwin)")
- bundle "add mini_racer --verbose", :artifice => :compact_index, :env => { "BUNDLER_SPEC_GEM_REPO" => gem_repo2.to_s }
+ bundle "add mini_racer --verbose", :artifice => "compact_index", :env => { "BUNDLER_SPEC_GEM_REPO" => gem_repo2.to_s }
expect(out).to include("Using libv8 8.4.255.0 (universal-darwin)")
end
diff --git a/spec/bundler/install/gems/compact_index_spec.rb b/spec/bundler/install/gems/compact_index_spec.rb
index 5e2b0267ae..8be97ed5d2 100644
--- a/spec/bundler/install/gems/compact_index_spec.rb
+++ b/spec/bundler/install/gems/compact_index_spec.rb
@@ -80,8 +80,8 @@ RSpec.describe "compact index api" do
G
bundle :install, :artifice => "compact_index"
- bundle "config --local deployment true"
- bundle "config --local path vendor/bundle"
+ bundle "config set --local deployment true"
+ bundle "config set --local path vendor/bundle"
bundle :install, :artifice => "compact_index"
expect(out).to include("Fetching gem metadata from #{source_uri}")
expect(the_bundle).to include_gems "rack 1.0.0"
@@ -118,7 +118,7 @@ RSpec.describe "compact index api" do
bundle :install, :artifice => "compact_index"
- bundle "config --local deployment true"
+ bundle "config set --local deployment true"
bundle :install, :artifice => "compact_index"
expect(the_bundle).to include_gems("rails 2.3.2")
@@ -132,7 +132,7 @@ RSpec.describe "compact index api" do
G
bundle "install", :artifice => "compact_index"
- bundle "config --local deployment true"
+ bundle "config set --local deployment true"
bundle :install, :artifice => "compact_index"
expect(the_bundle).to include_gems("foo 1.0")
@@ -366,31 +366,6 @@ The checksum of /versions does not match the checksum provided by the server! So
expect(the_bundle).to include_gems "activesupport 1.2.3"
end
- it "considers all possible versions of dependencies from all api gem sources when using blocks", :bundler => "< 3" do
- # In this scenario, the gem "somegem" only exists in repo4. It depends on specific version of activesupport that
- # exists only in repo1. There happens also be a version of activesupport in repo4, but not the one that version 1.0.0
- # of somegem wants. This test makes sure that bundler actually finds version 1.2.3 of active support in the other
- # repo and installs it.
- build_repo4 do
- build_gem "activesupport", "1.2.0"
- build_gem "somegem", "1.0.0" do |s|
- s.add_dependency "activesupport", "1.2.3" # This version exists only in repo1
- end
- end
-
- gemfile <<-G
- source "#{source_uri}"
- source "#{source_uri}/extra" do
- gem 'somegem', '1.0.0'
- end
- G
-
- bundle :install, :artifice => "compact_index_extra_api"
-
- expect(the_bundle).to include_gems "somegem 1.0.0"
- expect(the_bundle).to include_gems "activesupport 1.2.3"
- end
-
it "prints API output properly with back deps" do
build_repo2 do
build_gem "back_deps" do |s|
@@ -467,7 +442,7 @@ The checksum of /versions does not match the checksum provided by the server! So
expect(the_bundle).to include_gems "foo 1.0"
end
- it "fetches again when more dependencies are found in subsequent sources using --deployment", :bundler => "< 3" do
+ it "fetches again when more dependencies are found in subsequent sources using deployment mode", :bundler => "< 3" do
build_repo2 do
build_gem "back_deps" do |s|
s.add_dependency "foo"
@@ -482,8 +457,8 @@ The checksum of /versions does not match the checksum provided by the server! So
G
bundle :install, :artifice => "compact_index_extra"
-
- bundle "install --deployment", :artifice => "compact_index_extra"
+ bundle "config --set local deployment true"
+ bundle :install, :artifice => "compact_index_extra"
expect(the_bundle).to include_gems "back_deps 1.0"
end
@@ -503,7 +478,7 @@ The checksum of /versions does not match the checksum provided by the server! So
G
bundle :install, :artifice => "compact_index_extra"
- bundle "config --local deployment true"
+ bundle "config set --local deployment true"
bundle :install, :artifice => "compact_index_extra"
expect(the_bundle).to include_gems "back_deps 1.0"
end
diff --git a/spec/bundler/install/gems/dependency_api_spec.rb b/spec/bundler/install/gems/dependency_api_spec.rb
index 0b6e6f0368..eae8daa682 100644
--- a/spec/bundler/install/gems/dependency_api_spec.rb
+++ b/spec/bundler/install/gems/dependency_api_spec.rb
@@ -60,8 +60,8 @@ RSpec.describe "gemcutter's dependency API" do
G
bundle :install, :artifice => "endpoint"
- bundle "config --local deployment true"
- bundle "config --local path vendor/bundle"
+ bundle "config set --local deployment true"
+ bundle "config set --local path vendor/bundle"
bundle :install, :artifice => "endpoint"
expect(out).to include("Fetching gem metadata from #{source_uri}")
expect(the_bundle).to include_gems "rack 1.0.0"
@@ -98,7 +98,7 @@ RSpec.describe "gemcutter's dependency API" do
bundle :install, :artifice => "endpoint"
- bundle "config --local deployment true"
+ bundle "config set --local deployment true"
bundle :install, :artifice => "endpoint"
expect(the_bundle).to include_gems("rails 2.3.2")
@@ -112,7 +112,7 @@ RSpec.describe "gemcutter's dependency API" do
G
bundle "install", :artifice => "endpoint"
- bundle "config --local deployment true"
+ bundle "config set --local deployment true"
bundle :install, :artifice => "endpoint"
expect(the_bundle).to include_gems("foo 1.0")
@@ -338,31 +338,6 @@ RSpec.describe "gemcutter's dependency API" do
expect(the_bundle).to include_gems "activesupport 1.2.3"
end
- it "considers all possible versions of dependencies from all api gem sources using blocks" do
- # In this scenario, the gem "somegem" only exists in repo4. It depends on specific version of activesupport that
- # exists only in repo1. There happens also be a version of activesupport in repo4, but not the one that version 1.0.0
- # of somegem wants. This test makes sure that bundler actually finds version 1.2.3 of active support in the other
- # repo and installs it.
- build_repo4 do
- build_gem "activesupport", "1.2.0"
- build_gem "somegem", "1.0.0" do |s|
- s.add_dependency "activesupport", "1.2.3" # This version exists only in repo1
- end
- end
-
- gemfile <<-G
- source "#{source_uri}"
- source "#{source_uri}/extra" do
- gem 'somegem', '1.0.0'
- end
- G
-
- bundle :install, :artifice => "endpoint_extra_api"
-
- expect(the_bundle).to include_gems "somegem 1.0.0"
- expect(the_bundle).to include_gems "activesupport 1.2.3"
- end
-
it "prints API output properly with back deps" do
build_repo2 do
build_gem "back_deps" do |s|
@@ -438,7 +413,7 @@ RSpec.describe "gemcutter's dependency API" do
expect(the_bundle).to include_gems "foo 1.0"
end
- it "fetches again when more dependencies are found in subsequent sources using --deployment", :bundler => "< 3" do
+ it "fetches again when more dependencies are found in subsequent sources using deployment mode", :bundler => "< 3" do
build_repo2 do
build_gem "back_deps" do |s|
s.add_dependency "foo"
@@ -453,8 +428,8 @@ RSpec.describe "gemcutter's dependency API" do
G
bundle :install, :artifice => "endpoint_extra"
-
- bundle "install --deployment", :artifice => "endpoint_extra"
+ bundle "config set --local deployment true"
+ bundle :install, :artifice => "endpoint_extra"
expect(the_bundle).to include_gems "back_deps 1.0"
end
@@ -474,8 +449,7 @@ RSpec.describe "gemcutter's dependency API" do
G
bundle :install, :artifice => "endpoint_extra"
-
- bundle "config --local deployment true"
+ bundle "config set --local deployment true"
bundle "install", :artifice => "endpoint_extra"
expect(the_bundle).to include_gems "back_deps 1.0"
end
diff --git a/spec/bundler/install/gems/standalone_spec.rb b/spec/bundler/install/gems/standalone_spec.rb
index 0a0f992704..08d5276a54 100644
--- a/spec/bundler/install/gems/standalone_spec.rb
+++ b/spec/bundler/install/gems/standalone_spec.rb
@@ -94,7 +94,7 @@ RSpec.shared_examples "bundle install --standalone" do
source "#{file_uri_for(gem_repo1)}"
gem "rails"
G
- bundle "config --local path #{bundled_app("bundle")}"
+ bundle "config set --local path #{bundled_app("bundle")}"
bundle :install, :standalone => true, :dir => cwd
end
@@ -110,7 +110,7 @@ RSpec.shared_examples "bundle install --standalone" do
describe "with gems with native extension", :ruby_repo do
before do
- bundle "config --local path #{bundled_app("bundle")}"
+ bundle "config set --local path #{bundled_app("bundle")}"
install_gemfile <<-G, :standalone => true, :dir => cwd
source "#{file_uri_for(gem_repo1)}"
gem "very_simple_binary"
@@ -144,7 +144,7 @@ RSpec.shared_examples "bundle install --standalone" do
end
G
end
- bundle "config --local path #{bundled_app("bundle")}"
+ bundle "config set --local path #{bundled_app("bundle")}"
install_gemfile <<-G, :standalone => true, :dir => cwd, :raise_on_error => false
gem "bar", :git => "#{lib_path("bar-1.0")}"
G
@@ -165,7 +165,7 @@ RSpec.shared_examples "bundle install --standalone" do
gem "rails"
gem "devise", :git => "#{lib_path("devise-1.0")}"
G
- bundle "config --local path #{bundled_app("bundle")}"
+ bundle "config set --local path #{bundled_app("bundle")}"
bundle :install, :standalone => true, :dir => cwd
end
@@ -193,7 +193,7 @@ RSpec.shared_examples "bundle install --standalone" do
gem "rack-test"
end
G
- bundle "config --local path #{bundled_app("bundle")}"
+ bundle "config set --local path #{bundled_app("bundle")}"
bundle :install, :standalone => true, :dir => cwd
end
@@ -207,7 +207,7 @@ RSpec.shared_examples "bundle install --standalone" do
include_examples "common functionality"
it "allows creating a standalone file with limited groups" do
- bundle "config --local path #{bundled_app("bundle")}"
+ bundle "config set --local path #{bundled_app("bundle")}"
bundle :install, :standalone => "default", :dir => cwd
load_error_ruby <<-RUBY, "spec"
@@ -224,8 +224,8 @@ RSpec.shared_examples "bundle install --standalone" do
end
it "allows `without` configuration to limit the groups used in a standalone" do
- bundle "config --local path #{bundled_app("bundle")}"
- bundle "config --local without test"
+ bundle "config set --local path #{bundled_app("bundle")}"
+ bundle "config set --local without test"
bundle :install, :standalone => true, :dir => cwd
load_error_ruby <<-RUBY, "spec"
@@ -242,7 +242,7 @@ RSpec.shared_examples "bundle install --standalone" do
end
it "allows `path` configuration to change the location of the standalone bundle" do
- bundle "config --local path path/to/bundle"
+ bundle "config set --local path path/to/bundle"
bundle "install", :standalone => true, :dir => cwd
ruby <<-RUBY
@@ -257,9 +257,9 @@ RSpec.shared_examples "bundle install --standalone" do
end
it "allows `without` to limit the groups used in a standalone" do
- bundle "config --local without test"
+ bundle "config set --local without test"
bundle :install, :dir => cwd
- bundle "config --local path #{bundled_app("bundle")}"
+ bundle "config set --local path #{bundled_app("bundle")}"
bundle :install, :standalone => true, :dir => cwd
load_error_ruby <<-RUBY, "spec"
@@ -285,7 +285,7 @@ RSpec.shared_examples "bundle install --standalone" do
source "#{source_uri}"
gem "rails"
G
- bundle "config --local path #{bundled_app("bundle")}"
+ bundle "config set --local path #{bundled_app("bundle")}"
bundle :install, :standalone => true, :artifice => "endpoint", :dir => cwd
end
@@ -306,7 +306,7 @@ RSpec.shared_examples "bundle install --standalone" do
source "#{file_uri_for(gem_repo1)}"
gem "rails"
G
- bundle "config --local path #{bundled_app("bundle")}"
+ bundle "config set --local path #{bundled_app("bundle")}"
bundle :install, :standalone => true, :binstubs => true, :dir => cwd
end
diff --git a/spec/bundler/install/git_spec.rb b/spec/bundler/install/git_spec.rb
index 484959dc2a..4a3827eafd 100644
--- a/spec/bundler/install/git_spec.rb
+++ b/spec/bundler/install/git_spec.rb
@@ -68,8 +68,8 @@ RSpec.describe "bundle install" do
foo!
L
- bundle "config --local path vendor/bundle"
- bundle "config --local without development"
+ bundle "config set --local path vendor/bundle"
+ bundle "config set --local without development"
bundle :install
expect(out).to include("Bundle complete!")
diff --git a/spec/bundler/install/path_spec.rb b/spec/bundler/install/path_spec.rb
index a05467db12..b0392c4ed2 100644
--- a/spec/bundler/install/path_spec.rb
+++ b/spec/bundler/install/path_spec.rb
@@ -14,14 +14,14 @@ RSpec.describe "bundle install" do
end
it "does not use available system gems with `vendor/bundle" do
- bundle "config --local path vendor/bundle"
+ bundle "config set --local path vendor/bundle"
bundle :install
expect(the_bundle).to include_gems "rack 1.0.0"
end
it "uses system gems with `path.system` configured with more priority than `path`" do
- bundle "config --local path.system true"
- bundle "config --global path vendor/bundle"
+ bundle "config set --local path.system true"
+ bundle "config set --global path vendor/bundle"
bundle :install
run "require 'rack'", :raise_on_error => false
expect(out).to include("FAIL")
@@ -31,7 +31,7 @@ RSpec.describe "bundle install" do
dir = bundled_app("bun++dle")
dir.mkpath
- bundle "config --local path #{dir.join("vendor/bundle")}"
+ bundle "config set --local path #{dir.join("vendor/bundle")}"
bundle :install, :dir => dir
expect(out).to include("installed into `./vendor/bundle`")
@@ -39,7 +39,7 @@ RSpec.describe "bundle install" do
end
it "prints a message to let the user know where gems where installed" do
- bundle "config --local path vendor/bundle"
+ bundle "config set --local path vendor/bundle"
bundle :install
expect(out).to include("gems are installed into `./vendor/bundle`")
end
@@ -109,7 +109,7 @@ RSpec.describe "bundle install" do
context "when set via #{type}" do
it "installs gems to a path if one is specified" do
set_bundle_path(type, bundled_app("vendor2").to_s)
- bundle "config --local path vendor/bundle"
+ bundle "config set --local path vendor/bundle"
bundle :install
expect(vendored_gems("gems/rack-1.0.0")).to be_directory
@@ -159,7 +159,7 @@ RSpec.describe "bundle install" do
end
it "sets BUNDLE_PATH as the first argument to bundle install" do
- bundle "config --local path ./vendor/bundle"
+ bundle "config set --local path ./vendor/bundle"
bundle :install
expect(vendored_gems("gems/rack-1.0.0")).to be_directory
@@ -169,7 +169,7 @@ RSpec.describe "bundle install" do
it "disables system gems when passing a path to install" do
# This is so that vendored gems can be distributed to others
build_gem "rack", "1.1.0", :to_system => true
- bundle "config --local path ./vendor/bundle"
+ bundle "config set --local path ./vendor/bundle"
bundle :install
expect(vendored_gems("gems/rack-1.0.0")).to be_directory
@@ -186,7 +186,7 @@ RSpec.describe "bundle install" do
gem "very_simple_binary"
G
- bundle "config --local path ./vendor/bundle"
+ bundle "config set --local path ./vendor/bundle"
bundle :install
expect(vendored_gems("gems/very_simple_binary-1.0")).to be_directory
@@ -198,7 +198,7 @@ RSpec.describe "bundle install" do
run "require 'very_simple_binary_c'", :raise_on_error => false
expect(err).to include("Bundler::GemNotFound")
- bundle "config --local path ./vendor/bundle"
+ bundle "config set --local path ./vendor/bundle"
bundle :install
expect(vendored_gems("gems/very_simple_binary-1.0")).to be_directory
@@ -218,7 +218,7 @@ RSpec.describe "bundle install" do
gem "rack"
G
- bundle "config --local path bundle"
+ bundle "config set --local path bundle"
bundle :install, :raise_on_error => false
expect(err).to include("file already exists")
end
diff --git a/spec/bundler/lock/lockfile_spec.rb b/spec/bundler/lock/lockfile_spec.rb
index 7ef85ecf13..0fbe9ee80d 100644
--- a/spec/bundler/lock/lockfile_spec.rb
+++ b/spec/bundler/lock/lockfile_spec.rb
@@ -1193,7 +1193,7 @@ RSpec.describe "the lockfile format" do
gem "omg", :git => "#{lib_path("omg")}", :branch => 'master'
G
- bundle "config --local path vendor"
+ bundle "config set --local path vendor"
bundle :install
expect(the_bundle).to include_gems "omg 1.0"
@@ -1347,7 +1347,7 @@ RSpec.describe "the lockfile format" do
expect do
ruby <<-RUBY
- require '#{lib_dir}/bundler'
+ require '#{entrypoint}'
Bundler.setup
RUBY
end.not_to change { File.mtime(bundled_app_lock) }
diff --git a/spec/bundler/other/major_deprecation_spec.rb b/spec/bundler/other/major_deprecation_spec.rb
index 7dbb80af80..41d8ef56bc 100644
--- a/spec/bundler/other/major_deprecation_spec.rb
+++ b/spec/bundler/other/major_deprecation_spec.rb
@@ -439,7 +439,7 @@ RSpec.describe "major deprecations" do
G
ruby <<-RUBY
- require '#{lib_dir}/bundler'
+ require '#{entrypoint}'
Bundler.setup
Bundler.setup
@@ -547,18 +547,6 @@ The :gist git source is deprecated, and will be removed in the future. Add this
G
end
- context "without flags" do
- before do
- bundle :show
- end
-
- it "prints a deprecation warning recommending `bundle list`", :bundler => "< 3" do
- expect(deprecations).to include("use `bundle list` instead of `bundle show`")
- end
-
- pending "fails with a helpful message", :bundler => "3"
- end
-
context "with --outdated flag" do
before do
bundle "show --outdated"
@@ -570,54 +558,6 @@ The :gist git source is deprecated, and will be removed in the future. Add this
pending "fails with a helpful message", :bundler => "3"
end
-
- context "with --verbose flag" do
- before do
- bundle "show --verbose"
- end
-
- it "prints a deprecation warning informing about its removal", :bundler => "< 3" do
- expect(deprecations).to include("the `--verbose` flag to `bundle show` was undocumented and will be removed without replacement")
- end
-
- pending "fails with a helpful message", :bundler => "3"
- end
-
- context "with a gem argument" do
- before do
- bundle "show rack"
- end
-
- it "prints a deprecation warning recommending `bundle info`", :bundler => "< 3" do
- expect(deprecations).to include("use `bundle info rack` instead of `bundle show rack`")
- end
-
- pending "fails with a helpful message", :bundler => "3"
- end
-
- context "with the --paths option" do
- before do
- bundle "show --paths"
- end
-
- it "prints a deprecation warning recommending `bundle list`", :bundler => "< 3" do
- expect(deprecations).to include("use `bundle list` instead of `bundle show --paths`")
- end
-
- pending "fails with a helpful message", :bundler => "3"
- end
-
- context "with a gem argument and the --paths option" do
- before do
- bundle "show rack --paths"
- end
-
- it "prints deprecation warning recommending `bundle info`", :bundler => "< 3" do
- expect(deprecations).to include("use `bundle info rack --path` instead of `bundle show rack --paths`")
- end
-
- pending "fails with a helpful message", :bundler => "3"
- end
end
context "bundle console" do
diff --git a/spec/bundler/plugins/install_spec.rb b/spec/bundler/plugins/install_spec.rb
index 370973ad1a..308f9c79fc 100644
--- a/spec/bundler/plugins/install_spec.rb
+++ b/spec/bundler/plugins/install_spec.rb
@@ -228,7 +228,7 @@ RSpec.describe "bundler plugin install" do
gem 'rack', "1.0.0"
G
- bundle "config --local deployment true"
+ bundle "config set --local deployment true"
install_gemfile <<-G
source '#{file_uri_for(gem_repo2)}'
plugin 'foo'
diff --git a/spec/bundler/plugins/source/example_spec.rb b/spec/bundler/plugins/source/example_spec.rb
index 03a377ac93..e2bab9c199 100644
--- a/spec/bundler/plugins/source/example_spec.rb
+++ b/spec/bundler/plugins/source/example_spec.rb
@@ -132,7 +132,7 @@ RSpec.describe "real source plugins" do
end
it "copies repository to vendor cache and uses it even when installed with `path` configured" do
- bundle "config --local path vendor/bundle"
+ bundle "config set --local path vendor/bundle"
bundle :install
bundle "config set cache_all true"
bundle :cache
@@ -144,7 +144,7 @@ RSpec.describe "real source plugins" do
end
it "bundler package copies repository to vendor cache" do
- bundle "config --local path vendor/bundle"
+ bundle "config set --local path vendor/bundle"
bundle :install
bundle "config set cache_all true"
bundle :cache
diff --git a/spec/bundler/quality_spec.rb b/spec/bundler/quality_spec.rb
index 54dfd10447..524870ca9e 100644
--- a/spec/bundler/quality_spec.rb
+++ b/spec/bundler/quality_spec.rb
@@ -224,7 +224,7 @@ RSpec.describe "The library itself" do
end
it "ships the correct set of files" do
- git_list = git_ls_files(ruby_core? ? "lib/bundler lib/bundler.rb man/bundle* man/gemfile* libexec/bundle*" : "lib man exe CHANGELOG.md LICENSE.md README.md bundler.gemspec")
+ git_list = git_ls_files(ruby_core? ? "lib/bundler lib/bundler.rb libexec/bundle*" : "lib exe CHANGELOG.md LICENSE.md README.md bundler.gemspec")
gem_list = loaded_gemspec.files
diff --git a/spec/bundler/realworld/double_check_spec.rb b/spec/bundler/realworld/double_check_spec.rb
index 07697f080e..d7f28d10bb 100644
--- a/spec/bundler/realworld/double_check_spec.rb
+++ b/spec/bundler/realworld/double_check_spec.rb
@@ -25,9 +25,9 @@ RSpec.describe "double checking sources", :realworld => true do
RUBY
cmd = <<-RUBY
- require "#{lib_dir}/bundler"
+ require "#{entrypoint}"
require "#{spec_dir}/support/artifice/vcr"
- require "#{lib_dir}/bundler/inline"
+ require "#{entrypoint}/inline"
gemfile(true) do
source "https://rubygems.org"
gem "rails", path: "."
diff --git a/spec/bundler/realworld/edgecases_spec.rb b/spec/bundler/realworld/edgecases_spec.rb
index 1925f76c06..0fac56c942 100644
--- a/spec/bundler/realworld/edgecases_spec.rb
+++ b/spec/bundler/realworld/edgecases_spec.rb
@@ -4,9 +4,9 @@ RSpec.describe "real world edgecases", :realworld => true do
def rubygems_version(name, requirement)
ruby <<-RUBY
require "#{spec_dir}/support/artifice/vcr"
- require "#{lib_dir}/bundler"
- require "#{lib_dir}/bundler/source/rubygems/remote"
- require "#{lib_dir}/bundler/fetcher"
+ require "#{entrypoint}"
+ require "#{entrypoint}/source/rubygems/remote"
+ require "#{entrypoint}/fetcher"
rubygem = Bundler.ui.silence do
source = Bundler::Source::Rubygems::Remote.new(Bundler::URI("https://rubygems.org"))
fetcher = Bundler::Fetcher.new(source)
diff --git a/spec/bundler/runtime/inline_spec.rb b/spec/bundler/runtime/inline_spec.rb
index bad1df93a9..4c2dff466b 100644
--- a/spec/bundler/runtime/inline_spec.rb
+++ b/spec/bundler/runtime/inline_spec.rb
@@ -2,7 +2,7 @@
RSpec.describe "bundler/inline#gemfile" do
def script(code, options = {})
- requires = ["#{lib_dir}/bundler/inline"]
+ requires = ["#{entrypoint}/inline"]
requires.unshift "#{spec_dir}/support/artifice/" + options.delete(:artifice) if options.key?(:artifice)
requires = requires.map {|r| "require '#{r}'" }.join("\n")
ruby("#{requires}\n\n" + code, options)
@@ -93,7 +93,7 @@ RSpec.describe "bundler/inline#gemfile" do
it "lets me use my own ui object" do
script <<-RUBY, :artifice => "endpoint"
- require '#{lib_dir}/bundler'
+ require '#{entrypoint}'
class MyBundlerUI < Bundler::UI::Silent
def confirm(msg, newline = nil)
puts "CONFIRMED!"
@@ -110,7 +110,7 @@ RSpec.describe "bundler/inline#gemfile" do
it "has an option for quiet installation" do
script <<-RUBY, :artifice => "endpoint"
- require '#{lib_dir}/bundler/inline'
+ require '#{entrypoint}/inline'
gemfile(true, :quiet => true) do
source "https://notaserver.com"
@@ -136,7 +136,7 @@ RSpec.describe "bundler/inline#gemfile" do
it "does not mutate the option argument" do
script <<-RUBY
- require '#{lib_dir}/bundler'
+ require '#{entrypoint}'
options = { :ui => Bundler::UI::Shell.new }
gemfile(false, options) do
path "#{lib_path}" do
@@ -218,7 +218,7 @@ RSpec.describe "bundler/inline#gemfile" do
rake
BUNDLED WITH
- 1.13.6
+ #{Bundler::VERSION}
G
script <<-RUBY
diff --git a/spec/bundler/runtime/load_spec.rb b/spec/bundler/runtime/load_spec.rb
index 0274ba18b8..96a22a46cc 100644
--- a/spec/bundler/runtime/load_spec.rb
+++ b/spec/bundler/runtime/load_spec.rb
@@ -82,7 +82,7 @@ RSpec.describe "Bundler.load" do
G
ruby <<-RUBY
- require "#{lib_dir}/bundler"
+ require "#{entrypoint}"
Bundler.setup :default
Bundler.require :default
puts RACK
diff --git a/spec/bundler/runtime/platform_spec.rb b/spec/bundler/runtime/platform_spec.rb
index bec42e0f70..d81bccbdf8 100644
--- a/spec/bundler/runtime/platform_spec.rb
+++ b/spec/bundler/runtime/platform_spec.rb
@@ -22,7 +22,7 @@ RSpec.describe "Bundler.setup with multi platform stuff" do
ruby <<-R
begin
- require '#{lib_dir}/bundler'
+ require '#{entrypoint}'
Bundler.ui.silence { Bundler.setup }
rescue Bundler::GemNotFound => e
puts "WIN"
diff --git a/spec/bundler/runtime/require_spec.rb b/spec/bundler/runtime/require_spec.rb
index ad30529e86..a3fa4fbe47 100644
--- a/spec/bundler/runtime/require_spec.rb
+++ b/spec/bundler/runtime/require_spec.rb
@@ -192,7 +192,7 @@ RSpec.describe "Bundler.require" do
G
cmd = <<-RUBY
- require '#{lib_dir}/bundler'
+ require '#{entrypoint}'
Bundler.require
RUBY
ruby(cmd)
diff --git a/spec/bundler/runtime/setup_spec.rb b/spec/bundler/runtime/setup_spec.rb
index 46663bc76f..d8ba569f0a 100644
--- a/spec/bundler/runtime/setup_spec.rb
+++ b/spec/bundler/runtime/setup_spec.rb
@@ -108,8 +108,8 @@ RSpec.describe "Bundler.setup" do
context "load order" do
def clean_load_path(lp)
without_bundler_load_path = ruby("puts $LOAD_PATH").split("\n")
- lp -= without_bundler_load_path
- lp.map! {|p| p.sub(/^#{Regexp.union system_gem_path.to_s, default_bundle_path.to_s, lib_dir.to_s}/i, "") }
+ lp -= [*without_bundler_load_path, lib_dir.to_s]
+ lp.map! {|p| p.sub(system_gem_path.to_s, "") }
end
it "puts loaded gems after -I and RUBYLIB", :ruby_repo do
@@ -143,12 +143,8 @@ RSpec.describe "Bundler.setup" do
gem "rails"
G
- # We require an absolute path because relying on the $LOAD_PATH behaves
- # inconsistently depending on whether we're in a ruby-core setup (and
- # bundler's lib is in RUBYLIB) or not.
-
ruby <<-RUBY
- require '#{lib_dir}/bundler'
+ require 'bundler'
Bundler.setup
puts $LOAD_PATH
RUBY
@@ -157,7 +153,6 @@ RSpec.describe "Bundler.setup" do
expect(load_path).to start_with(
"/gems/rails-2.3.2/lib",
- "/gems/bundler-#{Bundler::VERSION}/lib",
"/gems/activeresource-2.3.2/lib",
"/gems/activerecord-2.3.2/lib",
"/gems/actionpack-2.3.2/lib",
@@ -168,6 +163,8 @@ RSpec.describe "Bundler.setup" do
end
it "falls back to order the load path alphabetically for backwards compatibility" do
+ bundle "config set path.system true"
+
install_gemfile <<-G
source "#{file_uri_for(gem_repo1)}"
gem "weakling"
@@ -175,12 +172,8 @@ RSpec.describe "Bundler.setup" do
gem "terranova"
G
- # We require an absolute path because relying on the $LOAD_PATH behaves
- # inconsistently depending on whether we're in a ruby-core setup (and
- # bundler's lib is in RUBYLIB) or not.
-
ruby <<-RUBY
- require '#{lib_dir}/bundler/setup'
+ require 'bundler/setup'
puts $LOAD_PATH
RUBY
@@ -200,8 +193,6 @@ RSpec.describe "Bundler.setup" do
gem "rack"
G
- entrypoint = mis_activates_prerelease_default_bundler? ? "#{lib_dir}/bundler" : "bundler"
-
ruby <<-R
require '#{entrypoint}'
@@ -474,8 +465,6 @@ RSpec.describe "Bundler.setup" do
break_git!
- entrypoint = mis_activates_prerelease_default_bundler? ? "#{lib_dir}/bundler" : "bundler"
-
ruby <<-R
require "#{entrypoint}"
@@ -493,14 +482,14 @@ RSpec.describe "Bundler.setup" do
end
it "works even when the cache directory has been deleted" do
- bundle "config --local path vendor/bundle"
+ bundle "config set --local path vendor/bundle"
bundle :install
FileUtils.rm_rf vendored_gems("cache")
expect(the_bundle).to include_gems "rack 1.0.0"
end
it "does not randomly change the path when specifying --path and the bundle directory becomes read only" do
- bundle "config --local path vendor/bundle"
+ bundle "config set --local path vendor/bundle"
bundle :install
with_read_only("#{bundled_app}/**/*") do
@@ -604,7 +593,7 @@ RSpec.describe "Bundler.setup" do
describe "when excluding groups" do
it "doesn't change the resolve if --without is used" do
- bundle "config --local without rails"
+ bundle "config set --local without rails"
install_gemfile <<-G
source "#{file_uri_for(gem_repo1)}"
gem "activesupport"
@@ -620,7 +609,7 @@ RSpec.describe "Bundler.setup" do
end
it "remembers --without and does not bail on bare Bundler.setup" do
- bundle "config --local without rails"
+ bundle "config set --local without rails"
install_gemfile <<-G
source "#{file_uri_for(gem_repo1)}"
gem "activesupport"
@@ -636,7 +625,7 @@ RSpec.describe "Bundler.setup" do
end
it "remembers --without and does not bail on bare Bundler.setup, even in the case of path gems no longer available" do
- bundle "config --local without development"
+ bundle "config set --local without development"
path = bundled_app(File.join("vendor", "foo"))
build_lib "foo", :path => path
@@ -656,7 +645,7 @@ RSpec.describe "Bundler.setup" do
end
it "remembers --without and does not include groups passed to Bundler.setup" do
- bundle "config --local without rails"
+ bundle "config set --local without rails"
install_gemfile <<-G
source "#{file_uri_for(gem_repo1)}"
gem "activesupport"
@@ -1126,9 +1115,8 @@ end
context "is not present" do
it "does not change the lock" do
- entrypoint = mis_activates_prerelease_default_bundler? ? "#{lib_dir}/bundler/setup" : "bundler/setup"
lockfile lock_with(nil)
- ruby "require '#{entrypoint}'"
+ ruby "require '#{entrypoint}/setup'"
lockfile_should_be lock_with(nil)
end
end
@@ -1145,10 +1133,9 @@ end
context "is older" do
it "does not change the lock" do
- entrypoint = mis_activates_prerelease_default_bundler? ? "#{lib_dir}/bundler/setup" : "bundler/setup"
system_gems "bundler-1.10.1"
lockfile lock_with("1.10.1")
- ruby "require '#{entrypoint}'"
+ ruby "require '#{entrypoint}/setup'"
lockfile_should_be lock_with("1.10.1")
end
end
@@ -1219,9 +1206,8 @@ end
describe "with gemified standard libraries" do
it "does not load Psych" do
gemfile ""
- entrypoint = mis_activates_prerelease_default_bundler? ? "#{lib_dir}/bundler/setup" : "bundler/setup"
ruby <<-RUBY
- require '#{entrypoint}'
+ require '#{entrypoint}/setup'
puts defined?(Psych::VERSION) ? Psych::VERSION : "undefined"
require 'psych'
puts Psych::VERSION
@@ -1422,9 +1408,4 @@ end
expect(last_command.stdboth).to eq("true")
end
end
-
- # Tested rubygems does not include https://github.com/rubygems/rubygems/pull/2728 and will not always end up activating the current bundler
- def mis_activates_prerelease_default_bundler?
- Gem.rubygems_version < Gem::Version.new("3.1.a")
- end
end
diff --git a/spec/bundler/spec_helper.rb b/spec/bundler/spec_helper.rb
index d09ccb6e90..36a6bcd099 100644
--- a/spec/bundler/spec_helper.rb
+++ b/spec/bundler/spec_helper.rb
@@ -72,6 +72,7 @@ RSpec.configure do |config|
Spec::Rubygems.test_setup
ENV["BUNDLE_SPEC_RUN"] = "true"
ENV["BUNDLE_USER_CONFIG"] = ENV["BUNDLE_USER_CACHE"] = ENV["BUNDLE_USER_PLUGIN"] = nil
+ ENV["XDG_CONFIG_HOME"] = nil
ENV["GEMRC"] = nil
# Don't wrap output in tests
diff --git a/spec/bundler/support/artifice/endpoint.rb b/spec/bundler/support/artifice/endpoint.rb
index e0650fa7d5..37ca378ef9 100644
--- a/spec/bundler/support/artifice/endpoint.rb
+++ b/spec/bundler/support/artifice/endpoint.rb
@@ -45,10 +45,14 @@ class Endpoint < Sinatra::Base
Pathname.new(ENV["BUNDLER_SPEC_GEM_REPO"])
else
case request.host
+ when "gem.repo1"
+ Spec::Path.gem_repo1
when "gem.repo2"
Spec::Path.gem_repo2
when "gem.repo3"
Spec::Path.gem_repo3
+ when "gem.repo4"
+ Spec::Path.gem_repo4
else
Spec::Path.gem_repo1
end
diff --git a/spec/bundler/support/helpers.rb b/spec/bundler/support/helpers.rb
index 73dd508e54..d660a972e3 100644
--- a/spec/bundler/support/helpers.rb
+++ b/spec/bundler/support/helpers.rb
@@ -60,7 +60,7 @@ module Spec
def run(cmd, *args)
opts = args.last.is_a?(Hash) ? args.pop : {}
groups = args.map(&:inspect).join(", ")
- setup = "require '#{lib_dir}/bundler' ; Bundler.ui.silence { Bundler.setup(#{groups}) }"
+ setup = "require '#{entrypoint}' ; Bundler.ui.silence { Bundler.setup(#{groups}) }"
ruby([setup, cmd].join(" ; "), opts)
end
diff --git a/spec/bundler/support/indexes.rb b/spec/bundler/support/indexes.rb
index 1f3c4ddaa6..bf4300edb2 100644
--- a/spec/bundler/support/indexes.rb
+++ b/spec/bundler/support/indexes.rb
@@ -20,12 +20,11 @@ module Spec
default_source = instance_double("Bundler::Source::Rubygems", :specs => @index)
source_requirements = { :default => default_source }
@deps.each do |d|
+ source_requirements[d.name] = d.source = default_source
@platforms.each do |p|
- source_requirements[d.name] = d.source = default_source
deps << Bundler::DepProxy.get_proxy(d, p)
end
end
- source_requirements ||= {}
args[0] ||= [] # base
args[1] ||= Bundler::GemVersionPromoter.new # gem_version_promoter
args[2] ||= [] # additional_base_requirements
diff --git a/spec/bundler/support/matchers.rb b/spec/bundler/support/matchers.rb
index 1613662981..3c1014edc7 100644
--- a/spec/bundler/support/matchers.rb
+++ b/spec/bundler/support/matchers.rb
@@ -156,7 +156,7 @@ module Spec
actual_source = out.split("\n").last
next "Expected #{name} (#{version}) to be installed from `#{source}`, was actually from `#{actual_source}`"
end
- next "Command to check forgem inclusion of gem #{full_name} failed"
+ next "Command to check for inclusion of gem #{full_name} failed"
end.compact
@errors.empty?
diff --git a/spec/bundler/support/path.rb b/spec/bundler/support/path.rb
index 483c7da347..dbe5862b44 100644
--- a/spec/bundler/support/path.rb
+++ b/spec/bundler/support/path.rb
@@ -205,6 +205,13 @@ module Spec
root.join("lib")
end
+ # Sometimes rubygems version under test does not include
+ # https://github.com/rubygems/rubygems/pull/2728 and will not always end up
+ # activating the current bundler. In that case, require bundler absolutely.
+ def entrypoint
+ Gem.rubygems_version < Gem::Version.new("3.1.a") ? "#{lib_dir}/bundler" : "bundler"
+ end
+
def global_plugin_gem(*args)
home ".bundle", "plugin", "gems", *args
end
diff --git a/test/rubygems/test_bundled_ca.rb b/test/rubygems/test_bundled_ca.rb
index 6973758c4c..ff5b8dba19 100644
--- a/test/rubygems/test_bundled_ca.rb
+++ b/test/rubygems/test_bundled_ca.rb
@@ -26,14 +26,14 @@ class TestBundledCA < Gem::TestCase
end
def assert_https(host)
- self.assertions += 1
+ assert true
http = Net::HTTP.new(host, 443)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_PEER
http.cert_store = bundled_certificate_store
http.get('/')
rescue Errno::ENOENT, Errno::ETIMEDOUT, SocketError
- skip "#{host} seems offline, I can't tell whether ssl would work."
+ pend "#{host} seems offline, I can't tell whether ssl would work."
rescue OpenSSL::SSL::SSLError => e
# Only fail for certificate verification errors
if e.message =~ /certificate verify failed/
diff --git a/test/rubygems/test_deprecate.rb b/test/rubygems/test_deprecate.rb
index dc282dd8fb..4a14266ce3 100644
--- a/test/rubygems/test_deprecate.rb
+++ b/test/rubygems/test_deprecate.rb
@@ -96,7 +96,7 @@ class TestDeprecate < Gem::TestCase
end
def test_deprecated_method_calls_the_old_method
- capture_io do
+ capture_output do
thing = Thing.new
thing.foo
assert_equal "foo", thing.message
@@ -108,7 +108,7 @@ class TestDeprecate < Gem::TestCase
end
def test_deprecated_method_outputs_a_warning
- out, err = capture_io do
+ out, err = capture_output do
thing = Thing.new
thing.foo
thing.foo_arg("msg")
@@ -141,7 +141,7 @@ class TestDeprecate < Gem::TestCase
end
def test_deprecated_method_outputs_a_warning_old_way
- out, err = capture_io do
+ out, err = capture_output do
thing = OtherThing.new
thing.foo
thing.foo_arg("msg")
diff --git a/test/rubygems/test_gem.rb b/test/rubygems/test_gem.rb
index 8b028d3495..d548e95fd7 100644
--- a/test/rubygems/test_gem.rb
+++ b/test/rubygems/test_gem.rb
@@ -106,7 +106,7 @@ class TestGem < Gem::TestCase
assert_equal %w[a-1], installed.map {|spec| spec.full_name }
- assert_path_exists File.join(gemhome2, 'gems', 'a-1')
+ assert_path_exist File.join(gemhome2, 'gems', 'a-1')
end
def test_self_install_in_rescue
@@ -212,7 +212,7 @@ class TestGem < Gem::TestCase
def test_require_missing
save_loaded_features do
- assert_raises ::LoadError do
+ assert_raise ::LoadError do
require "test_require_missing"
end
end
@@ -224,7 +224,7 @@ class TestGem < Gem::TestCase
install_specs a1
- assert_raises ::LoadError do
+ assert_raise ::LoadError do
require "a*"
end
@@ -261,7 +261,7 @@ class TestGem < Gem::TestCase
end
def test_self_activate_bin_path_no_exec_name
- e = assert_raises ArgumentError do
+ e = assert_raise ArgumentError do
Gem.activate_bin_path 'a'
end
@@ -342,7 +342,7 @@ class TestGem < Gem::TestCase
# c2 is missing, and b2 which has it as a dependency will be activated, so we should get an error about the orphaned dependency
- e = assert_raises Gem::UnsatisfiableDependencyError do
+ e = assert_raise Gem::UnsatisfiableDependencyError do
load Gem.activate_bin_path("a", "exec", ">= 0")
end
@@ -390,7 +390,7 @@ class TestGem < Gem::TestCase
File.open("Gemfile", "w") {|f| f.puts('source "https://rubygems.org"') }
- e = assert_raises Gem::GemNotFoundException do
+ e = assert_raise Gem::GemNotFoundException do
load Gem.activate_bin_path("bundler", "bundle", ">= 0.a")
end
@@ -487,7 +487,7 @@ class TestGem < Gem::TestCase
File.open("Gemfile", "w") {|f| f.puts('source "https://rubygems.org"') }
- e = assert_raises Gem::GemNotFoundException do
+ e = assert_raise Gem::GemNotFoundException do
load Gem.activate_bin_path("bundler", "bundle", "= 2.2.8")
end
@@ -495,7 +495,7 @@ class TestGem < Gem::TestCase
end
def test_self_bin_path_no_exec_name
- e = assert_raises ArgumentError do
+ e = assert_raise ArgumentError do
Gem.bin_path 'a'
end
@@ -516,20 +516,20 @@ class TestGem < Gem::TestCase
util_spec 'a', '2' do |s|
s.executables = ['exec']
end
- assert_raises(Gem::GemNotFoundException) do
+ assert_raise(Gem::GemNotFoundException) do
Gem.bin_path('a', 'other', '2')
end
end
def test_self_bin_path_no_bin_file
util_spec 'a', '1'
- assert_raises(ArgumentError) do
+ assert_raise(ArgumentError) do
Gem.bin_path('a', nil, '1')
end
end
def test_self_bin_path_not_found
- assert_raises(Gem::GemNotFoundException) do
+ assert_raise(Gem::GemNotFoundException) do
Gem.bin_path('non-existent', 'blah')
end
end
@@ -596,7 +596,7 @@ class TestGem < Gem::TestCase
end
def test_self_datadir_nonexistent_package
- assert_raises(Gem::MissingSpecError) do
+ assert_raise(Gem::MissingSpecError) do
Gem::Specification.find_by_name("xyzzy").datadir
end
end
@@ -692,12 +692,12 @@ class TestGem < Gem::TestCase
Gem.ensure_gem_subdirectories @gemhome
- assert_path_exists File.join @gemhome, 'build_info'
- assert_path_exists File.join @gemhome, 'cache'
- assert_path_exists File.join @gemhome, 'doc'
- assert_path_exists File.join @gemhome, 'extensions'
- assert_path_exists File.join @gemhome, 'gems'
- assert_path_exists File.join @gemhome, 'specifications'
+ assert_path_exist File.join @gemhome, 'build_info'
+ assert_path_exist File.join @gemhome, 'cache'
+ assert_path_exist File.join @gemhome, 'doc'
+ assert_path_exist File.join @gemhome, 'extensions'
+ assert_path_exist File.join @gemhome, 'gems'
+ assert_path_exist File.join @gemhome, 'specifications'
end
def test_self_ensure_gem_directories_permissions
@@ -1058,7 +1058,7 @@ class TestGem < Gem::TestCase
assert_equal ["\xCF", "\x80"], Gem.read_binary('test').chars.to_a
- skip 'chmod not supported' if Gem.win_platform?
+ pend 'chmod not supported' if Gem.win_platform?
begin
File.chmod 0444, 'test'
@@ -1144,7 +1144,7 @@ class TestGem < Gem::TestCase
assert_equal Gem::Requirement.create('>= 1.2.3'), Gem.env_requirement('foo')
assert_equal Gem::Requirement.create('1.2.3'), Gem.env_requirement('bAr')
- assert_raises(Gem::Requirement::BadRequirementError) { Gem.env_requirement('baz') }
+ assert_raise(Gem::Requirement::BadRequirementError) { Gem.env_requirement('baz') }
assert_equal Gem::Requirement.default, Gem.env_requirement('qux')
end
@@ -1349,7 +1349,7 @@ class TestGem < Gem::TestCase
io.puts '# a_file.rb'
end
- e = assert_raises Gem::MissingSpecError do
+ e = assert_raise Gem::MissingSpecError do
Gem.try_activate 'a_file'
end
@@ -1370,7 +1370,7 @@ class TestGem < Gem::TestCase
io.puts '# a_file.rb'
end
- e = assert_raises Gem::MissingSpecError do
+ e = assert_raise Gem::MissingSpecError do
Gem.try_activate 'a_file'
end
@@ -1389,7 +1389,7 @@ class TestGem < Gem::TestCase
io.write spec.to_ruby_for_cache
end
- _, err = capture_io do
+ _, err = capture_output do
refute Gem.try_activate 'nonexistent'
end
@@ -1414,7 +1414,7 @@ class TestGem < Gem::TestCase
end
def test_setting_paths_does_not_warn_about_unknown_keys
- stdout, stderr = capture_io do
+ stdout, stderr = capture_output do
Gem.paths = { 'foo' => [],
'bar' => Object.new,
'GEM_HOME' => Gem.paths.home,
@@ -1432,7 +1432,7 @@ class TestGem < Gem::TestCase
end
def test_deprecated_paths=
- stdout, stderr = capture_io do
+ stdout, stderr = capture_output do
Gem.paths = { 'GEM_HOME' => Gem.paths.home,
'GEM_PATH' => [Gem.paths.home, 'foo'] }
end
@@ -1727,7 +1727,7 @@ class TestGem < Gem::TestCase
end
def test_looks_for_gemdeps_files_automatically_on_start
- skip "Requiring bundler messes things up" if Gem.java_platform?
+ pend "Requiring bundler messes things up" if Gem.java_platform?
a = util_spec "a", "1", nil, "lib/a.rb"
b = util_spec "b", "1", nil, "lib/b.rb"
@@ -1763,7 +1763,7 @@ class TestGem < Gem::TestCase
end
def test_looks_for_gemdeps_files_automatically_on_start_in_parent_dir
- skip "Requiring bundler messes things up" if Gem.java_platform?
+ pend "Requiring bundler messes things up" if Gem.java_platform?
a = util_spec "a", "1", nil, "lib/a.rb"
b = util_spec "b", "1", nil, "lib/b.rb"
@@ -1881,7 +1881,7 @@ class TestGem < Gem::TestCase
end
def test_use_gemdeps_argument_missing
- e = assert_raises ArgumentError do
+ e = assert_raise ArgumentError do
Gem.use_gemdeps 'gem.deps.rb'
end
@@ -1893,7 +1893,7 @@ class TestGem < Gem::TestCase
rubygems_gemdeps, ENV['RUBYGEMS_GEMDEPS'] =
ENV['RUBYGEMS_GEMDEPS'], 'gem.deps.rb'
- e = assert_raises ArgumentError do
+ e = assert_raise ArgumentError do
Gem.use_gemdeps 'gem.deps.rb'
end
@@ -1966,9 +1966,11 @@ You may need to `gem install -g` to install missing gems
EXPECTED
Gem::Deprecate.skip_during do
- assert_output nil, expected do
+ actual_stdout, actual_stderr = capture_output do
Gem.use_gemdeps
end
+ assert_empty actual_stdout
+ assert_equal(expected, actual_stderr)
end
ensure
ENV['RUBYGEMS_GEMDEPS'] = rubygems_gemdeps
@@ -2073,7 +2075,7 @@ You may need to `gem install -g` to install missing gems
refute_includes $LOAD_PATH, test_plugin_path
$LOAD_PATH.unshift test_plugin_path
- capture_io do
+ capture_output do
yield
end
ensure
diff --git a/test/rubygems/test_gem_bundler_version_finder.rb b/test/rubygems/test_gem_bundler_version_finder.rb
index 4372356db8..08e189b26f 100644
--- a/test/rubygems/test_gem_bundler_version_finder.rb
+++ b/test/rubygems/test_gem_bundler_version_finder.rb
@@ -78,8 +78,8 @@ class TestGemBundlerVersionFinder < Gem::TestCase
end
def test_deleted_directory
- skip "Cannot perform this test on windows" if win_platform?
- skip "Cannot perform this test on Solaris" if /solaris/ =~ RUBY_PLATFORM
+ pend "Cannot perform this test on windows" if win_platform?
+ pend "Cannot perform this test on Solaris" if /solaris/ =~ RUBY_PLATFORM
require "tmpdir"
orig_dir = Dir.pwd
diff --git a/test/rubygems/test_gem_command.rb b/test/rubygems/test_gem_command.rb
index 2f87d9cc8d..a99de30b33 100644
--- a/test/rubygems/test_gem_command.rb
+++ b/test/rubygems/test_gem_command.rb
@@ -118,7 +118,7 @@ class TestGemCommand < Gem::TestCase
use_ui @ui do
@cmd.when_invoked { true }
- ex = assert_raises OptionParser::InvalidOption do
+ ex = assert_raise OptionParser::InvalidOption do
@cmd.invoke('-zzz')
end
diff --git a/test/rubygems/test_gem_command_manager.rb b/test/rubygems/test_gem_command_manager.rb
index d4471b0b63..d9c74191cd 100644
--- a/test/rubygems/test_gem_command_manager.rb
+++ b/test/rubygems/test_gem_command_manager.rb
@@ -22,7 +22,7 @@ class TestGemCommandManager < Gem::TestCase
end
def test_find_command_ambiguous
- e = assert_raises Gem::CommandLineError do
+ e = assert_raise Gem::CommandLineError do
@command_manager.find_command 'u'
end
@@ -50,7 +50,7 @@ class TestGemCommandManager < Gem::TestCase
end
def test_find_command_unknown
- e = assert_raises Gem::CommandLineError do
+ e = assert_raise Gem::CommandLineError do
@command_manager.find_command 'xyz'
end
@@ -65,7 +65,7 @@ class TestGemCommandManager < Gem::TestCase
@command_manager.register_command :interrupt
use_ui @ui do
- assert_raises Gem::MockGemUi::TermError do
+ assert_raise Gem::MockGemUi::TermError do
@command_manager.run %w[interrupt]
end
assert_equal '', ui.output
@@ -82,7 +82,7 @@ class TestGemCommandManager < Gem::TestCase
@command_manager.register_command :crash
use_ui @ui do
- assert_raises Gem::MockGemUi::TermError do
+ assert_raise Gem::MockGemUi::TermError do
@command_manager.run %w[crash]
end
assert_equal '', ui.output
@@ -96,7 +96,7 @@ class TestGemCommandManager < Gem::TestCase
def test_process_args_bad_arg
use_ui @ui do
- assert_raises Gem::MockGemUi::TermError do
+ assert_raise Gem::MockGemUi::TermError do
@command_manager.process_args %w[--bad-arg]
end
end
diff --git a/test/rubygems/test_gem_commands_build_command.rb b/test/rubygems/test_gem_commands_build_command.rb
index fe537780be..3adf69cdf4 100644
--- a/test/rubygems/test_gem_commands_build_command.rb
+++ b/test/rubygems/test_gem_commands_build_command.rb
@@ -126,7 +126,7 @@ class TestGemCommandsBuildCommand < Gem::TestCase
use_ui @ui do
Dir.chdir @tempdir do
- assert_raises Gem::InvalidSpecificationException do
+ assert_raise Gem::InvalidSpecificationException do
@cmd.execute
end
end
@@ -180,7 +180,7 @@ class TestGemCommandsBuildCommand < Gem::TestCase
use_ui @ui do
Dir.chdir @tempdir do
- assert_raises Gem::InvalidSpecificationException do
+ assert_raise Gem::InvalidSpecificationException do
@cmd.execute
end
end
@@ -208,8 +208,8 @@ class TestGemCommandsBuildCommand < Gem::TestCase
@cmd.options[:args] = [gemspec_file]
out, err = use_ui @ui do
- capture_io do
- assert_raises Gem::MockGemUi::TermError do
+ capture_output do
+ assert_raise Gem::MockGemUi::TermError do
@cmd.execute
end
end
@@ -225,7 +225,7 @@ class TestGemCommandsBuildCommand < Gem::TestCase
def test_execute_missing_file
@cmd.options[:args] = %w[some_gem]
use_ui @ui do
- assert_raises Gem::MockGemUi::TermError do
+ assert_raise Gem::MockGemUi::TermError do
@cmd.execute
end
end
@@ -329,7 +329,7 @@ class TestGemCommandsBuildCommand < Gem::TestCase
@cmd.options[:args] = ["*.gemspec"]
use_ui @ui do
- assert_raises Gem::MockGemUi::TermError do
+ assert_raise Gem::MockGemUi::TermError do
@cmd.execute
end
end
@@ -527,7 +527,7 @@ class TestGemCommandsBuildCommand < Gem::TestCase
use_ui @ui do
Dir.chdir(gemspec_dir) do
- assert_raises Gem::MockGemUi::TermError do
+ assert_raise Gem::MockGemUi::TermError do
@cmd.execute
end
end
@@ -582,7 +582,7 @@ class TestGemCommandsBuildCommand < Gem::TestCase
end
def test_build_signed_gem
- skip 'openssl is missing' unless Gem::HAVE_OPENSSL && !java_platform?
+ pend 'openssl is missing' unless Gem::HAVE_OPENSSL && !java_platform?
trust_dir = Gem::Security.trust_dir
@@ -609,7 +609,7 @@ class TestGemCommandsBuildCommand < Gem::TestCase
end
def test_build_signed_gem_with_cert_expiration_length_days
- skip 'openssl is missing' unless Gem::HAVE_OPENSSL && !java_platform?
+ pend 'openssl is missing' unless Gem::HAVE_OPENSSL && !java_platform?
gem_path = File.join Gem.user_home, ".gem"
Dir.mkdir gem_path
@@ -653,7 +653,7 @@ class TestGemCommandsBuildCommand < Gem::TestCase
end
def test_build_auto_resign_cert
- skip 'openssl is missing' unless Gem::HAVE_OPENSSL && !java_platform?
+ pend 'openssl is missing' unless Gem::HAVE_OPENSSL && !java_platform?
gem_path = File.join Gem.user_home, ".gem"
Dir.mkdir gem_path
diff --git a/test/rubygems/test_gem_commands_cert_command.rb b/test/rubygems/test_gem_commands_cert_command.rb
index 19867bf37a..e8b6e506f5 100644
--- a/test/rubygems/test_gem_commands_cert_command.rb
+++ b/test/rubygems/test_gem_commands_cert_command.rb
@@ -54,7 +54,7 @@ class TestGemCommandsCertCommand < Gem::TestCase
assert_equal PUBLIC_CERT.to_pem, match.first.to_pem
assert_equal @trust_dir.cert_path(PUBLIC_CERT), match.last
- assert_raises StopIteration do
+ assert_raise StopIteration do
matches.next
end
end
@@ -69,7 +69,7 @@ class TestGemCommandsCertCommand < Gem::TestCase
assert_equal ALTERNATE_CERT.to_pem, match.first.to_pem
assert_equal @trust_dir.cert_path(ALTERNATE_CERT), match.last
- assert_raises StopIteration do
+ assert_raise StopIteration do
matches.next
end
end
@@ -83,7 +83,7 @@ class TestGemCommandsCertCommand < Gem::TestCase
cert_path = @trust_dir.cert_path PUBLIC_CERT
- assert_path_exists cert_path
+ assert_path_exist cert_path
assert_equal "Added '/CN=nobody/DC=example'\n", @ui.output
assert_empty @ui.error
@@ -138,8 +138,8 @@ Added '/CN=alternate/DC=example'
assert_empty output
assert_empty @build_ui.error
- assert_path_exists File.join(@tempdir, 'gem-private_key.pem')
- assert_path_exists File.join(@tempdir, 'gem-public_cert.pem')
+ assert_path_exist File.join(@tempdir, 'gem-private_key.pem')
+ assert_path_exist File.join(@tempdir, 'gem-public_cert.pem')
end
def test_execute_build_bad_email_address
@@ -152,15 +152,15 @@ Added '/CN=alternate/DC=example'
use_ui @build_ui do
- e = assert_raises Gem::CommandLineError do
+ e = assert_raise Gem::CommandLineError do
@cmd.execute
end
assert_equal "Invalid email address #{email}",
e.message
- refute_path_exists File.join(@tempdir, 'gem-private_key.pem')
- refute_path_exists File.join(@tempdir, 'gem-public_cert.pem')
+ assert_path_not_exist File.join(@tempdir, 'gem-private_key.pem')
+ assert_path_not_exist File.join(@tempdir, 'gem-public_cert.pem')
end
end
@@ -195,8 +195,8 @@ Added '/CN=alternate/DC=example'
assert_empty output
assert_empty @build_ui.error
- assert_path_exists File.join(@tempdir, 'gem-private_key.pem')
- assert_path_exists File.join(@tempdir, 'gem-public_cert.pem')
+ assert_path_exist File.join(@tempdir, 'gem-private_key.pem')
+ assert_path_exist File.join(@tempdir, 'gem-public_cert.pem')
pem = File.read("#{@tempdir}/gem-public_cert.pem")
cert = OpenSSL::X509::Certificate.new(pem)
@@ -214,7 +214,7 @@ Added '/CN=alternate/DC=example'
@build_ui = Gem::MockGemUi.new "#{passphrase}\n#{passphrase_confirmation}"
use_ui @build_ui do
- e = assert_raises Gem::CommandLineError do
+ e = assert_raise Gem::CommandLineError do
@cmd.execute
end
@@ -232,8 +232,8 @@ Added '/CN=alternate/DC=example'
end
- refute_path_exists File.join(@tempdir, 'gem-private_key.pem')
- refute_path_exists File.join(@tempdir, 'gem-public_cert.pem')
+ assert_path_not_exist File.join(@tempdir, 'gem-private_key.pem')
+ assert_path_not_exist File.join(@tempdir, 'gem-public_cert.pem')
end
def test_execute_build_key
@@ -254,8 +254,8 @@ Added '/CN=alternate/DC=example'
assert_empty output
assert_empty @ui.error
- assert_path_exists File.join(@tempdir, 'gem-public_cert.pem')
- refute_path_exists File.join(@tempdir, 'gem-private_key.pem')
+ assert_path_exist File.join(@tempdir, 'gem-public_cert.pem')
+ assert_path_not_exist File.join(@tempdir, 'gem-private_key.pem')
end
def test_execute_build_encrypted_key
@@ -276,7 +276,7 @@ Added '/CN=alternate/DC=example'
assert_empty output
assert_empty @ui.error
- assert_path_exists File.join(@tempdir, 'gem-public_cert.pem')
+ assert_path_exist File.join(@tempdir, 'gem-public_cert.pem')
end
def test_execute_certificate
@@ -346,7 +346,7 @@ Added '/CN=alternate/DC=example'
cert_path = @trust_dir.cert_path PUBLIC_CERT
- assert_path_exists cert_path
+ assert_path_exist cert_path
@cmd.handle_options %W[--remove nobody]
@@ -357,7 +357,7 @@ Added '/CN=alternate/DC=example'
assert_equal "Removed '/CN=nobody/DC=example'\n", @ui.output
assert_equal '', @ui.error
- refute_path_exists cert_path
+ assert_path_not_exist cert_path
end
def test_execute_remove_multiple
@@ -367,8 +367,8 @@ Added '/CN=alternate/DC=example'
public_path = @trust_dir.cert_path PUBLIC_CERT
alternate_path = @trust_dir.cert_path ALTERNATE_CERT
- assert_path_exists public_path
- assert_path_exists alternate_path
+ assert_path_exist public_path
+ assert_path_exist alternate_path
@cmd.handle_options %W[--remove example]
@@ -384,8 +384,8 @@ Removed '/CN=nobody/DC=example'
assert_equal expected, @ui.output
assert_equal '', @ui.error
- refute_path_exists public_path
- refute_path_exists alternate_path
+ assert_path_not_exist public_path
+ assert_path_not_exist alternate_path
end
def test_execute_remove_twice
@@ -395,8 +395,8 @@ Removed '/CN=nobody/DC=example'
public_path = @trust_dir.cert_path PUBLIC_CERT
alternate_path = @trust_dir.cert_path ALTERNATE_CERT
- assert_path_exists public_path
- assert_path_exists alternate_path
+ assert_path_exist public_path
+ assert_path_exist alternate_path
@cmd.handle_options %W[--remove nobody --remove alternate]
@@ -412,8 +412,8 @@ Removed '/CN=alternate/DC=example'
assert_equal expected, @ui.output
assert_equal '', @ui.error
- refute_path_exists public_path
- refute_path_exists alternate_path
+ assert_path_not_exist public_path
+ assert_path_not_exist alternate_path
end
def test_execute_sign
@@ -552,7 +552,7 @@ Removed '/CN=alternate/DC=example'
@cmd.handle_options %W[--sign #{path}]
use_ui @ui do
- assert_raises Gem::MockGemUi::TermError do
+ assert_raise Gem::MockGemUi::TermError do
@cmd.execute
end
end
@@ -580,7 +580,7 @@ ERROR: --certificate not specified and ~/.gem/gem-public_cert.pem does not exis
@cmd.handle_options %W[--sign #{path}]
use_ui @ui do
- assert_raises Gem::MockGemUi::TermError do
+ assert_raise Gem::MockGemUi::TermError do
@cmd.execute
end
end
@@ -686,7 +686,7 @@ ERROR: --private-key not specified and ~/.gem/gem-private_key.pem does not exis
def test_handle_options_add_bad
nonexistent = File.join @tempdir, 'nonexistent'
- e = assert_raises OptionParser::InvalidArgument do
+ e = assert_raise OptionParser::InvalidArgument do
@cmd.handle_options %W[--add #{nonexistent}]
end
@@ -696,7 +696,7 @@ ERROR: --private-key not specified and ~/.gem/gem-private_key.pem does not exis
bad = File.join @tempdir, 'bad'
FileUtils.touch bad
- e = assert_raises OptionParser::InvalidArgument do
+ e = assert_raise OptionParser::InvalidArgument do
@cmd.handle_options %W[--add #{bad}]
end
@@ -706,7 +706,7 @@ ERROR: --private-key not specified and ~/.gem/gem-private_key.pem does not exis
def test_handle_options_certificate
nonexistent = File.join @tempdir, 'nonexistent'
- e = assert_raises OptionParser::InvalidArgument do
+ e = assert_raise OptionParser::InvalidArgument do
@cmd.handle_options %W[--certificate #{nonexistent}]
end
@@ -716,7 +716,7 @@ ERROR: --private-key not specified and ~/.gem/gem-private_key.pem does not exis
bad = File.join @tempdir, 'bad'
FileUtils.touch bad
- e = assert_raises OptionParser::InvalidArgument do
+ e = assert_raise OptionParser::InvalidArgument do
@cmd.handle_options %W[--certificate #{bad}]
end
@@ -727,7 +727,7 @@ ERROR: --private-key not specified and ~/.gem/gem-private_key.pem does not exis
def test_handle_options_key_bad
nonexistent = File.join @tempdir, 'nonexistent'
- e = assert_raises OptionParser::InvalidArgument do
+ e = assert_raise OptionParser::InvalidArgument do
@cmd.handle_options %W[--private-key #{nonexistent}]
end
@@ -738,14 +738,14 @@ ERROR: --private-key not specified and ~/.gem/gem-private_key.pem does not exis
bad = File.join @tempdir, 'bad'
FileUtils.touch bad
- e = assert_raises OptionParser::InvalidArgument do
+ e = assert_raise OptionParser::InvalidArgument do
@cmd.handle_options %W[--private-key #{bad}]
end
assert_equal "invalid argument: --private-key #{bad}: invalid RSA key",
e.message
- e = assert_raises OptionParser::InvalidArgument do
+ e = assert_raise OptionParser::InvalidArgument do
@cmd.handle_options %W[--private-key #{PUBLIC_KEY_FILE}]
end
@@ -792,7 +792,7 @@ ERROR: --private-key not specified and ~/.gem/gem-private_key.pem does not exis
def test_handle_options_sign_nonexistent
nonexistent = File.join @tempdir, 'nonexistent'
- e = assert_raises OptionParser::InvalidArgument do
+ e = assert_raise OptionParser::InvalidArgument do
@cmd.handle_options %W[
--private-key #{ALTERNATE_KEY_FILE}
diff --git a/test/rubygems/test_gem_commands_check_command.rb b/test/rubygems/test_gem_commands_check_command.rb
index c922e40eab..07eea188e3 100644
--- a/test/rubygems/test_gem_commands_check_command.rb
+++ b/test/rubygems/test_gem_commands_check_command.rb
@@ -50,18 +50,18 @@ class TestGemCommandsCheckCommand < Gem::TestCase
FileUtils.rm b.spec_file
- assert_path_exists b.gem_dir
- refute_path_exists b.spec_file
+ assert_path_exist b.gem_dir
+ assert_path_not_exist b.spec_file
Gem.use_paths @gemhome
- capture_io do
+ capture_output do
use_ui @ui do
@cmd.doctor
end
end
- refute_path_exists b.gem_dir
- refute_path_exists b.spec_file
+ assert_path_not_exist b.gem_dir
+ assert_path_not_exist b.spec_file
end
end
diff --git a/test/rubygems/test_gem_commands_cleanup_command.rb b/test/rubygems/test_gem_commands_cleanup_command.rb
index d937a5e549..6e21e8c68b 100644
--- a/test/rubygems/test_gem_commands_cleanup_command.rb
+++ b/test/rubygems/test_gem_commands_cleanup_command.rb
@@ -62,7 +62,7 @@ class TestGemCommandsCleanupCommand < Gem::TestCase
@cmd.execute
- refute_path_exists @a_1.gem_dir
+ assert_path_not_exist @a_1.gem_dir
end
def test_execute_all_dependencies
@@ -81,8 +81,8 @@ class TestGemCommandsCleanupCommand < Gem::TestCase
@cmd.execute
- refute_path_exists @a_1.gem_dir
- refute_path_exists @b_1.gem_dir
+ assert_path_not_exist @a_1.gem_dir
+ assert_path_not_exist @b_1.gem_dir
end
def test_execute_dev_dependencies
@@ -101,7 +101,7 @@ class TestGemCommandsCleanupCommand < Gem::TestCase
@cmd.execute
- assert_path_exists @a_1.gem_dir
+ assert_path_exist @a_1.gem_dir
end
def test_execute_without_dev_dependencies
@@ -120,7 +120,7 @@ class TestGemCommandsCleanupCommand < Gem::TestCase
@cmd.execute
- refute_path_exists @a_1.gem_dir
+ assert_path_not_exist @a_1.gem_dir
end
def test_execute_all
@@ -143,8 +143,8 @@ class TestGemCommandsCleanupCommand < Gem::TestCase
assert_equal @gemhome, Gem.dir, 'GEM_HOME'
assert_equal [@gemhome, gemhome2], Gem.path.sort, 'GEM_PATH'
- refute_path_exists @a_1.gem_dir
- refute_path_exists @b_1.gem_dir
+ assert_path_not_exist @a_1.gem_dir
+ assert_path_not_exist @b_1.gem_dir
end
def test_execute_all_user
@@ -153,15 +153,15 @@ class TestGemCommandsCleanupCommand < Gem::TestCase
Gem::Specification.dirs = [Gem.dir, Gem.user_dir]
- assert_path_exists @a_1.gem_dir
- assert_path_exists @a_1_1.gem_dir
+ assert_path_exist @a_1.gem_dir
+ assert_path_exist @a_1_1.gem_dir
@cmd.options[:args] = %w[a]
@cmd.execute
- refute_path_exists @a_1.gem_dir
- refute_path_exists @a_1_1.gem_dir
+ assert_path_not_exist @a_1.gem_dir
+ assert_path_not_exist @a_1_1.gem_dir
end
def test_execute_all_user_no_sudo
@@ -172,15 +172,15 @@ class TestGemCommandsCleanupCommand < Gem::TestCase
Gem::Specification.dirs = [Gem.dir, Gem.user_dir]
- assert_path_exists @a_1.gem_dir
- assert_path_exists @a_1_1.gem_dir
+ assert_path_exist @a_1.gem_dir
+ assert_path_exist @a_1_1.gem_dir
@cmd.options[:args] = %w[a]
@cmd.execute
- assert_path_exists @a_1.gem_dir
- assert_path_exists @a_1_1.gem_dir
+ assert_path_exist @a_1.gem_dir
+ assert_path_exist @a_1_1.gem_dir
ensure
FileUtils.chmod 0755, @gemhome
end unless win_platform? || Process.uid.zero?
@@ -191,7 +191,7 @@ class TestGemCommandsCleanupCommand < Gem::TestCase
@cmd.execute
- assert_path_exists @a_1.gem_dir
+ assert_path_exist @a_1.gem_dir
end
def test_execute_keeps_older_versions_with_deps
@@ -210,7 +210,7 @@ class TestGemCommandsCleanupCommand < Gem::TestCase
@cmd.execute
- assert_path_exists @b_1.gem_dir
+ assert_path_exist @b_1.gem_dir
end
def test_execute_ignore_default_gem_verbose
@@ -257,9 +257,9 @@ class TestGemCommandsCleanupCommand < Gem::TestCase
@cmd.execute
- assert_path_exists c_1.gem_dir
- refute_path_exists d_1.gem_dir
- refute_path_exists e_1.gem_dir
+ assert_path_exist c_1.gem_dir
+ assert_path_not_exist d_1.gem_dir
+ assert_path_not_exist e_1.gem_dir
end
def test_execute_user_install
@@ -282,10 +282,10 @@ class TestGemCommandsCleanupCommand < Gem::TestCase
@cmd.execute
- refute_path_exists c_1.gem_dir
- assert_path_exists c_2.gem_dir
+ assert_path_not_exist c_1.gem_dir
+ assert_path_exist c_2.gem_dir
- assert_path_exists d_1.gem_dir
- assert_path_exists d_2.gem_dir
+ assert_path_exist d_1.gem_dir
+ assert_path_exist d_2.gem_dir
end
end
diff --git a/test/rubygems/test_gem_commands_contents_command.rb b/test/rubygems/test_gem_commands_contents_command.rb
index 7c89c67dd4..2b04a9c654 100644
--- a/test/rubygems/test_gem_commands_contents_command.rb
+++ b/test/rubygems/test_gem_commands_contents_command.rb
@@ -50,7 +50,7 @@ class TestGemCommandsContentsCommand < Gem::TestCase
def test_execute_bad_gem
@cmd.options[:args] = %w[foo]
- assert_raises Gem::MockGemUi::TermError do
+ assert_raise Gem::MockGemUi::TermError do
use_ui @ui do
@cmd.execute
end
@@ -94,7 +94,7 @@ class TestGemCommandsContentsCommand < Gem::TestCase
def test_execute_missing_single
@cmd.options[:args] = %w[foo]
- assert_raises Gem::MockGemUi::TermError do
+ assert_raise Gem::MockGemUi::TermError do
use_ui @ui do
@cmd.execute
end
@@ -110,7 +110,7 @@ class TestGemCommandsContentsCommand < Gem::TestCase
gem 'foo', 1
- assert_raises Gem::MockGemUi::TermError do
+ assert_raise Gem::MockGemUi::TermError do
use_ui @ui do
@cmd.execute
end
diff --git a/test/rubygems/test_gem_commands_dependency_command.rb b/test/rubygems/test_gem_commands_dependency_command.rb
index 11d7f8017a..d49aa2f513 100644
--- a/test/rubygems/test_gem_commands_dependency_command.rb
+++ b/test/rubygems/test_gem_commands_dependency_command.rb
@@ -64,7 +64,7 @@ Gem x-2
def test_execute_no_match
@cmd.options[:args] = %w[foo]
- assert_raises Gem::MockGemUi::TermError do
+ assert_raise Gem::MockGemUi::TermError do
use_ui @stub_ui do
@cmd.execute
end
@@ -155,7 +155,7 @@ Gem foo-2
@cmd.options[:reverse_dependencies] = true
@cmd.options[:domain] = :remote
- assert_raises Gem::MockGemUi::TermError do
+ assert_raise Gem::MockGemUi::TermError do
use_ui @stub_ui do
@cmd.execute
end
diff --git a/test/rubygems/test_gem_commands_environment_command.rb b/test/rubygems/test_gem_commands_environment_command.rb
index a3edeb69bd..c31ca24869 100644
--- a/test/rubygems/test_gem_commands_environment_command.rb
+++ b/test/rubygems/test_gem_commands_environment_command.rb
@@ -109,7 +109,7 @@ class TestGemCommandsEnvironmentCommand < Gem::TestCase
def test_execute_unknown
@cmd.send :handle_options, %w[unknown]
- assert_raises Gem::CommandLineError do
+ assert_raise Gem::CommandLineError do
use_ui @ui do
@cmd.execute
end
diff --git a/test/rubygems/test_gem_commands_fetch_command.rb b/test/rubygems/test_gem_commands_fetch_command.rb
index dfe0d91726..9a81e8898e 100644
--- a/test/rubygems/test_gem_commands_fetch_command.rb
+++ b/test/rubygems/test_gem_commands_fetch_command.rb
@@ -16,7 +16,7 @@ class TestGemCommandsFetchCommand < Gem::TestCase
fetcher.gem 'a', 2
end
- refute_path_exists File.join(@tempdir, 'cache'), 'sanity check'
+ assert_path_not_exist File.join(@tempdir, 'cache'), 'sanity check'
@cmd.options[:args] = %w[a]
@@ -28,9 +28,9 @@ class TestGemCommandsFetchCommand < Gem::TestCase
a2 = specs['a-2']
- assert_path_exists(File.join(@tempdir, a2.file_name),
+ assert_path_exist(File.join(@tempdir, a2.file_name),
"#{a2.full_name} not fetched")
- refute_path_exists File.join(@tempdir, 'cache'),
+ assert_path_not_exist File.join(@tempdir, 'cache'),
'gem repository directories must not be created'
end
@@ -40,7 +40,7 @@ class TestGemCommandsFetchCommand < Gem::TestCase
fetcher.gem 'a', 2
end
- refute_path_exists File.join(@tempdir, 'cache'), 'sanity check'
+ assert_path_not_exist File.join(@tempdir, 'cache'), 'sanity check'
@cmd.options[:args] = %w[a]
@cmd.options[:version] = req('>= 0.1')
@@ -52,9 +52,9 @@ class TestGemCommandsFetchCommand < Gem::TestCase
end
a2 = specs['a-2']
- assert_path_exists(File.join(@tempdir, a2.file_name),
+ assert_path_exist(File.join(@tempdir, a2.file_name),
"#{a2.full_name} not fetched")
- refute_path_exists File.join(@tempdir, 'cache'),
+ assert_path_not_exist File.join(@tempdir, 'cache'),
'gem repository directories must not be created'
end
@@ -75,7 +75,7 @@ class TestGemCommandsFetchCommand < Gem::TestCase
a2 = specs['a-2']
- assert_path_exists(File.join(@tempdir, a2.file_name),
+ assert_path_exist(File.join(@tempdir, a2.file_name),
"#{a2.full_name} not fetched")
end
@@ -97,7 +97,7 @@ class TestGemCommandsFetchCommand < Gem::TestCase
a2_pre = specs['a-2.a']
- assert_path_exists(File.join(@tempdir, a2_pre.file_name),
+ assert_path_exist(File.join(@tempdir, a2_pre.file_name),
"#{a2_pre.full_name} not fetched")
end
@@ -118,7 +118,7 @@ class TestGemCommandsFetchCommand < Gem::TestCase
a1 = specs['a-1']
- assert_path_exists(File.join(@tempdir, a1.file_name),
+ assert_path_exist(File.join(@tempdir, a1.file_name),
"#{a1.full_name} not fetched")
end
end
diff --git a/test/rubygems/test_gem_commands_help_command.rb b/test/rubygems/test_gem_commands_help_command.rb
index 8d20563a60..24cf2d2250 100644
--- a/test/rubygems/test_gem_commands_help_command.rb
+++ b/test/rubygems/test_gem_commands_help_command.rb
@@ -48,7 +48,7 @@ class TestGemCommandsHelpCommand < Gem::TestCase
if Gem::HAVE_OPENSSL
assert_empty err
- refute_match 'No command found for ', out
+ refute_match %r{No command found for }, out
end
end
end
diff --git a/test/rubygems/test_gem_commands_install_command.rb b/test/rubygems/test_gem_commands_install_command.rb
index c8015f9985..c51bbf810d 100644
--- a/test/rubygems/test_gem_commands_install_command.rb
+++ b/test/rubygems/test_gem_commands_install_command.rb
@@ -37,7 +37,7 @@ class TestGemCommandsInstallCommand < Gem::TestCase
@cmd.options[:args] = %w[a]
use_ui @ui do
- assert_raises Gem::MockGemUi::SystemExitException, @ui.error do
+ assert_raise Gem::MockGemUi::SystemExitException, @ui.error do
@cmd.execute
end
end
@@ -59,7 +59,7 @@ class TestGemCommandsInstallCommand < Gem::TestCase
assert @cmd.options[:version].satisfied_by?(a2_pre.version)
use_ui @ui do
- assert_raises Gem::MockGemUi::SystemExitException, @ui.error do
+ assert_raise Gem::MockGemUi::SystemExitException, @ui.error do
@cmd.execute
end
end
@@ -82,7 +82,7 @@ class TestGemCommandsInstallCommand < Gem::TestCase
orig_dir = Dir.pwd
begin
Dir.chdir @tempdir
- assert_raises Gem::MockGemUi::SystemExitException, @ui.error do
+ assert_raise Gem::MockGemUi::SystemExitException, @ui.error do
@cmd.execute
end
ensure
@@ -110,7 +110,7 @@ class TestGemCommandsInstallCommand < Gem::TestCase
orig_dir = Dir.pwd
begin
Dir.chdir @tempdir
- e = assert_raises Gem::MockGemUi::TermError do
+ e = assert_raise Gem::MockGemUi::TermError do
@cmd.execute
end
assert_equal 2, e.exit_code
@@ -142,7 +142,7 @@ ERROR: Could not find a valid gem 'bar' (= 0.5) (required by 'foo' (>= 0)) in a
orig_dir = Dir.pwd
begin
Dir.chdir orig_dir
- assert_raises Gem::MockGemUi::SystemExitException, @ui.error do
+ assert_raise Gem::MockGemUi::SystemExitException, @ui.error do
@cmd.execute
end
ensure
@@ -173,7 +173,7 @@ ERROR: Could not find a valid gem 'bar' (= 0.5) (required by 'foo' (>= 0)) in a
begin
Dir.chdir @tempdir
FileUtils.rm_r [@gemhome, "gems"]
- assert_raises Gem::MockGemUi::SystemExitException, @ui.error do
+ assert_raise Gem::MockGemUi::SystemExitException, @ui.error do
@cmd.execute
end
ensure
@@ -187,8 +187,8 @@ ERROR: Could not find a valid gem 'bar' (= 0.5) (required by 'foo' (>= 0)) in a
end
def test_execute_no_user_install
- skip 'skipped on MS Windows (chmod has no effect)' if win_platform?
- skip 'skipped in root privilege' if Process.uid.zero?
+ pend 'skipped on MS Windows (chmod has no effect)' if win_platform?
+ pend 'skipped in root privilege' if Process.uid.zero?
specs = spec_fetcher do |fetcher|
fetcher.gem 'a', 2
@@ -207,7 +207,7 @@ ERROR: Could not find a valid gem 'bar' (= 0.5) (required by 'foo' (>= 0)) in a
FileUtils.chmod 0555, @gemhome
Dir.chdir @tempdir
- assert_raises Gem::FilePermissionError do
+ assert_raise Gem::FilePermissionError do
@cmd.execute
end
ensure
@@ -225,7 +225,7 @@ ERROR: Could not find a valid gem 'bar' (= 0.5) (required by 'foo' (>= 0)) in a
@cmd.options[:args] = %w[no_such_gem]
use_ui @ui do
- e = assert_raises Gem::MockGemUi::TermError do
+ e = assert_raise Gem::MockGemUi::TermError do
@cmd.execute
end
assert_equal 2, e.exit_code
@@ -244,7 +244,7 @@ ERROR: Could not find a valid gem 'bar' (= 0.5) (required by 'foo' (>= 0)) in a
@cmd.options[:args] = %w[no_such_gem]
use_ui @ui do
- e = assert_raises Gem::MockGemUi::TermError do
+ e = assert_raise Gem::MockGemUi::TermError do
@cmd.execute
end
assert_equal 2, e.exit_code
@@ -257,7 +257,7 @@ ERROR: Could not find a valid gem 'bar' (= 0.5) (required by 'foo' (>= 0)) in a
def test_execute_no_gem
@cmd.options[:args] = %w[]
- assert_raises Gem::CommandLineError do
+ assert_raise Gem::CommandLineError do
@cmd.execute
end
end
@@ -268,7 +268,7 @@ ERROR: Could not find a valid gem 'bar' (= 0.5) (required by 'foo' (>= 0)) in a
@cmd.options[:args] = %w[nonexistent]
use_ui @ui do
- e = assert_raises Gem::MockGemUi::TermError do
+ e = assert_raise Gem::MockGemUi::TermError do
@cmd.execute
end
assert_equal 2, e.exit_code
@@ -285,7 +285,7 @@ ERROR: Could not find a valid gem 'bar' (= 0.5) (required by 'foo' (>= 0)) in a
@cmd.options[:args] = ['foo']
use_ui @ui do
- e = assert_raises Gem::MockGemUi::TermError do
+ e = assert_raise Gem::MockGemUi::TermError do
@cmd.execute
end
@@ -301,7 +301,7 @@ ERROR: Could not find a valid gem 'bar' (= 0.5) (required by 'foo' (>= 0)) in a
def test_execute_http_proxy
use_ui @ui do
- e = assert_raises ArgumentError, @ui.error do
+ e = assert_raise ArgumentError, @ui.error do
@cmd.handle_options %w[-p=foo.bar.com]
end
@@ -327,7 +327,7 @@ ERROR: Could not find a valid gem 'bar' (= 0.5) (required by 'foo' (>= 0)) in a
@cmd.options[:args] = %w[nonexistent]
use_ui @ui do
- e = assert_raises Gem::MockGemUi::TermError do
+ e = assert_raise Gem::MockGemUi::TermError do
@cmd.execute
end
assert_equal 2, e.exit_code
@@ -351,7 +351,7 @@ ERROR: Could not find a valid gem 'bar' (= 0.5) (required by 'foo' (>= 0)) in a
@cmd.options[:suggest_alternate] = false
use_ui @ui do
- e = assert_raises Gem::MockGemUi::TermError do
+ e = assert_raise Gem::MockGemUi::TermError do
@cmd.execute
end
@@ -376,7 +376,7 @@ ERROR: Could not find a valid gem 'nonexistent_with_hint' (>= 0) in any reposit
@cmd.options[:args] = [misspelled]
use_ui @ui do
- e = assert_raises Gem::MockGemUi::TermError do
+ e = assert_raise Gem::MockGemUi::TermError do
@cmd.execute
end
@@ -401,7 +401,7 @@ ERROR: Possible alternatives: non_existent_with_hint
@cmd.options[:args] = [misspelled]
use_ui @ui do
- e = assert_raises Gem::MockGemUi::TermError do
+ e = assert_raise Gem::MockGemUi::TermError do
@cmd.execute
end
@@ -423,7 +423,7 @@ ERROR: Possible alternatives: non_existent_with_hint
@cmd.options[:install_dir] = "whatever"
use_ui @ui do
- assert_raises Gem::MockGemUi::TermError do
+ assert_raise Gem::MockGemUi::TermError do
@cmd.execute
end
end
@@ -443,7 +443,7 @@ ERROR: Possible alternatives: non_existent_with_hint
@cmd.options[:args] = %w[a]
use_ui @ui do
- assert_raises Gem::MockGemUi::SystemExitException, @ui.error do
+ assert_raise Gem::MockGemUi::SystemExitException, @ui.error do
@cmd.execute
end
end
@@ -461,7 +461,7 @@ ERROR: Possible alternatives: non_existent_with_hint
@cmd.options[:args] = %w[a]
use_ui @ui do
- assert_raises Gem::MockGemUi::SystemExitException, @ui.error do
+ assert_raise Gem::MockGemUi::SystemExitException, @ui.error do
@cmd.execute
end
end
@@ -478,7 +478,7 @@ ERROR: Possible alternatives: non_existent_with_hint
@cmd.options[:args] = %w[a:1]
use_ui @ui do
- assert_raises Gem::MockGemUi::SystemExitException, @ui.error do
+ assert_raise Gem::MockGemUi::SystemExitException, @ui.error do
@cmd.execute
end
end
@@ -496,7 +496,7 @@ ERROR: Possible alternatives: non_existent_with_hint
@cmd.options[:args] = %w[a]
use_ui @ui do
- assert_raises Gem::MockGemUi::SystemExitException, @ui.error do
+ assert_raise Gem::MockGemUi::SystemExitException, @ui.error do
@cmd.execute
end
end
@@ -526,7 +526,7 @@ ERROR: Possible alternatives: non_existent_with_hint
@cmd.options[:args] = %w[a]
use_ui @ui do
- assert_raises Gem::MockGemUi::SystemExitException, @ui.error do
+ assert_raise Gem::MockGemUi::SystemExitException, @ui.error do
@cmd.execute
end
end
@@ -547,7 +547,7 @@ ERROR: Possible alternatives: non_existent_with_hint
@cmd.options[:args] = %w[a]
use_ui @ui do
- assert_raises Gem::MockGemUi::SystemExitException, @ui.error do
+ assert_raise Gem::MockGemUi::SystemExitException, @ui.error do
@cmd.execute
end
end
@@ -565,7 +565,7 @@ ERROR: Possible alternatives: non_existent_with_hint
@cmd.options[:args] = %w[a]
use_ui @ui do
- assert_raises Gem::MockGemUi::TermError do
+ assert_raise Gem::MockGemUi::TermError do
@cmd.execute
end
end
@@ -585,7 +585,7 @@ ERROR: Possible alternatives: non_existent_with_hint
@cmd.options[:args] = %w[a]
use_ui @ui do
- assert_raises Gem::MockGemUi::SystemExitException, @ui.error do
+ assert_raise Gem::MockGemUi::SystemExitException, @ui.error do
@cmd.execute
end
end
@@ -605,7 +605,7 @@ ERROR: Possible alternatives: non_existent_with_hint
@cmd.options[:args] = %w[a]
use_ui @ui do
- assert_raises Gem::MockGemUi::TermError do
+ assert_raise Gem::MockGemUi::TermError do
@cmd.execute
end
end
@@ -625,7 +625,7 @@ ERROR: Possible alternatives: non_existent_with_hint
@cmd.options[:args] = %w[a]
use_ui @ui do
- assert_raises Gem::MockGemUi::TermError do
+ assert_raise Gem::MockGemUi::TermError do
@cmd.execute
end
end
@@ -657,7 +657,7 @@ ERROR: Possible alternatives: non_existent_with_hint
begin
Dir.chdir @tempdir
- assert_raises Gem::MockGemUi::SystemExitException, @ui.error do
+ assert_raise Gem::MockGemUi::SystemExitException, @ui.error do
@cmd.execute
end
ensure
@@ -667,8 +667,8 @@ ERROR: Possible alternatives: non_existent_with_hint
wait_for_child_process_to_exit
- assert_path_exists File.join(a2.doc_dir, 'ri')
- assert_path_exists File.join(a2.doc_dir, 'rdoc')
+ assert_path_exist File.join(a2.doc_dir, 'ri')
+ assert_path_exist File.join(a2.doc_dir, 'rdoc')
end
def test_execute_rdoc_with_path
@@ -694,7 +694,7 @@ ERROR: Possible alternatives: non_existent_with_hint
begin
Dir.chdir @tempdir
- assert_raises Gem::MockGemUi::SystemExitException, @ui.error do
+ assert_raise Gem::MockGemUi::SystemExitException, @ui.error do
@cmd.execute
end
ensure
@@ -704,7 +704,7 @@ ERROR: Possible alternatives: non_existent_with_hint
wait_for_child_process_to_exit
- assert_path_exists 'whatever/doc/a-2', 'documentation not installed'
+ assert_path_exist 'whatever/doc/a-2', 'documentation not installed'
end
def test_execute_saves_build_args
@@ -730,7 +730,7 @@ ERROR: Possible alternatives: non_existent_with_hint
begin
Dir.chdir @tempdir
- assert_raises Gem::MockGemUi::SystemExitException, @ui.error do
+ assert_raise Gem::MockGemUi::SystemExitException, @ui.error do
@cmd.execute
end
ensure
@@ -739,7 +739,7 @@ ERROR: Possible alternatives: non_existent_with_hint
end
path = a2.build_info_file
- assert_path_exists path
+ assert_path_exist path
assert_equal args, a2.build_args
end
@@ -752,7 +752,7 @@ ERROR: Possible alternatives: non_existent_with_hint
@cmd.options[:args] = %w[a]
use_ui @ui do
- assert_raises Gem::MockGemUi::SystemExitException, @ui.error do
+ assert_raise Gem::MockGemUi::SystemExitException, @ui.error do
@cmd.execute
end
end
@@ -772,7 +772,7 @@ ERROR: Possible alternatives: non_existent_with_hint
@cmd.options[:args] = %w[a]
use_ui @ui do
- assert_raises Gem::MockGemUi::SystemExitException, @ui.error do
+ assert_raise Gem::MockGemUi::SystemExitException, @ui.error do
@cmd.execute
end
end
@@ -812,7 +812,7 @@ ERROR: Possible alternatives: non_existent_with_hint
use_ui @ui do
Dir.chdir @tempdir do
- assert_raises Gem::MockGemUi::SystemExitException, @ui.error do
+ assert_raise Gem::MockGemUi::SystemExitException, @ui.error do
@cmd.execute
end
end
@@ -844,7 +844,7 @@ ERROR: Possible alternatives: non_existent_with_hint
orig_dir = Dir.pwd
begin
Dir.chdir @tempdir
- assert_raises Gem::MockGemUi::SystemExitException, @ui.error do
+ assert_raise Gem::MockGemUi::SystemExitException, @ui.error do
@cmd.execute
end
ensure
@@ -862,7 +862,7 @@ ERROR: Possible alternatives: non_existent_with_hint
@cmd.options[:version] = Gem::Requirement.new("> 1")
use_ui @ui do
- e = assert_raises Gem::MockGemUi::TermError do
+ e = assert_raise Gem::MockGemUi::TermError do
@cmd.execute
end
@@ -889,7 +889,7 @@ ERROR: Possible alternatives: non_existent_with_hint
@cmd.options[:args] = %w[a:1 b:1]
use_ui @ui do
- assert_raises Gem::MockGemUi::SystemExitException, @ui.error do
+ assert_raise Gem::MockGemUi::SystemExitException, @ui.error do
@cmd.execute
end
end
@@ -912,7 +912,7 @@ ERROR: Possible alternatives: non_existent_with_hint
orig_dir = Dir.pwd
begin
Dir.chdir @tempdir
- assert_raises Gem::MockGemUi::SystemExitException do
+ assert_raise Gem::MockGemUi::SystemExitException do
@cmd.execute
end
ensure
@@ -1007,7 +1007,7 @@ ERROR: Possible alternatives: non_existent_with_hint
orig_dir = Dir.pwd
begin
Dir.chdir @tempdir
- e = assert_raises Gem::MockGemUi::TermError do
+ e = assert_raise Gem::MockGemUi::TermError do
@cmd.execute
end
ensure
@@ -1029,7 +1029,7 @@ ERROR: Possible alternatives: non_existent_with_hint
orig_dir = Dir.pwd
begin
Dir.chdir @tempdir
- e = assert_raises Gem::MockGemUi::TermError do
+ e = assert_raise Gem::MockGemUi::TermError do
@cmd.execute
end
ensure
@@ -1052,7 +1052,7 @@ ERROR: Possible alternatives: non_existent_with_hint
@cmd.options[:args] = %w[a]
use_ui @ui do
- assert_raises Gem::MockGemUi::SystemExitException, @ui.error do
+ assert_raise Gem::MockGemUi::SystemExitException, @ui.error do
@cmd.execute
end
end
@@ -1079,7 +1079,7 @@ ERROR: Possible alternatives: non_existent_with_hint
@cmd.options[:gemdeps] = @gemdeps
use_ui @ui do
- assert_raises Gem::MockGemUi::SystemExitException, @ui.error do
+ assert_raise Gem::MockGemUi::SystemExitException, @ui.error do
@cmd.execute
end
end
@@ -1103,7 +1103,7 @@ ERROR: Possible alternatives: non_existent_with_hint
@cmd.options[:gemdeps] = @gemdeps
use_ui @ui do
- assert_raises Gem::MockGemUi::SystemExitException, @ui.error do
+ assert_raise Gem::MockGemUi::SystemExitException, @ui.error do
@cmd.execute
end
end
@@ -1128,7 +1128,7 @@ ERROR: Possible alternatives: non_existent_with_hint
@cmd.options[:gemdeps] = @gemdeps
use_ui @ui do
- assert_raises Gem::MockGemUi::SystemExitException, @ui.error do
+ assert_raise Gem::MockGemUi::SystemExitException, @ui.error do
@cmd.execute
end
end
@@ -1150,7 +1150,7 @@ ERROR: Possible alternatives: non_existent_with_hint
@cmd.options[:gemdeps] = @gemdeps
use_ui @ui do
- assert_raises Gem::MockGemUi::SystemExitException, @ui.error do
+ assert_raise Gem::MockGemUi::SystemExitException, @ui.error do
@cmd.execute
end
end
@@ -1173,7 +1173,7 @@ ERROR: Possible alternatives: non_existent_with_hint
@cmd.options[:gemdeps] = @gemdeps
use_ui @ui do
- assert_raises Gem::MockGemUi::SystemExitException, @ui.error do
+ assert_raise Gem::MockGemUi::SystemExitException, @ui.error do
@cmd.execute
end
end
@@ -1200,7 +1200,7 @@ ERROR: Possible alternatives: non_existent_with_hint
@cmd.options[:gemdeps] = @gemdeps
use_ui @ui do
- assert_raises Gem::MockGemUi::SystemExitException, @ui.error do
+ assert_raise Gem::MockGemUi::SystemExitException, @ui.error do
@cmd.execute
end
end
@@ -1227,7 +1227,7 @@ ERROR: Possible alternatives: non_existent_with_hint
@cmd.options[:gemdeps] = @gemdeps
use_ui @ui do
- assert_raises Gem::MockGemUi::SystemExitException, @ui.error do
+ assert_raise Gem::MockGemUi::SystemExitException, @ui.error do
@cmd.execute
end
end
@@ -1259,7 +1259,7 @@ ERROR: Possible alternatives: non_existent_with_hint
@cmd.options[:gemdeps] = @gemdeps
use_ui @ui do
- assert_raises Gem::MockGemUi::SystemExitException, @ui.error do
+ assert_raise Gem::MockGemUi::SystemExitException, @ui.error do
@cmd.execute
end
end
@@ -1294,7 +1294,7 @@ ERROR: Possible alternatives: non_existent_with_hint
@cmd.options[:gemdeps] = @gemdeps
use_ui @ui do
- assert_raises Gem::MockGemUi::SystemExitException, @ui.error do
+ assert_raise Gem::MockGemUi::SystemExitException, @ui.error do
@cmd.execute
end
end
@@ -1379,7 +1379,7 @@ ERROR: Possible alternatives: non_existent_with_hint
@cmd.options[:args] = %w[a]
use_ui @ui do
- assert_raises Gem::MockGemUi::SystemExitException, @ui.error do
+ assert_raise Gem::MockGemUi::SystemExitException, @ui.error do
@cmd.execute
end
end
@@ -1406,7 +1406,7 @@ ERROR: Possible alternatives: non_existent_with_hint
@cmd.options[:args] = %w[a]
use_ui @ui do
- assert_raises Gem::MockGemUi::SystemExitException, @ui.error do
+ assert_raise Gem::MockGemUi::SystemExitException, @ui.error do
@cmd.execute
end
end
@@ -1435,7 +1435,7 @@ ERROR: Possible alternatives: non_existent_with_hint
@cmd.options[:args] = %w[a]
use_ui @ui do
- assert_raises Gem::MockGemUi::SystemExitException, @ui.error do
+ assert_raise Gem::MockGemUi::SystemExitException, @ui.error do
@cmd.execute
end
end
@@ -1465,7 +1465,7 @@ ERROR: Possible alternatives: non_existent_with_hint
@cmd.options[:args] = %w[a]
use_ui @ui do
- assert_raises Gem::MockGemUi::SystemExitException, @ui.error do
+ assert_raise Gem::MockGemUi::SystemExitException, @ui.error do
@cmd.execute
end
end
diff --git a/test/rubygems/test_gem_commands_list_command.rb b/test/rubygems/test_gem_commands_list_command.rb
index 87da8dbd48..772a99eabd 100644
--- a/test/rubygems/test_gem_commands_list_command.rb
+++ b/test/rubygems/test_gem_commands_list_command.rb
@@ -20,7 +20,7 @@ class TestGemCommandsListCommand < Gem::TestCase
def test_execute_installed
@cmd.handle_options %w[c --installed]
- assert_raises Gem::MockGemUi::SystemExitException do
+ assert_raise Gem::MockGemUi::SystemExitException do
use_ui @ui do
@cmd.execute
end
diff --git a/test/rubygems/test_gem_commands_lock_command.rb b/test/rubygems/test_gem_commands_lock_command.rb
index 3612778293..81252e6409 100644
--- a/test/rubygems/test_gem_commands_lock_command.rb
+++ b/test/rubygems/test_gem_commands_lock_command.rb
@@ -55,7 +55,7 @@ gem 'd', '= 1'
def test_execute_strict
@cmd.handle_options %w[c-1 --strict]
- e = assert_raises Gem::Exception do
+ e = assert_raise Gem::Exception do
use_ui @ui do
@cmd.execute
end
diff --git a/test/rubygems/test_gem_commands_open_command.rb b/test/rubygems/test_gem_commands_open_command.rb
index d3c665217f..2c32b810cc 100644
--- a/test/rubygems/test_gem_commands_open_command.rb
+++ b/test/rubygems/test_gem_commands_open_command.rb
@@ -25,16 +25,15 @@ class TestGemCommandsOpenCommand < Gem::TestCase
gem 'foo', '1.0.0'
spec = gem 'foo', '1.0.1'
- mock = Minitest::Mock.new
- mock.expect(:call, true, [spec.full_gem_path])
- Dir.stub(:chdir, mock) do
- use_ui @ui do
- @cmd.execute
+ assert_nothing_raised Gem::MockGemUi::TermError do
+ Dir.stub(:chdir, spec.full_gem_path) do
+ use_ui @ui do
+ @cmd.execute
+ end
end
end
- assert mock.verify
assert_equal "", @ui.error
end
@@ -44,7 +43,7 @@ class TestGemCommandsOpenCommand < Gem::TestCase
gem "foo", "5.0"
- assert_raises Gem::MockGemUi::TermError do
+ assert_raise Gem::MockGemUi::TermError do
use_ui @ui do
@cmd.execute
end
@@ -57,7 +56,7 @@ class TestGemCommandsOpenCommand < Gem::TestCase
def test_execute_bad_gem
@cmd.options[:args] = %w[foo]
- assert_raises Gem::MockGemUi::TermError do
+ assert_raise Gem::MockGemUi::TermError do
use_ui @ui do
@cmd.execute
end
@@ -86,7 +85,7 @@ class TestGemCommandsOpenCommand < Gem::TestCase
gem("foo", "1.0")
- assert_raises Gem::MockGemUi::TermError do
+ assert_raise Gem::MockGemUi::TermError do
use_ui @ui do
@cmd.execute
end
diff --git a/test/rubygems/test_gem_commands_owner_command.rb b/test/rubygems/test_gem_commands_owner_command.rb
index 4280fedff3..730048e0ff 100644
--- a/test/rubygems/test_gem_commands_owner_command.rb
+++ b/test/rubygems/test_gem_commands_owner_command.rb
@@ -53,7 +53,7 @@ EOF
end
def test_show_owners_dont_load_objects
- skip "testing a psych-only API" unless defined?(::Psych::DisallowedClass)
+ pend "testing a psych-only API" unless defined?(::Psych::DisallowedClass)
response = <<EOF
---
@@ -68,7 +68,7 @@ EOF
@stub_fetcher.data["#{Gem.host}/api/v1/gems/freewill/owners.yaml"] = [response, 200, 'OK']
- assert_raises Psych::DisallowedClass do
+ assert_raise Psych::DisallowedClass do
use_ui @ui do
@cmd.show_owners("freewill")
end
@@ -109,7 +109,7 @@ EOF
response = "You don't have permission to push to this gem"
@stub_fetcher.data["#{Gem.host}/api/v1/gems/freewill/owners.yaml"] = [response, 403, 'Forbidden']
- assert_raises Gem::MockGemUi::TermError do
+ assert_raise Gem::MockGemUi::TermError do
use_ui @stub_ui do
@cmd.show_owners("freewill")
end
diff --git a/test/rubygems/test_gem_commands_pristine_command.rb b/test/rubygems/test_gem_commands_pristine_command.rb
index 59f34af249..118b2334fc 100644
--- a/test/rubygems/test_gem_commands_pristine_command.rb
+++ b/test/rubygems/test_gem_commands_pristine_command.rb
@@ -155,7 +155,7 @@ class TestGemCommandsPristineCommand < Gem::TestCase
@cmd.execute
end
- assert_path_exists gem_exec
+ assert_path_exist gem_exec
ruby_exec = sprintf Gem.default_exec_format, 'ruby'
@@ -356,10 +356,10 @@ class TestGemCommandsPristineCommand < Gem::TestCase
assert_equal "Restored #{b.full_name}", out.shift
assert_empty out, out.inspect
- assert_path_exists File.join(@gemhome, "gems", 'a-2')
- refute_path_exists File.join(gemhome2, "gems", 'a-2')
- assert_path_exists File.join(gemhome2, "gems", 'b-2')
- refute_path_exists File.join(@gemhome, "gems", 'b-2')
+ assert_path_exist File.join(@gemhome, "gems", 'a-2')
+ assert_path_not_exist File.join(gemhome2, "gems", 'a-2')
+ assert_path_exist File.join(gemhome2, "gems", 'b-2')
+ assert_path_not_exist File.join(@gemhome, "gems", 'b-2')
end
def test_execute_missing_cache_gem
@@ -434,21 +434,21 @@ class TestGemCommandsPristineCommand < Gem::TestCase
assert_empty out, out.inspect
assert_empty @ui.error
- assert_path_exists File.join(@gemhome, "cache", 'a-1.gem')
- refute_path_exists File.join(gemhome2, "cache", 'a-2.gem')
- assert_path_exists File.join(@gemhome, "gems", 'a-1')
- refute_path_exists File.join(gemhome2, "gems", 'a-1')
+ assert_path_exist File.join(@gemhome, "cache", 'a-1.gem')
+ assert_path_not_exist File.join(gemhome2, "cache", 'a-2.gem')
+ assert_path_exist File.join(@gemhome, "gems", 'a-1')
+ assert_path_not_exist File.join(gemhome2, "gems", 'a-1')
- assert_path_exists File.join(gemhome2, "cache", 'b-1.gem')
- refute_path_exists File.join(@gemhome, "cache", 'b-2.gem')
- assert_path_exists File.join(gemhome2, "gems", 'b-1')
- refute_path_exists File.join(@gemhome, "gems", 'b-1')
+ assert_path_exist File.join(gemhome2, "cache", 'b-1.gem')
+ assert_path_not_exist File.join(@gemhome, "cache", 'b-2.gem')
+ assert_path_exist File.join(gemhome2, "gems", 'b-1')
+ assert_path_not_exist File.join(@gemhome, "gems", 'b-1')
end
def test_execute_no_gem
@cmd.options[:args] = %w[]
- e = assert_raises Gem::CommandLineError do
+ e = assert_raise Gem::CommandLineError do
use_ui @ui do
@cmd.execute
end
diff --git a/test/rubygems/test_gem_commands_push_command.rb b/test/rubygems/test_gem_commands_push_command.rb
index 55dd51e6ad..4f0feabfa7 100644
--- a/test/rubygems/test_gem_commands_push_command.rb
+++ b/test/rubygems/test_gem_commands_push_command.rb
@@ -123,7 +123,7 @@ class TestGemCommandsPushCommand < Gem::TestCase
Gem.configuration.disable_default_gem_server = true
response = "You must specify a gem server"
- assert_raises Gem::MockGemUi::TermError do
+ assert_raise Gem::MockGemUi::TermError do
use_ui @ui do
@cmd.send_gem(@path)
end
@@ -252,7 +252,7 @@ class TestGemCommandsPushCommand < Gem::TestCase
response = %(ERROR: "#{@host}" is not allowed by the gemspec, which only allows "https://privategemserver.example")
- assert_raises Gem::MockGemUi::TermError do
+ assert_raise Gem::MockGemUi::TermError do
send_battery
end
@@ -284,7 +284,7 @@ class TestGemCommandsPushCommand < Gem::TestCase
response = "ERROR: \"#{@host}\" is not allowed by the gemspec, which only allows \"#{push_host}\""
- assert_raises Gem::MockGemUi::TermError do
+ assert_raise Gem::MockGemUi::TermError do
send_battery
end
@@ -332,7 +332,7 @@ class TestGemCommandsPushCommand < Gem::TestCase
def test_raises_error_with_no_arguments
def @cmd.sign_in(*); end
- assert_raises Gem::CommandLineError do
+ assert_raise Gem::CommandLineError do
@cmd.execute
end
end
@@ -342,7 +342,7 @@ class TestGemCommandsPushCommand < Gem::TestCase
@fetcher.data["#{@host}/api/v1/gems"] = [response, 403, 'Forbidden']
@cmd.instance_variable_set :@host, @host
- assert_raises Gem::MockGemUi::TermError do
+ assert_raise Gem::MockGemUi::TermError do
use_ui @ui do
@cmd.send_gem(@path)
end
@@ -392,7 +392,7 @@ class TestGemCommandsPushCommand < Gem::TestCase
@fetcher.data["#{Gem.host}/api/v1/gems"] = [response, 401, 'Unauthorized']
@otp_ui = Gem::MockGemUi.new "111111\n"
- assert_raises Gem::MockGemUi::TermError do
+ assert_raise Gem::MockGemUi::TermError do
use_ui @otp_ui do
@cmd.send_gem(@path)
end
diff --git a/test/rubygems/test_gem_commands_query_command.rb b/test/rubygems/test_gem_commands_query_command.rb
index a21bc690fb..cb95f185ab 100644
--- a/test/rubygems/test_gem_commands_query_command.rb
+++ b/test/rubygems/test_gem_commands_query_command.rb
@@ -213,7 +213,7 @@ pl (1)
def test_execute_installed
@cmd.handle_options %w[-n a --installed]
- assert_raises Gem::MockGemUi::SystemExitException do
+ assert_raise Gem::MockGemUi::SystemExitException do
use_ui @stub_ui do
@cmd.execute
end
@@ -226,7 +226,7 @@ pl (1)
def test_execute_installed_inverse
@cmd.handle_options %w[-n a --no-installed]
- e = assert_raises Gem::MockGemUi::TermError do
+ e = assert_raise Gem::MockGemUi::TermError do
use_ui @stub_ui do
@cmd.execute
end
@@ -241,7 +241,7 @@ pl (1)
def test_execute_installed_inverse_not_installed
@cmd.handle_options %w[-n not_installed --no-installed]
- assert_raises Gem::MockGemUi::SystemExitException do
+ assert_raise Gem::MockGemUi::SystemExitException do
use_ui @stub_ui do
@cmd.execute
end
@@ -254,7 +254,7 @@ pl (1)
def test_execute_installed_no_name
@cmd.handle_options %w[--installed]
- e = assert_raises Gem::MockGemUi::TermError do
+ e = assert_raise Gem::MockGemUi::TermError do
use_ui @stub_ui do
@cmd.execute
end
@@ -269,7 +269,7 @@ pl (1)
def test_execute_installed_not_installed
@cmd.handle_options %w[-n not_installed --installed]
- e = assert_raises Gem::MockGemUi::TermError do
+ e = assert_raise Gem::MockGemUi::TermError do
use_ui @stub_ui do
@cmd.execute
end
@@ -284,7 +284,7 @@ pl (1)
def test_execute_installed_version
@cmd.handle_options %w[-n a --installed --version 2]
- assert_raises Gem::MockGemUi::SystemExitException do
+ assert_raise Gem::MockGemUi::SystemExitException do
use_ui @stub_ui do
@cmd.execute
end
@@ -297,7 +297,7 @@ pl (1)
def test_execute_installed_version_not_installed
@cmd.handle_options %w[-n c --installed --version 2]
- e = assert_raises Gem::MockGemUi::TermError do
+ e = assert_raise Gem::MockGemUi::TermError do
use_ui @stub_ui do
@cmd.execute
end
diff --git a/test/rubygems/test_gem_commands_server_command.rb b/test/rubygems/test_gem_commands_server_command.rb
index 89bdce05cd..36c1feaec2 100644
--- a/test/rubygems/test_gem_commands_server_command.rb
+++ b/test/rubygems/test_gem_commands_server_command.rb
@@ -44,14 +44,14 @@ class TestGemCommandsServerCommand < Gem::TestCase
# for container environment on GitHub Actions
end
- e = assert_raises OptionParser::InvalidArgument do
+ e = assert_raise OptionParser::InvalidArgument do
@cmd.send :handle_options, %w[-p nonexistent]
end
assert_equal 'invalid argument: -p nonexistent: no such named service',
e.message
- e = assert_raises OptionParser::InvalidArgument do
+ e = assert_raise OptionParser::InvalidArgument do
@cmd.send :handle_options, %w[-p 65536]
end
diff --git a/test/rubygems/test_gem_commands_setup_command.rb b/test/rubygems/test_gem_commands_setup_command.rb
index 29850c9074..94e7d7c82f 100644
--- a/test/rubygems/test_gem_commands_setup_command.rb
+++ b/test/rubygems/test_gem_commands_setup_command.rb
@@ -169,14 +169,14 @@ class TestGemCommandsSetupCommand < Gem::TestCase
Dir.mktmpdir 'lib' do |dir|
@cmd.install_lib dir
- assert_path_exists File.join(dir, 'rubygems.rb')
- assert_path_exists File.join(dir, 'rubygems/ssl_certs/rubygems.org/foo.pem')
+ assert_path_exist File.join(dir, 'rubygems.rb')
+ assert_path_exist File.join(dir, 'rubygems/ssl_certs/rubygems.org/foo.pem')
- assert_path_exists File.join(dir, 'bundler.rb')
- assert_path_exists File.join(dir, 'bundler/b.rb')
+ assert_path_exist File.join(dir, 'bundler.rb')
+ assert_path_exist File.join(dir, 'bundler/b.rb')
- assert_path_exists File.join(dir, 'bundler/templates/.circleci/config.yml') unless RUBY_ENGINE == "truffleruby" # https://github.com/oracle/truffleruby/issues/2116
- assert_path_exists File.join(dir, 'bundler/templates/.travis.yml')
+ assert_path_exist File.join(dir, 'bundler/templates/.circleci/config.yml') unless RUBY_ENGINE == "truffleruby" # https://github.com/oracle/truffleruby/issues/2116
+ assert_path_exist File.join(dir, 'bundler/templates/.travis.yml')
end
end
@@ -192,27 +192,27 @@ class TestGemCommandsSetupCommand < Gem::TestCase
spec.executables.each do |e|
if Gem.win_platform?
- assert_path_exists File.join(bin_dir, "#{e}.bat")
+ assert_path_exist File.join(bin_dir, "#{e}.bat")
end
- assert_path_exists File.join bin_dir, e
+ assert_path_exist File.join bin_dir, e
end
default_dir = Gem.default_specifications_dir
# expect to remove other versions of bundler gemspecs on default specification directory.
- refute_path_exists File.join(default_dir, "bundler-1.15.4.gemspec")
- assert_path_exists File.join(default_dir, "bundler-#{BUNDLER_VERS}.gemspec")
+ assert_path_not_exist File.join(default_dir, "bundler-1.15.4.gemspec")
+ assert_path_exist File.join(default_dir, "bundler-#{BUNDLER_VERS}.gemspec")
# expect to not remove bundler-* gemspecs.
- assert_path_exists File.join(Gem.dir, "specifications", "bundler-audit-1.0.0.gemspec")
+ assert_path_exist File.join(Gem.dir, "specifications", "bundler-audit-1.0.0.gemspec")
# expect to remove normal gem that was same version. because it's promoted default gems.
- refute_path_exists File.join(Gem.dir, "specifications", "bundler-#{BUNDLER_VERS}.gemspec")
+ assert_path_not_exist File.join(Gem.dir, "specifications", "bundler-#{BUNDLER_VERS}.gemspec")
- assert_path_exists "#{Gem.dir}/gems/bundler-#{BUNDLER_VERS}"
- assert_path_exists "#{Gem.dir}/gems/bundler-1.15.4"
- assert_path_exists "#{Gem.dir}/gems/bundler-audit-1.0.0"
+ assert_path_exist "#{Gem.dir}/gems/bundler-#{BUNDLER_VERS}"
+ assert_path_exist "#{Gem.dir}/gems/bundler-1.15.4"
+ assert_path_exist "#{Gem.dir}/gems/bundler-audit-1.0.0"
end
def test_install_default_bundler_gem_with_force_flag
@@ -238,10 +238,10 @@ class TestGemCommandsSetupCommand < Gem::TestCase
spec.executables.each do |e|
if Gem.win_platform?
- assert_path_exists File.join(bin_dir, "#{e}.bat")
+ assert_path_exist File.join(bin_dir, "#{e}.bat")
end
- assert_path_exists File.join bin_dir, e
+ assert_path_exist File.join bin_dir, e
end
end
end
@@ -272,9 +272,9 @@ class TestGemCommandsSetupCommand < Gem::TestCase
@cmd.remove_old_lib_files lib
- files_that_go.each {|file| refute_path_exists(file) unless file == old_bundler_ci && RUBY_ENGINE == "truffleruby" } # https://github.com/oracle/truffleruby/issues/2116
+ files_that_go.each {|file| assert_path_not_exist(file) unless file == old_bundler_ci && RUBY_ENGINE == "truffleruby" } # https://github.com/oracle/truffleruby/issues/2116
- files_that_stay.each {|file| assert_path_exists file }
+ files_that_stay.each {|file| assert_path_exist file }
end
def test_remove_old_man_files
@@ -295,9 +295,9 @@ class TestGemCommandsSetupCommand < Gem::TestCase
@cmd.remove_old_man_files man
- files_that_go.each {|file| refute_path_exists file }
+ files_that_go.each {|file| assert_path_not_exist file }
- files_that_stay.each {|file| assert_path_exists file }
+ files_that_stay.each {|file| assert_path_exist file }
end
def test_show_release_notes
diff --git a/test/rubygems/test_gem_commands_signin_command.rb b/test/rubygems/test_gem_commands_signin_command.rb
index f8262466b1..596f262082 100644
--- a/test/rubygems/test_gem_commands_signin_command.rb
+++ b/test/rubygems/test_gem_commands_signin_command.rb
@@ -30,10 +30,10 @@ class TestGemCommandsSigninCommand < Gem::TestCase
host = 'http://some-gemcutter-compatible-host.org'
util_capture(nil, host) { @cmd.execute }
- old_credentials = YAML.load_file Gem.configuration.credentials_path
+ old_credentials = load_yaml_file Gem.configuration.credentials_path
util_capture(nil, host) { @cmd.execute }
- new_credentials = YAML.load_file Gem.configuration.credentials_path
+ new_credentials = load_yaml_file Gem.configuration.credentials_path
assert_equal old_credentials[host], new_credentials[host]
end
@@ -45,7 +45,7 @@ class TestGemCommandsSigninCommand < Gem::TestCase
host = 'http://some-gemcutter-compatible-host.org'
util_capture(nil, host, api_key) { @cmd.execute }
- credentials = YAML.load_file Gem.configuration.credentials_path
+ credentials = load_yaml_file Gem.configuration.credentials_path
assert_equal credentials[:rubygems_api_key], api_key
@@ -60,7 +60,7 @@ class TestGemCommandsSigninCommand < Gem::TestCase
assert_match %r{Signed in.}, sign_in_ui.output
api_key = 'a5fdbb6ba150cbb83aad2bb2fede64cf040453903'
- credentials = YAML.load_file Gem.configuration.credentials_path
+ credentials = load_yaml_file Gem.configuration.credentials_path
assert_equal api_key, credentials[host]
end
@@ -68,7 +68,7 @@ class TestGemCommandsSigninCommand < Gem::TestCase
util_capture { @cmd.execute }
api_key = 'a5fdbb6ba150cbb83aad2bb2fede64cf040453903'
- credentials = YAML.load_file Gem.configuration.credentials_path
+ credentials = load_yaml_file Gem.configuration.credentials_path
assert_equal api_key, credentials[:rubygems_api_key]
end
@@ -94,7 +94,7 @@ class TestGemCommandsSigninCommand < Gem::TestCase
assert_match "show_dashboard [y/N]", key_name_ui.output
assert_equal "name=test-key&push_rubygem=true", fetcher.last_request.body
- credentials = YAML.load_file Gem.configuration.credentials_path
+ credentials = load_yaml_file Gem.configuration.credentials_path
assert_equal api_key, credentials[:rubygems_api_key]
end
diff --git a/test/rubygems/test_gem_commands_sources_command.rb b/test/rubygems/test_gem_commands_sources_command.rb
index 59acfb1ed6..70d1b3611c 100644
--- a/test/rubygems/test_gem_commands_sources_command.rb
+++ b/test/rubygems/test_gem_commands_sources_command.rb
@@ -162,7 +162,7 @@ class TestGemCommandsSourcesCommand < Gem::TestCase
use_ui ui do
- assert_raises Gem::MockGemUi::TermError do
+ assert_raise Gem::MockGemUi::TermError do
@cmd.execute
end
end
@@ -188,7 +188,7 @@ class TestGemCommandsSourcesCommand < Gem::TestCase
@cmd.handle_options %w[--add http://beta-gems.example.com]
use_ui @ui do
- assert_raises Gem::MockGemUi::TermError do
+ assert_raise Gem::MockGemUi::TermError do
@cmd.execute
end
end
@@ -299,7 +299,7 @@ source http://gems.example.com/ already present in the cache
ui = Gem::MockGemUi.new "n"
use_ui ui do
- assert_raises Gem::MockGemUi::TermError do
+ assert_raise Gem::MockGemUi::TermError do
@cmd.execute
end
end
@@ -367,7 +367,7 @@ source http://gems.example.com/ already present in the cache
ui = Gem::MockGemUi.new "n"
use_ui ui do
- assert_raises Gem::MockGemUi::TermError do
+ assert_raise Gem::MockGemUi::TermError do
@cmd.execute
end
end
@@ -385,7 +385,7 @@ source http://gems.example.com/ already present in the cache
@cmd.handle_options %w[--add beta-gems.example.com]
use_ui @ui do
- assert_raises Gem::MockGemUi::TermError do
+ assert_raise Gem::MockGemUi::TermError do
@cmd.execute
end
end
diff --git a/test/rubygems/test_gem_commands_specification_command.rb b/test/rubygems/test_gem_commands_specification_command.rb
index 732278eb6f..a04746f82c 100644
--- a/test/rubygems/test_gem_commands_specification_command.rb
+++ b/test/rubygems/test_gem_commands_specification_command.rb
@@ -51,7 +51,7 @@ class TestGemCommandsSpecificationCommand < Gem::TestCase
@cmd.options[:all] = true
@cmd.options[:version] = "1"
- assert_raises Gem::MockGemUi::TermError do
+ assert_raise Gem::MockGemUi::TermError do
use_ui @ui do
@cmd.execute
end
@@ -64,7 +64,7 @@ class TestGemCommandsSpecificationCommand < Gem::TestCase
def test_execute_bad_name
@cmd.options[:args] = %w[foo]
- assert_raises Gem::MockGemUi::TermError do
+ assert_raise Gem::MockGemUi::TermError do
use_ui @ui do
@cmd.execute
end
@@ -78,7 +78,7 @@ class TestGemCommandsSpecificationCommand < Gem::TestCase
@cmd.options[:args] = %w[foo]
@cmd.options[:version] = "1.3.2"
- assert_raises Gem::MockGemUi::TermError do
+ assert_raise Gem::MockGemUi::TermError do
use_ui @ui do
@cmd.execute
end
@@ -114,7 +114,7 @@ class TestGemCommandsSpecificationCommand < Gem::TestCase
@cmd.execute
end
- assert_equal "foo", YAML.load(@ui.output)
+ assert_equal "foo", load_yaml(@ui.output)
end
def test_execute_file
@@ -230,7 +230,7 @@ class TestGemCommandsSpecificationCommand < Gem::TestCase
assert_match %r{\A--- !ruby/object:Gem::Specification}, @ui.output
assert_match %r{name: foo}, @ui.output
- spec = YAML.load @ui.output
+ spec = load_yaml @ui.output
assert_equal Gem::Version.new("2.0.0"), spec.version
end
@@ -252,7 +252,7 @@ class TestGemCommandsSpecificationCommand < Gem::TestCase
assert_match %r{\A--- !ruby/object:Gem::Specification}, @ui.output
assert_match %r{name: foo}, @ui.output
- spec = YAML.load @ui.output
+ spec = load_yaml @ui.output
assert_equal Gem::Version.new("2.0.1.pre"), spec.version
end
diff --git a/test/rubygems/test_gem_commands_uninstall_command.rb b/test/rubygems/test_gem_commands_uninstall_command.rb
index 03ce600cc4..a1b81d73de 100644
--- a/test/rubygems/test_gem_commands_uninstall_command.rb
+++ b/test/rubygems/test_gem_commands_uninstall_command.rb
@@ -377,7 +377,7 @@ class TestGemCommandsUninstallCommand < Gem::InstallerTestCase
@cmd.options[:args] = ['a:4']
- e = assert_raises Gem::InstallError do
+ e = assert_raise Gem::InstallError do
use_ui ui do
@cmd.execute
end
@@ -420,7 +420,7 @@ WARNING: Use your OS package manager to uninstall vendor gems
@cmd.options[:version] = Gem::Requirement.new("> 1")
use_ui @ui do
- e = assert_raises Gem::MockGemUi::TermError do
+ e = assert_raise Gem::MockGemUi::TermError do
@cmd.execute
end
@@ -436,7 +436,7 @@ WARNING: Use your OS package manager to uninstall vendor gems
def test_handle_options_vendor_missing
vendordir(nil) do
- e = assert_raises OptionParser::InvalidOption do
+ e = assert_raise OptionParser::InvalidOption do
@cmd.handle_options %w[--vendor]
end
@@ -477,7 +477,7 @@ WARNING: Use your OS package manager to uninstall vendor gems
e = nil
@cmd.stub :uninstall, uninstall_exception do
use_ui @ui do
- e = assert_raises Gem::MockGemUi::TermError do
+ e = assert_raise Gem::MockGemUi::TermError do
@cmd.execute
end
end
diff --git a/test/rubygems/test_gem_commands_unpack_command.rb b/test/rubygems/test_gem_commands_unpack_command.rb
index e1fea0f0ff..f2f60f02bf 100644
--- a/test/rubygems/test_gem_commands_unpack_command.rb
+++ b/test/rubygems/test_gem_commands_unpack_command.rb
@@ -151,7 +151,7 @@ class TestGemCommandsUnpackCommand < Gem::TestCase
end
def test_execute_sudo
- skip 'Cannot perform this test on windows (chmod)' if win_platform?
+ pend 'Cannot perform this test on windows (chmod)' if win_platform?
util_make_gems
@@ -210,7 +210,7 @@ class TestGemCommandsUnpackCommand < Gem::TestCase
end
end
- assert_path_exists File.join(@tempdir, foo_spec.full_name)
+ assert_path_exist File.join(@tempdir, foo_spec.full_name)
end
def test_handle_options_metadata
diff --git a/test/rubygems/test_gem_commands_update_command.rb b/test/rubygems/test_gem_commands_update_command.rb
index a06b19c790..3224391018 100644
--- a/test/rubygems/test_gem_commands_update_command.rb
+++ b/test/rubygems/test_gem_commands_update_command.rb
@@ -95,7 +95,7 @@ class TestGemCommandsUpdateCommand < Gem::TestCase
@cmd.options[:args] = []
@cmd.options[:system] = true
- assert_raises Gem::MockGemUi::SystemExitException do
+ assert_raise Gem::MockGemUi::SystemExitException do
use_ui @ui do
@cmd.execute
end
@@ -177,7 +177,7 @@ class TestGemCommandsUpdateCommand < Gem::TestCase
@cmd.extend(oldest_version_mod)
- assert_raises Gem::MockGemUi::TermError do
+ assert_raise Gem::MockGemUi::TermError do
use_ui @ui do
@cmd.execute
end
@@ -211,7 +211,7 @@ class TestGemCommandsUpdateCommand < Gem::TestCase
@cmd.execute
- refute_path_exists Gem.plugindir, "Plugins folder not removed when updating rubygems to pre-3.2"
+ assert_path_not_exist Gem.plugindir, "Plugins folder not removed when updating rubygems to pre-3.2"
end
def test_execute_system_specific_newer_than_or_equal_to_3_2_leaves_plugins_dir_alone
@@ -239,8 +239,8 @@ class TestGemCommandsUpdateCommand < Gem::TestCase
@cmd.execute
- assert_path_exists Gem.plugindir, "Plugin folder removed when updating rubygems to post-3.2"
- assert_path_exists plugin_file, "Plugin removed when updating rubygems to post-3.2"
+ assert_path_exist Gem.plugindir, "Plugin folder removed when updating rubygems to post-3.2"
+ assert_path_exist plugin_file, "Plugin removed when updating rubygems to post-3.2"
end
def test_execute_system_specifically_to_latest_version
@@ -273,7 +273,7 @@ class TestGemCommandsUpdateCommand < Gem::TestCase
@cmd.options[:args] = %w[gem]
@cmd.options[:system] = true
- assert_raises Gem::MockGemUi::TermError do
+ assert_raise Gem::MockGemUi::TermError do
use_ui @ui do
@cmd.execute
end
@@ -291,7 +291,7 @@ class TestGemCommandsUpdateCommand < Gem::TestCase
@cmd.options[:args] = []
@cmd.options[:system] = true
- assert_raises Gem::MockGemUi::TermError do
+ assert_raise Gem::MockGemUi::TermError do
use_ui @ui do
@cmd.execute
end
@@ -384,7 +384,7 @@ class TestGemCommandsUpdateCommand < Gem::TestCase
a2 = @specs['a-2']
- assert_path_exists File.join(a2.doc_dir, 'rdoc')
+ assert_path_exist File.join(a2.doc_dir, 'rdoc')
end
def test_execute_named
@@ -530,7 +530,7 @@ class TestGemCommandsUpdateCommand < Gem::TestCase
def test_fetch_remote_gems_error
Gem.sources.replace %w[http://nonexistent.example]
- assert_raises Gem::RemoteFetcher::FetchError do
+ assert_raise Gem::RemoteFetcher::FetchError do
@cmd.fetch_remote_gems @specs['a-1']
end
end
@@ -588,7 +588,7 @@ class TestGemCommandsUpdateCommand < Gem::TestCase
end
def test_handle_options_system_non_version
- assert_raises ArgumentError do
+ assert_raise ArgumentError do
@cmd.handle_options %w[--system non-version]
end
end
diff --git a/test/rubygems/test_gem_commands_which_command.rb b/test/rubygems/test_gem_commands_which_command.rb
index b67bf040d4..ce56f8eefc 100644
--- a/test/rubygems/test_gem_commands_which_command.rb
+++ b/test/rubygems/test_gem_commands_which_command.rb
@@ -26,7 +26,7 @@ class TestGemCommandsWhichCommand < Gem::TestCase
@cmd.handle_options %w[directory]
use_ui @ui do
- assert_raises Gem::MockGemUi::TermError do
+ assert_raise Gem::MockGemUi::TermError do
@cmd.execute
end
end
@@ -44,7 +44,7 @@ class TestGemCommandsWhichCommand < Gem::TestCase
@cmd.handle_options %w[foo_bar missinglib]
use_ui @ui do
- assert_raises Gem::MockGemUi::TermError do
+ assert_raise Gem::MockGemUi::TermError do
@cmd.execute
end
end
@@ -58,7 +58,7 @@ class TestGemCommandsWhichCommand < Gem::TestCase
@cmd.handle_options %w[missinglib]
use_ui @ui do
- assert_raises Gem::MockGemUi::TermError do
+ assert_raise Gem::MockGemUi::TermError do
@cmd.execute
end
end
diff --git a/test/rubygems/test_gem_commands_yank_command.rb b/test/rubygems/test_gem_commands_yank_command.rb
index 3046655aa8..76e935b06a 100644
--- a/test/rubygems/test_gem_commands_yank_command.rb
+++ b/test/rubygems/test_gem_commands_yank_command.rb
@@ -35,7 +35,7 @@ class TestGemCommandsYankCommand < Gem::TestCase
def test_handle_options_missing_argument
%w[-v --version -p --platform].each do |option|
- assert_raises OptionParser::MissingArgument do
+ assert_raise OptionParser::MissingArgument do
@cmd.handle_options %W[a #{option}]
end
end
diff --git a/test/rubygems/test_gem_config_file.rb b/test/rubygems/test_gem_config_file.rb
index 7db31013aa..77d7a08bb8 100644
--- a/test/rubygems/test_gem_config_file.rb
+++ b/test/rubygems/test_gem_config_file.rb
@@ -195,14 +195,14 @@ class TestGemConfigFile < Gem::TestCase
end
def test_check_credentials_permissions
- skip 'chmod not supported' if win_platform?
+ pend 'chmod not supported' if win_platform?
@cfg.rubygems_api_key = 'x'
File.chmod 0644, @cfg.credentials_path
use_ui @ui do
- assert_raises Gem::MockGemUi::TermError do
+ assert_raise Gem::MockGemUi::TermError do
@cfg.load_api_keys
end
end
@@ -253,7 +253,7 @@ if you believe they were disclosed to a third party.
args = %w[--debug]
- _, err = capture_io do
+ _, err = capture_output do
@cfg.handle_arguments args
end
@@ -322,13 +322,13 @@ if you believe they were disclosed to a third party.
end
def test_load_api_keys_bad_permission
- skip 'chmod not supported' if win_platform?
+ pend 'chmod not supported' if win_platform?
@cfg.rubygems_api_key = 'x'
File.chmod 0644, @cfg.credentials_path
- assert_raises Gem::MockGemUi::TermError do
+ assert_raise Gem::MockGemUi::TermError do
@cfg.load_api_keys
end
end
@@ -354,7 +354,7 @@ if you believe they were disclosed to a third party.
:rubygems_api_key => 'x',
}
- assert_equal expected, YAML.load_file(@cfg.credentials_path)
+ assert_equal expected, load_yaml_file(@cfg.credentials_path)
unless win_platform?
stat = File.stat @cfg.credentials_path
@@ -364,13 +364,13 @@ if you believe they were disclosed to a third party.
end
def test_rubygems_api_key_equals_bad_permission
- skip 'chmod not supported' if win_platform?
+ pend 'chmod not supported' if win_platform?
@cfg.rubygems_api_key = 'x'
File.chmod 0644, @cfg.credentials_path
- assert_raises Gem::MockGemUi::TermError do
+ assert_raise Gem::MockGemUi::TermError do
@cfg.rubygems_api_key = 'y'
end
@@ -378,7 +378,7 @@ if you believe they were disclosed to a third party.
:rubygems_api_key => 'x',
}
- assert_equal expected, YAML.load_file(@cfg.credentials_path)
+ assert_equal expected, load_yaml_file(@cfg.credentials_path)
stat = File.stat @cfg.credentials_path
diff --git a/test/rubygems/test_gem_dependency.rb b/test/rubygems/test_gem_dependency.rb
index 7ddeafedce..69208d3258 100644
--- a/test/rubygems/test_gem_dependency.rb
+++ b/test/rubygems/test_gem_dependency.rb
@@ -11,7 +11,7 @@ class TestGemDependency < Gem::TestCase
end
def test_initialize_type_bad
- e = assert_raises ArgumentError do
+ e = assert_raise ArgumentError do
Gem::Dependency.new 'monkey' => '1.0'
end
@@ -43,7 +43,7 @@ class TestGemDependency < Gem::TestCase
assert_equal :runtime, dep("pkg").type
assert_equal :development, dep("pkg", [], :development).type
- assert_raises ArgumentError do
+ assert_raise ArgumentError do
dep "pkg", :sometimes
end
end
@@ -248,7 +248,7 @@ class TestGemDependency < Gem::TestCase
a = dep 'a'
b = dep 'b'
- e = assert_raises ArgumentError do
+ e = assert_raise ArgumentError do
a.merge b
end
@@ -330,7 +330,7 @@ class TestGemDependency < Gem::TestCase
dep = Gem::Dependency.new "a", "= 2.0"
- e = assert_raises Gem::MissingSpecVersionError do
+ e = assert_raise Gem::MissingSpecVersionError do
dep.to_specs
end
@@ -353,7 +353,7 @@ class TestGemDependency < Gem::TestCase
assert_equal [b, b_1], dep.to_specs
Gem::BundlerVersionFinder.stub(:bundler_version_with_reason, ["3.5", "reason"]) do
- e = assert_raises Gem::MissingSpecVersionError do
+ e = assert_raise Gem::MissingSpecVersionError do
dep.to_specs
end
@@ -377,7 +377,7 @@ class TestGemDependency < Gem::TestCase
dep = Gem::Dependency.new "b", "= 2.0"
- e = assert_raises Gem::MissingSpecError do
+ e = assert_raise Gem::MissingSpecError do
dep.to_specs
end
diff --git a/test/rubygems/test_gem_dependency_installer.rb b/test/rubygems/test_gem_dependency_installer.rb
index c62a3f355a..90d5d16403 100644
--- a/test/rubygems/test_gem_dependency_installer.rb
+++ b/test/rubygems/test_gem_dependency_installer.rb
@@ -113,7 +113,7 @@ class TestGemDependencyInstaller < Gem::TestCase
dep = Gem::Dependency.new "p"
inst = Gem::DependencyInstaller.new
- assert_raises Gem::UnsatisfiableDependencyError do
+ assert_raise Gem::UnsatisfiableDependencyError do
inst.install dep
end
@@ -392,7 +392,7 @@ class TestGemDependencyInstaller < Gem::TestCase
assert_equal %w[f-1], inst.installed_gems.map {|s| s.full_name }
- assert_path_exists e1.extension_dir
+ assert_path_exist e1.extension_dir
end
def test_install_dependency_old
@@ -712,7 +712,7 @@ class TestGemDependencyInstaller < Gem::TestCase
inst = nil
Dir.chdir @tempdir do
- e = assert_raises Gem::UnsatisfiableDependencyError do
+ e = assert_raise Gem::UnsatisfiableDependencyError do
inst = Gem::DependencyInstaller.new :domain => :local
inst.install 'b'
end
@@ -883,7 +883,7 @@ class TestGemDependencyInstaller < Gem::TestCase
policy = Gem::Security::HighSecurity
inst = Gem::DependencyInstaller.new :security_policy => policy
- e = assert_raises Gem::Security::Exception do
+ e = assert_raise Gem::Security::Exception do
inst.install 'b'
end
diff --git a/test/rubygems/test_gem_doctor.rb b/test/rubygems/test_gem_doctor.rb
index 1cef52234e..4514d17f9f 100644
--- a/test/rubygems/test_gem_doctor.rb
+++ b/test/rubygems/test_gem_doctor.rb
@@ -27,31 +27,31 @@ class TestGemDoctor < Gem::TestCase
io.write 'this will raise an exception when evaluated.'
end
- assert_path_exists File.join(a.gem_dir, 'Rakefile')
- assert_path_exists File.join(a.gem_dir, 'lib', 'a.rb')
+ assert_path_exist File.join(a.gem_dir, 'Rakefile')
+ assert_path_exist File.join(a.gem_dir, 'lib', 'a.rb')
- assert_path_exists b.gem_dir
- refute_path_exists b.spec_file
+ assert_path_exist b.gem_dir
+ assert_path_not_exist b.spec_file
- assert_path_exists c.gem_dir
- assert_path_exists c.spec_file
+ assert_path_exist c.gem_dir
+ assert_path_exist c.spec_file
doctor = Gem::Doctor.new @gemhome
- capture_io do
+ capture_output do
use_ui @ui do
doctor.doctor
end
end
- assert_path_exists File.join(a.gem_dir, 'Rakefile')
- assert_path_exists File.join(a.gem_dir, 'lib', 'a.rb')
+ assert_path_exist File.join(a.gem_dir, 'Rakefile')
+ assert_path_exist File.join(a.gem_dir, 'lib', 'a.rb')
- refute_path_exists b.gem_dir
- refute_path_exists b.spec_file
+ assert_path_not_exist b.gem_dir
+ assert_path_not_exist b.spec_file
- refute_path_exists c.gem_dir
- refute_path_exists c.spec_file
+ assert_path_not_exist c.gem_dir
+ assert_path_not_exist c.spec_file
expected = <<-OUTPUT
Checking #{@gemhome}
@@ -80,31 +80,31 @@ Removed directory gems/c-2
io.write 'this will raise an exception when evaluated.'
end
- assert_path_exists File.join(a.gem_dir, 'Rakefile')
- assert_path_exists File.join(a.gem_dir, 'lib', 'a.rb')
+ assert_path_exist File.join(a.gem_dir, 'Rakefile')
+ assert_path_exist File.join(a.gem_dir, 'lib', 'a.rb')
- assert_path_exists b.gem_dir
- refute_path_exists b.spec_file
+ assert_path_exist b.gem_dir
+ assert_path_not_exist b.spec_file
- assert_path_exists c.gem_dir
- assert_path_exists c.spec_file
+ assert_path_exist c.gem_dir
+ assert_path_exist c.spec_file
doctor = Gem::Doctor.new @gemhome, true
- capture_io do
+ capture_output do
use_ui @ui do
doctor.doctor
end
end
- assert_path_exists File.join(a.gem_dir, 'Rakefile')
- assert_path_exists File.join(a.gem_dir, 'lib', 'a.rb')
+ assert_path_exist File.join(a.gem_dir, 'Rakefile')
+ assert_path_exist File.join(a.gem_dir, 'lib', 'a.rb')
- assert_path_exists b.gem_dir
- refute_path_exists b.spec_file
+ assert_path_exist b.gem_dir
+ assert_path_not_exist b.spec_file
- assert_path_exists c.gem_dir
- assert_path_exists c.spec_file
+ assert_path_exist c.gem_dir
+ assert_path_exist c.spec_file
expected = <<-OUTPUT
Checking #{@gemhome}
@@ -127,13 +127,13 @@ Extra directory gems/c-2
doctor = Gem::Doctor.new @tempdir
- capture_io do
+ capture_output do
use_ui @ui do
doctor.doctor
end
end
- assert_path_exists other_dir
+ assert_path_exist other_dir
expected = <<-OUTPUT
Checking #{@tempdir}
@@ -163,13 +163,13 @@ This directory does not appear to be a RubyGems repository, skipping
doctor = Gem::Doctor.new @gemhome
- capture_io do
+ capture_output do
use_ui @ui do
doctor.doctor
end
end
- # refute_path_exists bad_plugin
+ # assert_path_not_exist bad_plugin
expected = <<-OUTPUT
Checking #{@gemhome}
diff --git a/test/rubygems/test_gem_ext_builder.rb b/test/rubygems/test_gem_ext_builder.rb
index 6bebfa7a03..36d5328aef 100644
--- a/test/rubygems/test_gem_ext_builder.rb
+++ b/test/rubygems/test_gem_ext_builder.rb
@@ -132,12 +132,12 @@ install:
@builder.build_extensions
end
- assert_path_exists @spec.extension_dir
- assert_path_exists @spec.gem_build_complete_path
- assert_path_exists File.join @spec.extension_dir, 'gem_make.out'
- assert_path_exists File.join @spec.extension_dir, 'a.rb'
- assert_path_exists File.join @spec.gem_dir, 'lib', 'a.rb'
- assert_path_exists File.join @spec.gem_dir, 'lib', 'a', 'b.rb'
+ assert_path_exist @spec.extension_dir
+ assert_path_exist @spec.gem_build_complete_path
+ assert_path_exist File.join @spec.extension_dir, 'gem_make.out'
+ assert_path_exist File.join @spec.extension_dir, 'a.rb'
+ assert_path_exist File.join @spec.gem_dir, 'lib', 'a.rb'
+ assert_path_exist File.join @spec.gem_dir, 'lib', 'a', 'b.rb'
end
def test_build_extensions_with_gemhome_with_space
@@ -188,12 +188,12 @@ install:
@builder.build_extensions
end
- assert_path_exists @spec.extension_dir
- assert_path_exists @spec.gem_build_complete_path
- assert_path_exists File.join @spec.extension_dir, 'gem_make.out'
- assert_path_exists File.join @spec.extension_dir, 'a.rb'
- refute_path_exists File.join @spec.gem_dir, 'lib', 'a.rb'
- refute_path_exists File.join @spec.gem_dir, 'lib', 'a', 'b.rb'
+ assert_path_exist @spec.extension_dir
+ assert_path_exist @spec.gem_build_complete_path
+ assert_path_exist File.join @spec.extension_dir, 'gem_make.out'
+ assert_path_exist File.join @spec.extension_dir, 'a.rb'
+ assert_path_not_exist File.join @spec.gem_dir, 'lib', 'a.rb'
+ assert_path_not_exist File.join @spec.gem_dir, 'lib', 'a', 'b.rb'
ensure
class << Gem
remove_method :install_extension_in_lib
@@ -210,7 +210,7 @@ install:
assert_equal '', @ui.output
assert_equal '', @ui.error
- refute_path_exists File.join @spec.extension_dir, 'gem_make.out'
+ assert_path_not_exist File.join @spec.extension_dir, 'gem_make.out'
end
def test_build_extensions_rebuild_failure
@@ -219,13 +219,13 @@ install:
@spec.extensions << nil
- assert_raises Gem::Ext::BuildError do
+ assert_raise Gem::Ext::BuildError do
use_ui @ui do
@builder.build_extensions
end
end
- refute_path_exists @spec.gem_build_complete_path
+ assert_path_not_exist @spec.gem_build_complete_path
end
def test_build_extensions_extconf_bad
@@ -235,7 +235,7 @@ install:
FileUtils.mkdir_p @spec.gem_dir
- e = assert_raises Gem::Ext::BuildError do
+ e = assert_raise Gem::Ext::BuildError do
use_ui @ui do
@builder.build_extensions
end
@@ -251,7 +251,7 @@ install:
assert_match %r{#{Regexp.escape Gem.ruby} .* extconf\.rb}, cmd_make_out
assert_match %r{: No such file}, cmd_make_out
- refute_path_exists @spec.gem_build_complete_path
+ assert_path_not_exist @spec.gem_build_complete_path
assert_equal cwd, Dir.pwd
end
@@ -261,7 +261,7 @@ install:
gem_make_out = File.join @spec.extension_dir, 'gem_make.out'
@spec.extensions << nil
- e = assert_raises Gem::Ext::BuildError do
+ e = assert_raise Gem::Ext::BuildError do
use_ui @ui do
@builder.build_extensions
end
@@ -273,7 +273,7 @@ install:
assert_equal "No builder for extension ''\n", File.read(gem_make_out)
- refute_path_exists @spec.gem_build_complete_path
+ assert_path_not_exist @spec.gem_build_complete_path
ensure
FileUtils.rm_f gem_make_out
end
@@ -308,7 +308,7 @@ install:
path = File.join @spec.gem_dir, "extconf_args"
assert_equal args.inspect, File.read(path).strip
- assert_path_exists @spec.extension_dir
+ assert_path_exist @spec.extension_dir
end
def test_initialize
diff --git a/test/rubygems/test_gem_ext_cmake_builder.rb b/test/rubygems/test_gem_ext_cmake_builder.rb
index dffe4a7fb3..47d06efbca 100644
--- a/test/rubygems/test_gem_ext_cmake_builder.rb
+++ b/test/rubygems/test_gem_ext_cmake_builder.rb
@@ -7,13 +7,13 @@ class TestGemExtCmakeBuilder < Gem::TestCase
super
# Details: https://github.com/rubygems/rubygems/issues/1270#issuecomment-177368340
- skip "CmakeBuilder doesn't work on Windows." if Gem.win_platform?
+ pend "CmakeBuilder doesn't work on Windows." if Gem.win_platform?
begin
_, status = Open3.capture2e('cmake')
- skip 'cmake not present' unless status.success?
+ pend 'cmake not present' unless status.success?
rescue Errno::ENOENT
- skip 'cmake not present'
+ pend 'cmake not present'
end
@ext = File.join @tempdir, 'ext'
@@ -50,7 +50,7 @@ install (FILES test.txt DESTINATION bin)
def test_self_build_fail
output = []
- error = assert_raises Gem::InstallError do
+ error = assert_raise Gem::InstallError do
Gem::Ext::CmakeBuilder.build nil, @dest_path, output, [], nil, @ext
end
diff --git a/test/rubygems/test_gem_ext_configure_builder.rb b/test/rubygems/test_gem_ext_configure_builder.rb
index 6b11b0c2ab..87260bcfa2 100644
--- a/test/rubygems/test_gem_ext_configure_builder.rb
+++ b/test/rubygems/test_gem_ext_configure_builder.rb
@@ -17,7 +17,7 @@ class TestGemExtConfigureBuilder < Gem::TestCase
end
def test_self_build
- skip("test_self_build skipped on MS Windows (VC++)") if vc_windows?
+ pend("test_self_build skipped on MS Windows (VC++)") if vc_windows?
File.open File.join(@ext, './configure'), 'w' do |configure|
configure.puts "#!/bin/sh\necho \"#{@makefile_body}\" > Makefile"
@@ -42,10 +42,10 @@ class TestGemExtConfigureBuilder < Gem::TestCase
end
def test_self_build_fail
- skip("test_self_build_fail skipped on MS Windows (VC++)") if vc_windows?
+ pend("test_self_build_fail skipped on MS Windows (VC++)") if vc_windows?
output = []
- error = assert_raises Gem::InstallError do
+ error = assert_raise Gem::InstallError do
Gem::Ext::ConfigureBuilder.build nil, @dest_path, output, [], nil, @ext
end
@@ -62,7 +62,7 @@ class TestGemExtConfigureBuilder < Gem::TestCase
def test_self_build_has_makefile
if vc_windows? && !nmake_found?
- skip("test_self_build_has_makefile skipped - nmake not found")
+ pend("test_self_build_has_makefile skipped - nmake not found")
end
File.open File.join(@ext, 'Makefile'), 'w' do |makefile|
diff --git a/test/rubygems/test_gem_ext_ext_conf_builder.rb b/test/rubygems/test_gem_ext_ext_conf_builder.rb
index 21fe27166b..02b46ad8b7 100644
--- a/test/rubygems/test_gem_ext_ext_conf_builder.rb
+++ b/test/rubygems/test_gem_ext_ext_conf_builder.rb
@@ -16,11 +16,11 @@ class TestGemExtExtConfBuilder < Gem::TestCase
def test_class_build
if java_platform?
- skip("failing on jruby")
+ pend("failing on jruby")
end
if vc_windows? && !nmake_found?
- skip("test_class_build skipped - nmake not found")
+ pend("test_class_build skipped - nmake not found")
end
File.open File.join(@ext, 'extconf.rb'), 'w' do |extconf|
@@ -41,11 +41,12 @@ class TestGemExtExtConfBuilder < Gem::TestCase
assert_contains_make_command '', output[7]
assert_contains_make_command 'install', output[10]
assert_empty Dir.glob(File.join(@ext, 'siteconf*.rb'))
+ assert_empty Dir.glob(File.join(@ext, '.gem.*'))
end
def test_class_build_rbconfig_make_prog
if java_platform?
- skip("failing on jruby")
+ pend("failing on jruby")
end
configure_args do
@@ -70,7 +71,7 @@ class TestGemExtExtConfBuilder < Gem::TestCase
ENV['MAKE'] = 'anothermake'
if java_platform?
- skip("failing on jruby")
+ pend("failing on jruby")
end
configure_args '' do
@@ -80,7 +81,7 @@ class TestGemExtExtConfBuilder < Gem::TestCase
output = []
- assert_raises Gem::InstallError do
+ assert_raise Gem::InstallError do
Gem::Ext::ExtConfBuilder.build 'extconf.rb', @dest_path, output, [], nil, @ext
end
@@ -93,7 +94,7 @@ class TestGemExtExtConfBuilder < Gem::TestCase
def test_class_build_extconf_fail
if vc_windows? && !nmake_found?
- skip("test_class_build_extconf_fail skipped - nmake not found")
+ pend("test_class_build_extconf_fail skipped - nmake not found")
end
File.open File.join(@ext, 'extconf.rb'), 'w' do |extconf|
@@ -104,7 +105,7 @@ class TestGemExtExtConfBuilder < Gem::TestCase
output = []
- error = assert_raises Gem::InstallError do
+ error = assert_raise Gem::InstallError do
Gem::Ext::ExtConfBuilder.build 'extconf.rb', @dest_path, output, [], nil, @ext
end
@@ -114,12 +115,12 @@ class TestGemExtExtConfBuilder < Gem::TestCase
assert_match(File.join(@dest_path, 'mkmf.log'), output[4])
assert_includes(output, "To see why this extension failed to compile, please check the mkmf.log which can be found here:\n")
- assert_path_exists File.join @dest_path, 'mkmf.log'
+ assert_path_exist File.join @dest_path, 'mkmf.log'
end
def test_class_build_extconf_success_without_warning
if vc_windows? && !nmake_found?
- skip("test_class_build_extconf_fail skipped - nmake not found")
+ pend("test_class_build_extconf_fail skipped - nmake not found")
end
File.open File.join(@ext, 'extconf.rb'), 'w' do |extconf|
@@ -134,12 +135,12 @@ class TestGemExtExtConfBuilder < Gem::TestCase
refute_includes(output, "To see why this extension failed to compile, please check the mkmf.log which can be found here:\n")
- assert_path_exists File.join @dest_path, 'mkmf.log'
+ assert_path_exist File.join @dest_path, 'mkmf.log'
end
def test_class_build_unconventional
if vc_windows? && !nmake_found?
- skip("test_class_build skipped - nmake not found")
+ pend("test_class_build skipped - nmake not found")
end
File.open File.join(@ext, 'extconf.rb'), 'w' do |extconf|
@@ -180,7 +181,7 @@ end
def test_class_make
if vc_windows? && !nmake_found?
- skip("test_class_make skipped - nmake not found")
+ pend("test_class_make skipped - nmake not found")
end
output = []
@@ -202,7 +203,7 @@ end
end
def test_class_make_no_Makefile
- error = assert_raises Gem::InstallError do
+ error = assert_raise Gem::InstallError do
Gem::Ext::ExtConfBuilder.make @ext, ['output'], @ext
end
diff --git a/test/rubygems/test_gem_ext_rake_builder.rb b/test/rubygems/test_gem_ext_rake_builder.rb
index 094581890a..833f57615d 100644
--- a/test/rubygems/test_gem_ext_rake_builder.rb
+++ b/test/rubygems/test_gem_ext_rake_builder.rb
@@ -90,7 +90,7 @@ class TestGemExtRakeBuilder < Gem::TestCase
output = []
build_rake_in(false) do |rake|
- error = assert_raises Gem::InstallError do
+ error = assert_raise Gem::InstallError do
Gem::Ext::RakeBuilder.build "mkrf_conf.rb", @dest_path, output, [], nil, @ext
end
diff --git a/test/rubygems/test_gem_gemcutter_utilities.rb b/test/rubygems/test_gem_gemcutter_utilities.rb
index 3290a3a908..27c99fd04d 100644
--- a/test/rubygems/test_gem_gemcutter_utilities.rb
+++ b/test/rubygems/test_gem_gemcutter_utilities.rb
@@ -101,7 +101,7 @@ class TestGemGemcutterUtilities < Gem::TestCase
assert @fetcher.last_request["authorization"]
assert_match %r{Signed in.}, @sign_in_ui.output
- credentials = YAML.load_file Gem.configuration.credentials_path
+ credentials = load_yaml_file Gem.configuration.credentials_path
assert_equal api_key, credentials[:rubygems_api_key]
end
@@ -115,7 +115,7 @@ class TestGemGemcutterUtilities < Gem::TestCase
assert @fetcher.last_request["authorization"]
assert_match %r{Signed in.}, @sign_in_ui.output
- credentials = YAML.load_file Gem.configuration.credentials_path
+ credentials = load_yaml_file Gem.configuration.credentials_path
assert_equal api_key, credentials['http://example.com']
end
@@ -129,7 +129,7 @@ class TestGemGemcutterUtilities < Gem::TestCase
assert @fetcher.last_request["authorization"]
assert_match %r{Signed in.}, @sign_in_ui.output
- credentials = YAML.load_file Gem.configuration.credentials_path
+ credentials = load_yaml_file Gem.configuration.credentials_path
assert_equal api_key, credentials[:rubygems_api_key]
end
@@ -142,7 +142,7 @@ class TestGemGemcutterUtilities < Gem::TestCase
assert @fetcher.last_request["authorization"]
assert_match %r{Signed in.}, @sign_in_ui.output
- credentials = YAML.load_file Gem.configuration.credentials_path
+ credentials = load_yaml_file Gem.configuration.credentials_path
assert_equal api_key, credentials['http://example.com']
end
@@ -177,13 +177,13 @@ class TestGemGemcutterUtilities < Gem::TestCase
assert_match %r{Enter your RubyGems.org credentials.}, @sign_in_ui.output
assert_match %r{Signed in.}, @sign_in_ui.output
- credentials = YAML.load_file Gem.configuration.credentials_path
+ credentials = load_yaml_file Gem.configuration.credentials_path
assert_equal api_key, credentials[:rubygems_api_key]
assert_equal other_api_key, credentials[:other_api_key]
end
def test_sign_in_with_bad_credentials
- assert_raises Gem::MockGemUi::TermError do
+ assert_raise Gem::MockGemUi::TermError do
util_sign_in ['Access Denied.', 403, 'Forbidden']
end
@@ -209,7 +209,7 @@ class TestGemGemcutterUtilities < Gem::TestCase
def test_sign_in_with_incorrect_otp_code
response = "You have enabled multifactor authentication but your request doesn't have the correct OTP code. Please check it and retry."
- assert_raises Gem::MockGemUi::TermError do
+ assert_raise Gem::MockGemUi::TermError do
util_sign_in [response, 401, 'Unauthorized'], nil, [], "111111\n"
end
@@ -257,7 +257,7 @@ class TestGemGemcutterUtilities < Gem::TestCase
end
def test_verify_missing_api_key
- assert_raises Gem::MockGemUi::TermError do
+ assert_raise Gem::MockGemUi::TermError do
@cmd.verify_api_key :missing
end
end
diff --git a/test/rubygems/test_gem_install_update_options.rb b/test/rubygems/test_gem_install_update_options.rb
index b4528dba17..1afac10f73 100644
--- a/test/rubygems/test_gem_install_update_options.rb
+++ b/test/rubygems/test_gem_install_update_options.rb
@@ -92,7 +92,7 @@ class TestGemInstallUpdateOptions < Gem::InstallerTestCase
end
def test_security_policy
- skip 'openssl is missing' unless Gem::HAVE_OPENSSL
+ pend 'openssl is missing' unless Gem::HAVE_OPENSSL
@cmd.handle_options %w[-P HighSecurity]
@@ -100,11 +100,11 @@ class TestGemInstallUpdateOptions < Gem::InstallerTestCase
end
def test_security_policy_unknown
- skip 'openssl is missing' unless Gem::HAVE_OPENSSL
+ pend 'openssl is missing' unless Gem::HAVE_OPENSSL
@cmd.add_install_update_options
- e = assert_raises OptionParser::InvalidArgument do
+ e = assert_raise OptionParser::InvalidArgument do
@cmd.handle_options %w[-P UnknownSecurity]
end
assert_includes e.message, "UnknownSecurity"
@@ -124,8 +124,8 @@ class TestGemInstallUpdateOptions < Gem::InstallerTestCase
@installer = Gem::Installer.at @gem, @cmd.options
@installer.install
- assert_path_exists File.join(Gem.user_dir, 'gems')
- assert_path_exists File.join(Gem.user_dir, 'gems', @spec.full_name)
+ assert_path_exist File.join(Gem.user_dir, 'gems')
+ assert_path_exist File.join(Gem.user_dir, 'gems', @spec.full_name)
end
def test_user_install_disabled_read_only
@@ -137,9 +137,9 @@ class TestGemInstallUpdateOptions < Gem::InstallerTestCase
@gem = @spec.cache_file
if win_platform?
- skip('test_user_install_disabled_read_only test skipped on MS Windows')
+ pend('test_user_install_disabled_read_only test skipped on MS Windows')
elsif Process.uid.zero?
- skip('test_user_install_disabled_read_only test skipped in root privilege')
+ pend('test_user_install_disabled_read_only test skipped in root privilege')
else
@cmd.handle_options %w[--no-user-install]
@@ -150,7 +150,7 @@ class TestGemInstallUpdateOptions < Gem::InstallerTestCase
Gem.use_paths @gemhome, @userhome
- assert_raises(Gem::FilePermissionError) do
+ assert_raise(Gem::FilePermissionError) do
Gem::Installer.at(@gem, @cmd.options).install
end
end
@@ -169,7 +169,7 @@ class TestGemInstallUpdateOptions < Gem::InstallerTestCase
def test_vendor_missing
vendordir(nil) do
- e = assert_raises OptionParser::InvalidOption do
+ e = assert_raise OptionParser::InvalidOption do
@cmd.handle_options %w[--vendor]
end
diff --git a/test/rubygems/test_gem_installer.rb b/test/rubygems/test_gem_installer.rb
index 058e3b3c20..417570b68d 100644
--- a/test/rubygems/test_gem_installer.rb
+++ b/test/rubygems/test_gem_installer.rb
@@ -76,7 +76,7 @@ end
installer.generate_bin
installed_exec = File.join util_inst_bindir, 'executable'
- assert_path_exists installed_exec
+ assert_path_exist installed_exec
wrapper = File.read installed_exec
assert_match %r{generated by RubyGems}, wrapper
@@ -90,7 +90,7 @@ end
ui = Gem::MockGemUi.new "n\n"
use_ui ui do
- e = assert_raises Gem::InstallError do
+ e = assert_raise Gem::InstallError do
installer.generate_bin
end
@@ -134,7 +134,7 @@ gem 'other', version
installer.generate_bin # should not raise
installed_exec = File.join util_inst_bindir, 'foo-executable-bar'
- assert_path_exists installed_exec
+ assert_path_exist installed_exec
wrapper = File.read installed_exec
assert_match %r{generated by RubyGems}, wrapper
@@ -150,7 +150,7 @@ gem 'other', version
ui = Gem::MockGemUi.new "n\n"
use_ui ui do
- e = assert_raises Gem::InstallError do
+ e = assert_raise Gem::InstallError do
installer.generate_bin
end
@@ -169,7 +169,7 @@ gem 'other', version
installer.generate_bin
installed_exec = File.join util_inst_bindir, 'executable'
- assert_path_exists installed_exec
+ assert_path_exist installed_exec
wrapper = File.read installed_exec
assert_match %r{generated by RubyGems}, wrapper
@@ -184,7 +184,7 @@ gem 'other', version
installer.generate_bin
installed_exec = File.join util_inst_bindir, 'executable'
- assert_path_exists installed_exec
+ assert_path_exist installed_exec
wrapper = File.read installed_exec
assert_match %r{generated by RubyGems}, wrapper
@@ -222,7 +222,7 @@ gem 'other', version
end
def test_check_that_user_bin_dir_is_in_path_tilde
- skip "Tilde is PATH is not supported under MS Windows" if win_platform?
+ pend "Tilde is PATH is not supported under MS Windows" if win_platform?
orig_PATH, ENV['PATH'] =
ENV['PATH'], [ENV['PATH'], '~/bin'].join(File::PATH_SEPARATOR)
@@ -264,7 +264,7 @@ gem 'other', version
assert installer.ensure_dependency(@spec, dep)
dep = Gem::Dependency.new 'b', '> 2'
- e = assert_raises Gem::InstallError do
+ e = assert_raise Gem::InstallError do
installer.ensure_dependency @spec, dep
end
@@ -278,7 +278,7 @@ gem 'other', version
installer = Gem::Installer.at a_gem
- e = assert_raises Gem::InstallError do
+ e = assert_raise Gem::InstallError do
installer.ensure_loadable_spec
end
@@ -287,7 +287,7 @@ gem 'other', version
end
def test_ensure_loadable_spec_security_policy
- skip 'openssl is missing' unless Gem::HAVE_OPENSSL
+ pend 'openssl is missing' unless Gem::HAVE_OPENSSL
_, a_gem = util_gem 'a', 2 do |s|
s.add_dependency 'garbage ~> 5'
@@ -296,7 +296,7 @@ gem 'other', version
policy = Gem::Security::HighSecurity
installer = Gem::Installer.at a_gem, :security_policy => policy
- assert_raises Gem::Security::Exception do
+ assert_raise Gem::Security::Exception do
installer.ensure_loadable_spec
end
end
@@ -306,7 +306,7 @@ gem 'other', version
installer.extract_files
- assert_path_exists File.join @spec.gem_dir, 'bin/executable'
+ assert_path_exist File.join @spec.gem_dir, 'bin/executable'
end
def test_generate_bin_bindir
@@ -329,7 +329,7 @@ gem 'other', version
assert_directory_exists util_inst_bindir
installed_exec = File.join(util_inst_bindir, 'executable')
- assert_path_exists installed_exec
+ assert_path_exist installed_exec
assert_equal mask, File.stat(installed_exec).mode unless win_platform?
wrapper = File.read installed_exec
@@ -372,7 +372,7 @@ gem 'other', version
installer.generate_bin
assert_directory_exists util_inst_bindir
installed_exec = File.join util_inst_bindir, 'executable'
- assert_path_exists installed_exec
+ assert_path_exist installed_exec
assert_equal mask, File.stat(installed_exec).mode unless win_platform?
wrapper = File.read installed_exec
@@ -391,7 +391,7 @@ gem 'other', version
installer.generate_bin
assert_directory_exists util_inst_bindir
installed_exec = File.join util_inst_bindir, 'foo-executable-bar'
- assert_path_exists installed_exec
+ assert_path_exist installed_exec
ensure
Gem::Installer.exec_format = nil
end
@@ -407,7 +407,7 @@ gem 'other', version
installer.generate_bin
assert_directory_exists util_inst_bindir
installed_exec = File.join util_inst_bindir, 'executable'
- assert_path_exists installed_exec
+ assert_path_exist installed_exec
ensure
Gem::Installer.exec_format = nil
end
@@ -431,7 +431,7 @@ gem 'other', version
installer.generate_bin
installed_exec = File.join("#{@gemhome}2", "bin", 'executable')
- assert_path_exists installed_exec
+ assert_path_exist installed_exec
assert_equal mask, File.stat(installed_exec).mode unless win_platform?
wrapper = File.read installed_exec
@@ -446,7 +446,7 @@ gem 'other', version
installer.wrappers = true
installer.generate_bin
- refute_path_exists util_inst_bindir, 'bin dir was created when not needed'
+ assert_path_not_exist util_inst_bindir, 'bin dir was created when not needed'
end
def test_generate_bin_script_no_perms
@@ -458,13 +458,13 @@ gem 'other', version
Dir.mkdir util_inst_bindir
if win_platform?
- skip('test_generate_bin_script_no_perms skipped on MS Windows')
+ pend('test_generate_bin_script_no_perms skipped on MS Windows')
elsif Process.uid.zero?
- skip('test_generate_bin_script_no_perms skipped in root privilege')
+ pend('test_generate_bin_script_no_perms skipped in root privilege')
else
FileUtils.chmod 0000, util_inst_bindir
- assert_raises Gem::FilePermissionError do
+ assert_raise Gem::FilePermissionError do
installer.generate_bin
end
end
@@ -488,7 +488,7 @@ gem 'other', version
installer.generate_bin
installed_exec = File.join @gemhome, 'bin', 'executable'
- assert_path_exists installed_exec
+ assert_path_exist installed_exec
assert_equal mask, File.stat(installed_exec).mode unless win_platform?
wrapper = File.read installed_exec
@@ -515,7 +515,7 @@ gem 'other', version
installer.generate_bin
assert_directory_exists util_inst_bindir
- assert_path_exists installed_exec
+ assert_path_exist installed_exec
assert_equal mask, File.stat(installed_exec).mode unless win_platform?
assert_match %r{generated by RubyGems}, File.read(installed_exec)
@@ -525,7 +525,7 @@ gem 'other', version
end
def test_generate_bin_symlink
- skip "Symlinks not supported or not enabled" unless symlink_supported?
+ pend "Symlinks not supported or not enabled" unless symlink_supported?
installer = setup_base_installer
@@ -549,7 +549,7 @@ gem 'other', version
installer.wrappers = false
installer.generate_bin
- refute_path_exists util_inst_bindir
+ assert_path_not_exist util_inst_bindir
end
def test_generate_bin_symlink_no_perms
@@ -562,13 +562,13 @@ gem 'other', version
Dir.mkdir util_inst_bindir
if win_platform?
- skip('test_generate_bin_symlink_no_perms skipped on MS Windows')
+ pend('test_generate_bin_symlink_no_perms skipped on MS Windows')
elsif Process.uid.zero?
- skip('test_user_install_disabled_read_only test skipped in root privilege')
+ pend('test_user_install_disabled_read_only test skipped in root privilege')
else
FileUtils.chmod 0000, util_inst_bindir
- assert_raises Gem::FilePermissionError do
+ assert_raise Gem::FilePermissionError do
installer.generate_bin
end
end
@@ -577,7 +577,7 @@ gem 'other', version
end
def test_generate_bin_symlink_update_newer
- skip "Symlinks not supported or not enabled" unless symlink_supported?
+ pend "Symlinks not supported or not enabled" unless symlink_supported?
installer = setup_base_installer
@@ -609,7 +609,7 @@ gem 'other', version
end
def test_generate_bin_symlink_update_older
- skip "Symlinks not supported or not enabled" unless symlink_supported?
+ pend "Symlinks not supported or not enabled" unless symlink_supported?
installer = setup_base_installer
@@ -647,7 +647,7 @@ gem 'other', version
end
def test_generate_bin_symlink_update_remove_wrapper
- skip "Symlinks not supported or not enabled" unless symlink_supported?
+ pend "Symlinks not supported or not enabled" unless symlink_supported?
installer = setup_base_installer
@@ -658,7 +658,7 @@ gem 'other', version
installer.generate_bin
installed_exec = File.join util_inst_bindir, 'executable'
- assert_path_exists installed_exec
+ assert_path_exist installed_exec
@spec = Gem::Specification.new do |s|
s.files = ['lib/code.rb']
@@ -701,7 +701,7 @@ gem 'other', version
assert_directory_exists util_inst_bindir
installed_exec = File.join(util_inst_bindir, 'executable')
- assert_path_exists installed_exec
+ assert_path_exist installed_exec
if symlink_supported?
assert File.symlink?(installed_exec)
@@ -720,7 +720,7 @@ gem 'other', version
end
def test_generate_bin_uses_default_shebang
- skip "Symlinks not supported or not enabled" unless symlink_supported?
+ pend "Symlinks not supported or not enabled" unless symlink_supported?
installer = setup_base_installer
@@ -946,22 +946,22 @@ gem 'other', version
spec_file = File.join @gemhome, 'specifications', @spec.spec_name
Gem.pre_install do
- refute_path_exists cache_file, 'cache file must not exist yet'
- refute_path_exists spec_file, 'spec file must not exist yet'
+ assert_path_not_exist cache_file, 'cache file must not exist yet'
+ assert_path_not_exist spec_file, 'spec file must not exist yet'
true
end
Gem.post_build do
- assert_path_exists gemdir, 'gem install dir must exist'
- assert_path_exists rakefile, 'gem executable must exist'
- refute_path_exists stub_exe, 'gem executable must not exist'
- refute_path_exists spec_file, 'spec file must not exist yet'
+ assert_path_exist gemdir, 'gem install dir must exist'
+ assert_path_exist rakefile, 'gem executable must exist'
+ assert_path_not_exist stub_exe, 'gem executable must not exist'
+ assert_path_not_exist spec_file, 'spec file must not exist yet'
true
end
Gem.post_install do
- assert_path_exists cache_file, 'cache file must exist'
- assert_path_exists spec_file, 'spec file must exist'
+ assert_path_exist cache_file, 'cache file must exist'
+ assert_path_exist spec_file, 'spec file must exist'
end
@newspec = nil
@@ -972,21 +972,21 @@ gem 'other', version
end
assert_equal @spec, @newspec
- assert_path_exists gemdir
- assert_path_exists stub_exe, 'gem executable must exist'
+ assert_path_exist gemdir
+ assert_path_exist stub_exe, 'gem executable must exist'
exe = File.join gemdir, 'bin', 'executable'
- assert_path_exists exe
+ assert_path_exist exe
exe_mode = File.stat(exe).mode & 0111
assert_equal 0111, exe_mode, "0%o" % exe_mode unless win_platform?
- assert_path_exists File.join gemdir, 'lib', 'code.rb'
+ assert_path_exist File.join gemdir, 'lib', 'code.rb'
- assert_path_exists rakefile
+ assert_path_exist rakefile
assert_equal spec_file, @newspec.loaded_from
- assert_path_exists spec_file
+ assert_path_exist spec_file
assert_same installer, @post_build_hook_arg
assert_same installer, @post_install_hook_arg
@@ -1009,7 +1009,7 @@ gem 'other', version
exe = File.join gemdir, 'bin', 'executable'
- e = assert_raises RuntimeError do
+ e = assert_raise RuntimeError do
instance_eval File.read(exe)
end
@@ -1055,7 +1055,7 @@ gem 'other', version
end
end
- e = assert_raises RuntimeError do
+ e = assert_raise RuntimeError do
instance_eval File.read(old_bin_file)
end
@@ -1083,7 +1083,7 @@ gem 'other', version
begin
Gem::Specification.reset
- e = assert_raises Gem::GemNotFoundException do
+ e = assert_raise Gem::GemNotFoundException do
instance_eval File.read(exe)
end
ensure
@@ -1100,7 +1100,7 @@ gem 'other', version
exe = File.join @gemhome, 'bin', 'executable'
- assert_path_exists exe, "default gem's executable not installed"
+ assert_path_exist exe, "default gem's executable not installed"
installer = util_setup_installer do |spec|
spec.name = 'default'
@@ -1118,7 +1118,7 @@ gem 'other', version
end
end
- e = assert_raises RuntimeError do
+ e = assert_raise RuntimeError do
instance_eval File.read(exe)
end
@@ -1145,7 +1145,7 @@ gem 'other', version
begin
Gem::Specification.reset
- e = assert_raises RuntimeError do
+ e = assert_raise RuntimeError do
instance_eval File.read(exe)
end
ensure
@@ -1165,7 +1165,7 @@ gem 'other', version
end
gemdir = File.join(@gemhome, 'gems', @spec.full_name)
- assert_path_exists File.join gemdir, 'lib', 'code.rb'
+ assert_path_exist File.join gemdir, 'lib', 'code.rb'
installer = util_setup_installer
@@ -1188,8 +1188,8 @@ gem 'other', version
end
end
- assert_path_exists File.join gemdir, 'lib', 'other.rb'
- refute_path_exists File.join gemdir, 'lib', 'code.rb',
+ assert_path_exist File.join gemdir, 'lib', 'other.rb'
+ assert_path_not_exist File.join gemdir, 'lib', 'code.rb',
"code.rb from prior install of same gem shouldn't remain here"
end
@@ -1204,7 +1204,7 @@ gem 'other', version
end
gem_dir = File.join(@gemhome, 'gems', 'missing_dep-1')
- assert_path_exists gem_dir
+ assert_path_exist gem_dir
end
def test_install_build_root
@@ -1231,8 +1231,8 @@ gem 'other', version
assert_directory_exists File.join(Gem.dir, 'doc')
assert_directory_exists File.join(Gem.dir, 'specifications')
- assert_path_exists File.join @gemhome, 'cache', @spec.file_name
- assert_path_exists File.join @gemhome, 'specifications', @spec.spec_name
+ assert_path_exist File.join @gemhome, 'cache', @spec.file_name
+ assert_path_exist File.join @gemhome, 'specifications', @spec.spec_name
end
def test_install_post_build_false
@@ -1243,7 +1243,7 @@ gem 'other', version
end
use_ui @ui do
- e = assert_raises Gem::InstallError do
+ e = assert_raise Gem::InstallError do
installer.install
end
@@ -1253,10 +1253,10 @@ gem 'other', version
end
spec_file = File.join @gemhome, 'specifications', @spec.spec_name
- refute_path_exists spec_file
+ assert_path_not_exist spec_file
gem_dir = File.join @gemhome, 'gems', @spec.full_name
- refute_path_exists gem_dir
+ assert_path_not_exist gem_dir
end
def test_install_post_build_nil
@@ -1271,10 +1271,10 @@ gem 'other', version
end
spec_file = File.join @gemhome, 'specifications', @spec.spec_name
- assert_path_exists spec_file
+ assert_path_exist spec_file
gem_dir = File.join @gemhome, 'gems', @spec.full_name
- assert_path_exists gem_dir
+ assert_path_exist gem_dir
end
def test_install_pre_install_false
@@ -1285,7 +1285,7 @@ gem 'other', version
end
use_ui @ui do
- e = assert_raises Gem::InstallError do
+ e = assert_raise Gem::InstallError do
installer.install
end
@@ -1295,7 +1295,7 @@ gem 'other', version
end
spec_file = File.join @gemhome, 'specifications', @spec.spec_name
- refute_path_exists spec_file
+ assert_path_not_exist spec_file
end
def test_install_pre_install_nil
@@ -1310,7 +1310,7 @@ gem 'other', version
end
spec_file = File.join @gemhome, 'specifications', @spec.spec_name
- assert_path_exists spec_file
+ assert_path_exist spec_file
end
def test_install_with_message
@@ -1364,7 +1364,7 @@ gem 'other', version
expected_makefile = File.join gemhome2, 'gems', @spec.full_name, 'Makefile'
- assert_path_exists expected_makefile
+ assert_path_exist expected_makefile
end
def test_install_extension_dir_is_removed_on_reinstall
@@ -1393,7 +1393,7 @@ gem 'other', version
write_file should_be_removed do |io|
io.write "DELETE ME ON REINSTALL"
end
- assert_path_exists should_be_removed
+ assert_path_exist should_be_removed
# reinstall the gem, this is also the same as pristine
use_ui @ui do
@@ -1401,7 +1401,7 @@ gem 'other', version
installer.install
end
- refute_path_exists should_be_removed
+ assert_path_not_exist should_be_removed
end
def test_install_user_extension_dir
@@ -1429,13 +1429,13 @@ gem 'other', version
expected_makefile = File.join Gem.user_dir, 'gems', @spec.full_name, 'Makefile'
- assert_path_exists expected_makefile
- assert_path_exists expected_extension_dir
- refute_path_exists File.join expected_extension_dir, 'gem_make.out'
+ assert_path_exist expected_makefile
+ assert_path_exist expected_extension_dir
+ assert_path_not_exist File.join expected_extension_dir, 'gem_make.out'
end
def test_find_lib_file_after_install
- skip "extensions don't quite work on jruby" if Gem.java_platform?
+ pend "extensions don't quite work on jruby" if Gem.java_platform?
@spec = setup_base_spec
@spec.extensions << "extconf.rb"
@@ -1481,7 +1481,7 @@ gem 'other', version
end
def test_install_extension_and_script
- skip "Makefile creation crashes on jruby" if Gem.java_platform?
+ pend "Makefile creation crashes on jruby" if Gem.java_platform?
@spec = setup_base_spec
@spec.extensions << "extconf.rb"
@@ -1509,65 +1509,67 @@ gem 'other', version
RUBY
end
- refute_path_exists File.join @spec.gem_dir, rb
- refute_path_exists File.join @spec.gem_dir, rb2
+ assert_path_not_exist File.join @spec.gem_dir, rb
+ assert_path_not_exist File.join @spec.gem_dir, rb2
use_ui @ui do
path = Gem::Package.build @spec
installer = Gem::Installer.at path
installer.install
end
- assert_path_exists File.join @spec.gem_dir, rb
- assert_path_exists File.join @spec.gem_dir, rb2
+ assert_path_exist File.join @spec.gem_dir, rb
+ assert_path_exist File.join @spec.gem_dir, rb2
end
def test_install_extension_flat
- skip "extensions don't quite work on jruby" if Gem.java_platform?
+ pend "extensions don't quite work on jruby" if Gem.java_platform?
- @spec = setup_base_spec
- @spec.require_paths = ["."]
+ begin
+ @spec = setup_base_spec
+ @spec.require_paths = ["."]
- @spec.extensions << "extconf.rb"
+ @spec.extensions << "extconf.rb"
- write_file File.join(@tempdir, "extconf.rb") do |io|
- io.write <<-RUBY
- require "mkmf"
+ write_file File.join(@tempdir, "extconf.rb") do |io|
+ io.write <<-RUBY
+ require "mkmf"
- CONFIG['CC'] = '$(TOUCH) $@ ||'
- CONFIG['LDSHARED'] = '$(TOUCH) $@ ||'
- $ruby = '#{Gem.ruby}'
+ CONFIG['CC'] = '$(TOUCH) $@ ||'
+ CONFIG['LDSHARED'] = '$(TOUCH) $@ ||'
+ $ruby = '#{Gem.ruby}'
- create_makefile("#{@spec.name}")
- RUBY
- end
+ create_makefile("#{@spec.name}")
+ RUBY
+ end
- # empty depend file for no auto dependencies
- @spec.files += %W[depend #{@spec.name}.c].each do |file|
- write_file File.join(@tempdir, file)
- end
+ # empty depend file for no auto dependencies
+ @spec.files += %W[depend #{@spec.name}.c].each do |file|
+ write_file File.join(@tempdir, file)
+ end
- so = File.join(@spec.gem_dir, "#{@spec.name}.#{RbConfig::CONFIG["DLEXT"]}")
- refute_path_exists so
- use_ui @ui do
- path = Gem::Package.build @spec
+ so = File.join(@spec.gem_dir, "#{@spec.name}.#{RbConfig::CONFIG["DLEXT"]}")
+ assert_path_not_exist so
+ use_ui @ui do
+ path = Gem::Package.build @spec
- installer = Gem::Installer.at path
- installer.install
- end
- assert_path_exists so
- rescue
- puts '-' * 78
- puts File.read File.join(@gemhome, 'gems', 'a-2', 'Makefile')
- puts '-' * 78
+ installer = Gem::Installer.at path
+ installer.install
+ end
+ assert_path_exist so
+ rescue
+ puts '-' * 78
+ puts File.read File.join(@gemhome, 'gems', 'a-2', 'Makefile')
+ puts '-' * 78
- path = File.join(@gemhome, 'gems', 'a-2', 'gem_make.out')
+ path = File.join(@gemhome, 'gems', 'a-2', 'gem_make.out')
- if File.exist?(path)
- puts File.read(path)
- puts '-' * 78
- end
+ if File.exist?(path)
+ puts File.read(path)
+ puts '-' * 78
+ end
- raise
+ raise
+ end
end
def test_installation_satisfies_dependency_eh
@@ -1600,7 +1602,7 @@ gem 'other', version
installer.force = false
use_ui @ui do
- assert_raises Gem::InstallError do
+ assert_raise Gem::InstallError do
installer.install
end
end
@@ -1659,7 +1661,7 @@ gem 'other', version
use_ui @ui do
installer = Gem::Installer.at gem
- e = assert_raises Gem::InstallError do
+ e = assert_raise Gem::InstallError do
installer.pre_install_checks
end
assert_equal '#<Gem::Specification name=../malicious version=1> has an invalid name', e.message
@@ -1679,7 +1681,7 @@ gem 'other', version
use_ui @ui do
installer = Gem::Installer.at gem
- e = assert_raises Gem::InstallError do
+ e = assert_raise Gem::InstallError do
installer.pre_install_checks
end
assert_equal "#<Gem::Specification name=malicious\n::Object.const_set(:FROM_EVAL, true)# version=1> has an invalid name", e.message
@@ -1701,7 +1703,7 @@ gem 'other', version
use_ui @ui do
installer = Gem::Installer.at gem
- e = assert_raises Gem::InstallError do
+ e = assert_raise Gem::InstallError do
installer.pre_install_checks
end
assert_equal "#<Gem::Specification name=malicious version=1> has an invalid require_paths", e.message
@@ -1709,7 +1711,7 @@ gem 'other', version
end
def test_pre_install_checks_malicious_extensions_before_eval
- skip "mswin environment disallow to create file contained the carriage return code." if Gem.win_platform?
+ pend "mswin environment disallow to create file contained the carriage return code." if Gem.win_platform?
spec = util_spec "malicious", '1'
def spec.full_name # so the spec is buildable
@@ -1724,7 +1726,7 @@ gem 'other', version
use_ui @ui do
installer = Gem::Installer.at gem
- e = assert_raises Gem::InstallError do
+ e = assert_raise Gem::InstallError do
installer.pre_install_checks
end
assert_equal "#<Gem::Specification name=malicious version=1> has an invalid extensions", e.message
@@ -1745,7 +1747,7 @@ gem 'other', version
use_ui @ui do
installer = Gem::Installer.at gem
- e = assert_raises Gem::InstallError do
+ e = assert_raise Gem::InstallError do
installer.pre_install_checks
end
assert_equal "#<Gem::Specification name=malicious version=1> has an invalid specification_version", e.message
@@ -1767,7 +1769,7 @@ gem 'other', version
use_ui @ui do
installer = Gem::Installer.at gem
installer.ignore_dependencies = true
- e = assert_raises Gem::InstallError do
+ e = assert_raise Gem::InstallError do
installer.pre_install_checks
end
assert_equal "#<Gem::Specification name=malicious version=1> has an invalid dependencies", e.message
@@ -1991,14 +1993,14 @@ gem 'other', version
installer.unpack dest
end
- assert_path_exists File.join dest, 'lib', 'code.rb'
- assert_path_exists File.join dest, 'bin', 'executable'
+ assert_path_exist File.join dest, 'lib', 'code.rb'
+ assert_path_exist File.join dest, 'bin', 'executable'
end
def test_write_build_info_file
installer = setup_base_installer
- refute_path_exists @spec.build_info_file
+ assert_path_not_exist @spec.build_info_file
installer.build_args = %w[
--with-libyaml-dir /usr/local/Cellar/libyaml/0.1.4
@@ -2006,7 +2008,7 @@ gem 'other', version
installer.write_build_info_file
- assert_path_exists @spec.build_info_file
+ assert_path_exist @spec.build_info_file
expected = "--with-libyaml-dir\n/usr/local/Cellar/libyaml/0.1.4\n"
@@ -2016,11 +2018,11 @@ gem 'other', version
def test_write_build_info_file_empty
installer = setup_base_installer
- refute_path_exists @spec.build_info_file
+ assert_path_not_exist @spec.build_info_file
installer.write_build_info_file
- refute_path_exists @spec.build_info_file
+ assert_path_not_exist @spec.build_info_file
end
def test_write_build_info_file_install_dir
@@ -2033,8 +2035,8 @@ gem 'other', version
installer.write_build_info_file
- refute_path_exists @spec.build_info_file
- assert_path_exists \
+ assert_path_not_exist @spec.build_info_file
+ assert_path_exist \
File.join("#{@gemhome}2", 'build_info', "#{@spec.full_name}.info")
end
@@ -2044,27 +2046,27 @@ gem 'other', version
gem = File.join @gemhome, @spec.file_name
FileUtils.mv cache_file, gem
- refute_path_exists cache_file
+ assert_path_not_exist cache_file
installer = Gem::Installer.at gem
installer.gem_home = @gemhome
installer.write_cache_file
- assert_path_exists cache_file
+ assert_path_exist cache_file
end
def test_write_spec
@spec = setup_base_spec
FileUtils.rm @spec.spec_file
- refute_path_exists @spec.spec_file
+ assert_path_not_exist @spec.spec_file
installer = Gem::Installer.for_spec @spec
installer.gem_home = @gemhome
installer.write_spec
- assert_path_exists @spec.spec_file
+ assert_path_exist @spec.spec_file
loaded = Gem::Specification.load @spec.spec_file
@@ -2076,7 +2078,7 @@ gem 'other', version
def test_write_spec_writes_cached_spec
@spec = setup_base_spec
FileUtils.rm @spec.spec_file
- refute_path_exists @spec.spec_file
+ assert_path_not_exist @spec.spec_file
@spec.files = %w[a.rb b.rb c.rb]
@@ -2119,7 +2121,7 @@ gem 'other', version
assert_directory_exists File.join(@spec.gem_dir, 'bin')
installed_exec = File.join @spec.gem_dir, 'bin', 'executable'
- assert_path_exists installed_exec
+ assert_path_exist installed_exec
assert_directory_exists File.join(Gem.default_dir, 'specifications')
assert_directory_exists File.join(Gem.default_dir, 'specifications', 'default')
@@ -2131,7 +2133,7 @@ gem 'other', version
assert_directory_exists util_inst_bindir
installed_exec = File.join util_inst_bindir, 'executable'
- assert_path_exists installed_exec
+ assert_path_exist installed_exec
wrapper = File.read installed_exec
@@ -2157,7 +2159,7 @@ gem 'other', version
assert_directory_exists util_inst_bindir
installed_exec = File.join util_inst_bindir, 'executable'
- assert_path_exists installed_exec
+ assert_path_exist installed_exec
wrapper = File.read installed_exec
assert_match %r{generated by RubyGems}, wrapper
@@ -2183,7 +2185,7 @@ gem 'other', version
assert_directory_exists File.join(@spec.gem_dir, 'exe')
installed_exec = File.join @spec.gem_dir, 'exe', 'executable'
- assert_path_exists installed_exec
+ assert_path_exist installed_exec
assert_directory_exists File.join(Gem.default_dir, 'specifications')
assert_directory_exists File.join(Gem.default_dir, 'specifications', 'default')
diff --git a/test/rubygems/test_gem_local_remote_options.rb b/test/rubygems/test_gem_local_remote_options.rb
index 93059ae731..2373bbde1f 100644
--- a/test/rubygems/test_gem_local_remote_options.rb
+++ b/test/rubygems/test_gem_local_remote_options.rb
@@ -123,7 +123,7 @@ class TestGemLocalRemoteOptions < Gem::TestCase
s1 = 'htp://more-gems.example.com'
- assert_raises ArgumentError do
+ assert_raise ArgumentError do
@cmd.handle_options %W[--source #{s1}]
end
diff --git a/test/rubygems/test_gem_package.rb b/test/rubygems/test_gem_package.rb
index eb10ea3437..9bf03b6801 100644
--- a/test/rubygems/test_gem_package.rb
+++ b/test/rubygems/test_gem_package.rb
@@ -22,7 +22,7 @@ class TestGemPackage < Gem::Package::TarTestCase
end
def test_class_new_old_format
- skip "jruby can't require the simple_gem file" if Gem.java_platform?
+ pend "jruby can't require the simple_gem file" if Gem.java_platform?
require_relative "simple_gem"
File.open 'old_format.gem', 'wb' do |io|
io.write SIMPLE_GEM
@@ -98,7 +98,7 @@ class TestGemPackage < Gem::Package::TarTestCase
},
}
- assert_equal expected, YAML.load(checksums)
+ assert_equal expected, load_yaml(checksums)
end
def test_build_time_uses_source_date_epoch
@@ -190,7 +190,7 @@ class TestGemPackage < Gem::Package::TarTestCase
File.symlink('../lib/code.rb', 'lib/code_sym2.rb')
rescue Errno::EACCES => e
if win_platform?
- skip "symlink - must be admin with no UAC on Windows"
+ pend "symlink - must be admin with no UAC on Windows"
else
raise e
end
@@ -240,7 +240,7 @@ class TestGemPackage < Gem::Package::TarTestCase
package.build
assert_equal Gem::VERSION, spec.rubygems_version
- assert_path_exists spec.file_name
+ assert_path_exist spec.file_name
reader = Gem::Package.new spec.file_name
assert_equal spec, reader.spec
@@ -252,7 +252,7 @@ class TestGemPackage < Gem::Package::TarTestCase
end
def test_build_auto_signed
- skip 'openssl is missing' unless Gem::HAVE_OPENSSL
+ pend 'openssl is missing' unless Gem::HAVE_OPENSSL
FileUtils.mkdir_p File.join(Gem.user_home, '.gem')
@@ -279,7 +279,7 @@ class TestGemPackage < Gem::Package::TarTestCase
package.build
assert_equal Gem::VERSION, spec.rubygems_version
- assert_path_exists spec.file_name
+ assert_path_exist spec.file_name
reader = Gem::Package.new spec.file_name
assert reader.verify
@@ -295,7 +295,7 @@ class TestGemPackage < Gem::Package::TarTestCase
end
def test_build_auto_signed_encrypted_key
- skip 'openssl is missing' unless Gem::HAVE_OPENSSL
+ pend 'openssl is missing' unless Gem::HAVE_OPENSSL
FileUtils.mkdir_p File.join(Gem.user_home, '.gem')
@@ -322,7 +322,7 @@ class TestGemPackage < Gem::Package::TarTestCase
package.build
assert_equal Gem::VERSION, spec.rubygems_version
- assert_path_exists spec.file_name
+ assert_path_exist spec.file_name
reader = Gem::Package.new spec.file_name
assert reader.verify
@@ -343,7 +343,7 @@ class TestGemPackage < Gem::Package::TarTestCase
package = Gem::Package.new spec.file_name
package.spec = spec
- e = assert_raises Gem::InvalidSpecificationException do
+ e = assert_raise Gem::InvalidSpecificationException do
package.build
end
@@ -356,7 +356,7 @@ class TestGemPackage < Gem::Package::TarTestCase
package = Gem::Package.new spec.file_name
package.spec = spec
- e = assert_raises ArgumentError do
+ e = assert_raise ArgumentError do
package.build true, true
end
@@ -364,7 +364,7 @@ class TestGemPackage < Gem::Package::TarTestCase
end
def test_build_signed
- skip 'openssl is missing' unless Gem::HAVE_OPENSSL
+ pend 'openssl is missing' unless Gem::HAVE_OPENSSL
spec = Gem::Specification.new 'build', '1'
spec.summary = 'build'
@@ -385,7 +385,7 @@ class TestGemPackage < Gem::Package::TarTestCase
package.build
assert_equal Gem::VERSION, spec.rubygems_version
- assert_path_exists spec.file_name
+ assert_path_exist spec.file_name
reader = Gem::Package.new spec.file_name
assert reader.verify
@@ -401,7 +401,7 @@ class TestGemPackage < Gem::Package::TarTestCase
end
def test_build_signed_encrypted_key
- skip 'openssl is missing' unless Gem::HAVE_OPENSSL
+ pend 'openssl is missing' unless Gem::HAVE_OPENSSL
spec = Gem::Specification.new 'build', '1'
spec.summary = 'build'
@@ -422,7 +422,7 @@ class TestGemPackage < Gem::Package::TarTestCase
package.build
assert_equal Gem::VERSION, spec.rubygems_version
- assert_path_exists spec.file_name
+ assert_path_exist spec.file_name
reader = Gem::Package.new spec.file_name
assert reader.verify
@@ -476,7 +476,7 @@ class TestGemPackage < Gem::Package::TarTestCase
package.extract_files @destination
extracted = File.join @destination, 'lib/code.rb'
- assert_path_exists extracted
+ assert_path_exist extracted
mask = 0100666 & (~File.umask)
@@ -507,7 +507,7 @@ class TestGemPackage < Gem::Package::TarTestCase
package.extract_files @destination
- assert_path_exists @destination
+ assert_path_exist @destination
end
def test_extract_tar_gz_absolute
@@ -519,7 +519,7 @@ class TestGemPackage < Gem::Package::TarTestCase
end
end
- e = assert_raises Gem::Package::PathError do
+ e = assert_raise Gem::Package::PathError do
package.extract_tar_gz tgz_io, @destination
end
@@ -543,14 +543,14 @@ class TestGemPackage < Gem::Package::TarTestCase
package.extract_tar_gz tgz_io, @destination
rescue Errno::EACCES => e
if win_platform?
- skip "symlink - must be admin with no UAC on Windows"
+ pend "symlink - must be admin with no UAC on Windows"
else
raise e
end
end
extracted = File.join @destination, 'lib/foo.rb'
- assert_path_exists extracted
+ assert_path_exist extracted
assert_equal '../relative.rb',
File.readlink(extracted)
assert_equal 'hi',
@@ -574,7 +574,7 @@ class TestGemPackage < Gem::Package::TarTestCase
destination_subdir = File.join @destination, 'subdir'
FileUtils.mkdir_p destination_subdir
- e = assert_raises(Gem::Package::PathError, Errno::EACCES) do
+ e = assert_raise(Gem::Package::PathError, Errno::EACCES) do
package.extract_tar_gz tgz_io, destination_subdir
end
@@ -582,7 +582,7 @@ class TestGemPackage < Gem::Package::TarTestCase
assert_equal("installing into parent path lib/link/outside.txt of " +
"#{destination_subdir} is not allowed", e.message)
elsif win_platform?
- skip "symlink - must be admin with no UAC on Windows"
+ pend "symlink - must be admin with no UAC on Windows"
else
raise e
end
@@ -601,24 +601,24 @@ class TestGemPackage < Gem::Package::TarTestCase
destination_user_subdir = File.join destination_user_dir, 'dir'
FileUtils.mkdir_p destination_user_subdir
- skip "TMPDIR seems too long to add it as symlink into tar" if destination_user_dir.size > 90
+ pend "TMPDIR seems too long to add it as symlink into tar" if destination_user_dir.size > 90
tgz_io = util_tar_gz do |tar|
tar.add_symlink 'link', destination_user_dir, 16877
tar.add_symlink 'link/dir', '.', 16877
end
- e = assert_raises(Gem::Package::PathError, Errno::EACCES) do
+ e = assert_raise(Gem::Package::PathError, Errno::EACCES) do
package.extract_tar_gz tgz_io, destination_subdir
end
- assert_path_exists destination_user_subdir
+ assert_path_exist destination_user_subdir
if Gem::Package::PathError === e
assert_equal("installing into parent path #{destination_user_subdir} of " +
"#{destination_subdir} is not allowed", e.message)
elsif win_platform?
- skip "symlink - must be admin with no UAC on Windows"
+ pend "symlink - must be admin with no UAC on Windows"
else
raise e
end
@@ -638,10 +638,10 @@ class TestGemPackage < Gem::Package::TarTestCase
package.extract_tar_gz tgz_io, @destination
extracted = File.join @destination, 'lib/foo.rb'
- assert_path_exists extracted
+ assert_path_exist extracted
extracted = File.join @destination, 'lib/foo'
- assert_path_exists extracted
+ assert_path_exist extracted
end
def test_extract_tar_gz_dot_slash
@@ -656,7 +656,7 @@ class TestGemPackage < Gem::Package::TarTestCase
package.extract_tar_gz tgz_io, @destination
extracted = File.join @destination, 'dot_slash.rb'
- assert_path_exists extracted
+ assert_path_exist extracted
end
def test_extract_tar_gz_dot_file
@@ -671,7 +671,7 @@ class TestGemPackage < Gem::Package::TarTestCase
package.extract_tar_gz tgz_io, @destination
extracted = File.join @destination, '.dot_file.rb'
- assert_path_exists extracted
+ assert_path_exist extracted
end
if Gem.win_platform?
@@ -687,7 +687,7 @@ class TestGemPackage < Gem::Package::TarTestCase
package.extract_tar_gz tgz_io, @destination.upcase
extracted = File.join @destination, 'foo/file.rb'
- assert_path_exists extracted
+ assert_path_exist extracted
end
end
@@ -706,7 +706,7 @@ class TestGemPackage < Gem::Package::TarTestCase
def test_install_location_absolute
package = Gem::Package.new @gem
- e = assert_raises Gem::Package::PathError do
+ e = assert_raise Gem::Package::PathError do
package.install_location '/absolute.rb', @destination
end
@@ -747,7 +747,7 @@ class TestGemPackage < Gem::Package::TarTestCase
def test_install_location_relative
package = Gem::Package.new @gem
- e = assert_raises Gem::Package::PathError do
+ e = assert_raise Gem::Package::PathError do
package.install_location '../relative.rb', @destination
end
@@ -762,7 +762,7 @@ class TestGemPackage < Gem::Package::TarTestCase
filename = "../#{File.basename(@destination)}suffix.rb"
- e = assert_raises Gem::Package::PathError do
+ e = assert_raise Gem::Package::PathError do
package.install_location filename, @destination
end
@@ -832,7 +832,7 @@ class TestGemPackage < Gem::Package::TarTestCase
package = Gem::Package.new 'mismatch.gem'
- e = assert_raises Gem::Package::FormatError do
+ e = assert_raise Gem::Package::FormatError do
package.verify
end
@@ -886,7 +886,7 @@ class TestGemPackage < Gem::Package::TarTestCase
end
def test_verify_corrupt
- skip "jruby strips the null byte and does not think it's corrupt" if Gem.java_platform?
+ pend "jruby strips the null byte and does not think it's corrupt" if Gem.java_platform?
tf = Tempfile.open 'corrupt' do |io|
data = Gem::Util.gzip 'a' * 10
io.write \
@@ -896,7 +896,7 @@ class TestGemPackage < Gem::Package::TarTestCase
package = Gem::Package.new io.path
- e = assert_raises Gem::Package::FormatError do
+ e = assert_raise Gem::Package::FormatError do
package.verify
end
@@ -912,7 +912,7 @@ class TestGemPackage < Gem::Package::TarTestCase
package = Gem::Package.new 'empty.gem'
- e = assert_raises Gem::Package::FormatError do
+ e = assert_raise Gem::Package::FormatError do
package.verify
end
@@ -922,7 +922,7 @@ class TestGemPackage < Gem::Package::TarTestCase
def test_verify_nonexistent
package = Gem::Package.new 'nonexistent.gem'
- e = assert_raises Gem::Package::FormatError do
+ e = assert_raise Gem::Package::FormatError do
package.verify
end
@@ -949,7 +949,7 @@ class TestGemPackage < Gem::Package::TarTestCase
package = Gem::Package.new @gem
- e = assert_raises Gem::Security::Exception do
+ e = assert_raise Gem::Security::Exception do
package.verify
end
@@ -957,12 +957,12 @@ class TestGemPackage < Gem::Package::TarTestCase
end
def test_verify_security_policy
- skip 'openssl is missing' unless Gem::HAVE_OPENSSL
+ pend 'openssl is missing' unless Gem::HAVE_OPENSSL
package = Gem::Package.new @gem
package.security_policy = Gem::Security::HighSecurity
- e = assert_raises Gem::Security::Exception do
+ e = assert_raise Gem::Security::Exception do
package.verify
end
@@ -974,7 +974,7 @@ class TestGemPackage < Gem::Package::TarTestCase
end
def test_verify_security_policy_low_security
- skip 'openssl is missing' unless Gem::HAVE_OPENSSL
+ pend 'openssl is missing' unless Gem::HAVE_OPENSSL
@spec.cert_chain = [PUBLIC_CERT.to_pem]
@spec.signing_key = PRIVATE_KEY
@@ -994,7 +994,7 @@ class TestGemPackage < Gem::Package::TarTestCase
end
def test_verify_security_policy_checksum_missing
- skip 'openssl is missing' unless Gem::HAVE_OPENSSL
+ pend 'openssl is missing' unless Gem::HAVE_OPENSSL
@spec.cert_chain = [PUBLIC_CERT.to_pem]
@spec.signing_key = PRIVATE_KEY
@@ -1032,7 +1032,7 @@ class TestGemPackage < Gem::Package::TarTestCase
package = Gem::Package.new @gem
package.security_policy = Gem::Security::HighSecurity
- e = assert_raises Gem::Security::Exception do
+ e = assert_raise Gem::Security::Exception do
package.verify
end
@@ -1049,7 +1049,7 @@ class TestGemPackage < Gem::Package::TarTestCase
package = Gem::Package.new 'bad.gem'
- e = assert_raises Gem::Package::FormatError do
+ e = assert_raise Gem::Package::FormatError do
package.verify
end
@@ -1068,8 +1068,8 @@ class TestGemPackage < Gem::Package::TarTestCase
_, err = use_ui @ui do
e = nil
- out_err = capture_io do
- e = assert_raises ArgumentError do
+ out_err = capture_output do
+ e = assert_raise ArgumentError do
package.verify_entry entry
end
end
@@ -1140,7 +1140,7 @@ class TestGemPackage < Gem::Package::TarTestCase
def test_spec_from_io_raises_gem_error_for_io_not_at_start
io = StringIO.new Gem.read_binary @gem
io.read(1)
- assert_raises(Gem::Package::Error) do
+ assert_raise(Gem::Package::Error) do
Gem::Package.new io
end
end
diff --git a/test/rubygems/test_gem_package_old.rb b/test/rubygems/test_gem_package_old.rb
index 8c4c20006b..3477e001dc 100644
--- a/test/rubygems/test_gem_package_old.rb
+++ b/test/rubygems/test_gem_package_old.rb
@@ -23,11 +23,11 @@ unless Gem.java_platform? # jruby can't require the simple_gem file
end
def test_contents_security_policy
- skip 'openssl is missing' unless Gem::HAVE_OPENSSL
+ pend 'openssl is missing' unless Gem::HAVE_OPENSSL
@package.security_policy = Gem::Security::AlmostNoSecurity
- assert_raises Gem::Security::Exception do
+ assert_raise Gem::Security::Exception do
@package.contents
end
end
@@ -36,7 +36,7 @@ unless Gem.java_platform? # jruby can't require the simple_gem file
@package.extract_files @destination
extracted = File.join @destination, 'lib/foo.rb'
- assert_path_exists extracted
+ assert_path_exist extracted
mask = 0100644 & (~File.umask)
@@ -44,11 +44,11 @@ unless Gem.java_platform? # jruby can't require the simple_gem file
end
def test_extract_files_security_policy
- skip 'openssl is missing' unless Gem::HAVE_OPENSSL
+ pend 'openssl is missing' unless Gem::HAVE_OPENSSL
@package.security_policy = Gem::Security::AlmostNoSecurity
- assert_raises Gem::Security::Exception do
+ assert_raise Gem::Security::Exception do
@package.extract_files @destination
end
end
@@ -58,17 +58,17 @@ unless Gem.java_platform? # jruby can't require the simple_gem file
end
def test_spec_security_policy
- skip 'openssl is missing' unless Gem::HAVE_OPENSSL
+ pend 'openssl is missing' unless Gem::HAVE_OPENSSL
@package.security_policy = Gem::Security::AlmostNoSecurity
- assert_raises Gem::Security::Exception do
+ assert_raise Gem::Security::Exception do
@package.spec
end
end
def test_verify
- skip 'openssl is missing' unless Gem::HAVE_OPENSSL
+ pend 'openssl is missing' unless Gem::HAVE_OPENSSL
assert @package.verify
@@ -78,7 +78,7 @@ unless Gem.java_platform? # jruby can't require the simple_gem file
@package.security_policy = Gem::Security::AlmostNoSecurity
- e = assert_raises Gem::Security::Exception do
+ e = assert_raise Gem::Security::Exception do
@package.verify
end
diff --git a/test/rubygems/test_gem_package_tar_header.rb b/test/rubygems/test_gem_package_tar_header.rb
index da4f5506e9..9f321e0a77 100644
--- a/test/rubygems/test_gem_package_tar_header.rb
+++ b/test/rubygems/test_gem_package_tar_header.rb
@@ -57,19 +57,19 @@ class TestGemPackageTarHeader < Gem::Package::TarTestCase
end
def test_initialize_bad
- assert_raises ArgumentError do
+ assert_raise ArgumentError do
Gem::Package::TarHeader.new :name => '', :size => '', :mode => ''
end
- assert_raises ArgumentError do
+ assert_raise ArgumentError do
Gem::Package::TarHeader.new :name => '', :size => '', :prefix => ''
end
- assert_raises ArgumentError do
+ assert_raise ArgumentError do
Gem::Package::TarHeader.new :name => '', :prefix => '', :mode => ''
end
- assert_raises ArgumentError do
+ assert_raise ArgumentError do
Gem::Package::TarHeader.new :prefix => '', :size => '', :mode => ''
end
end
@@ -156,7 +156,7 @@ group\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000
# overwrite the size field
header_s[124, 12] = val
io = TempIO.new header_s
- assert_raises ArgumentError do
+ assert_raise ArgumentError do
Gem::Package::TarHeader.from io
end
io.close!
diff --git a/test/rubygems/test_gem_package_tar_reader_entry.rb b/test/rubygems/test_gem_package_tar_reader_entry.rb
index 3003e51ac8..bf20388f59 100644
--- a/test/rubygems/test_gem_package_tar_reader_entry.rb
+++ b/test/rubygems/test_gem_package_tar_reader_entry.rb
@@ -42,19 +42,19 @@ class TestGemPackageTarReaderEntry < Gem::Package::TarTestCase
assert @entry.bytes_read
- e = assert_raises(IOError) { @entry.eof? }
+ e = assert_raise(IOError) { @entry.eof? }
assert_equal 'closed Gem::Package::TarReader::Entry', e.message
- e = assert_raises(IOError) { @entry.getc }
+ e = assert_raise(IOError) { @entry.getc }
assert_equal 'closed Gem::Package::TarReader::Entry', e.message
- e = assert_raises(IOError) { @entry.pos }
+ e = assert_raise(IOError) { @entry.pos }
assert_equal 'closed Gem::Package::TarReader::Entry', e.message
- e = assert_raises(IOError) { @entry.read }
+ e = assert_raise(IOError) { @entry.read }
assert_equal 'closed Gem::Package::TarReader::Entry', e.message
- e = assert_raises(IOError) { @entry.rewind }
+ e = assert_raise(IOError) { @entry.rewind }
assert_equal 'closed Gem::Package::TarReader::Entry', e.message
end
@@ -75,10 +75,10 @@ class TestGemPackageTarReaderEntry < Gem::Package::TarTestCase
end
def test_full_name_null
- skip "jruby strips the null byte and does not think it's corrupt" if Gem.java_platform?
+ pend "jruby strips the null byte and does not think it's corrupt" if Gem.java_platform?
@entry.header.prefix << "\000"
- e = assert_raises Gem::Package::TarInvalidError do
+ e = assert_raise Gem::Package::TarInvalidError do
@entry.full_name
end
@@ -134,7 +134,7 @@ class TestGemPackageTarReaderEntry < Gem::Package::TarTestCase
end
def test_readpartial
- assert_raises(EOFError) do
+ assert_raise(EOFError) do
@entry.read(@contents.size)
@entry.readpartial(1)
end
diff --git a/test/rubygems/test_gem_package_tar_writer.rb b/test/rubygems/test_gem_package_tar_writer.rb
index 25dac5f148..6260f80ef9 100644
--- a/test/rubygems/test_gem_package_tar_writer.rb
+++ b/test/rubygems/test_gem_package_tar_writer.rb
@@ -1,7 +1,6 @@
# frozen_string_literal: true
require 'rubygems/package/tar_test_case'
require 'rubygems/package/tar_writer'
-require 'minitest/mock'
class TestGemPackageTarWriter < Gem::Package::TarTestCase
def setup
@@ -117,7 +116,7 @@ class TestGemPackageTarWriter < Gem::Package::TarTestCase
end
def test_add_file_signer
- skip 'openssl is missing' unless Gem::HAVE_OPENSSL
+ pend 'openssl is missing' unless Gem::HAVE_OPENSSL
signer = Gem::Security::Signer.new PRIVATE_KEY, [PUBLIC_CERT]
@@ -150,13 +149,12 @@ class TestGemPackageTarWriter < Gem::Package::TarTestCase
signer = Gem::Security::Signer.new nil, nil
Time.stub :now, Time.at(1458518157) do
-
@tar_writer.add_file_signed 'x', 0644, signer do |io|
io.write 'a' * 10
end
assert_headers_equal(tar_file_header('x', '', 0644, 10, Time.now),
- @io.string[0, 512])
+ @io.string[0, 512])
end
assert_equal "aaaaaaaaaa#{"\0" * 502}", @io.string[512, 512]
@@ -170,11 +168,11 @@ class TestGemPackageTarWriter < Gem::Package::TarTestCase
end
assert_headers_equal(tar_file_header('x', '', 0644, 10, Time.now),
- @io.string[0, 512])
- end
+ @io.string[0, 512])
- assert_equal "aaaaaaaaaa#{"\0" * 502}", @io.string[512, 512]
- assert_equal 1024, @io.pos
+ assert_equal "aaaaaaaaaa#{"\0" * 502}", @io.string[512, 512]
+ assert_equal 1024, @io.pos
+ end
end
def test_add_file_simple_source_date_epoch
@@ -185,7 +183,7 @@ class TestGemPackageTarWriter < Gem::Package::TarTestCase
end
assert_headers_equal(tar_file_header('x', '', 0644, 10, Time.at(ENV["SOURCE_DATE_EPOCH"].to_i).utc),
- @io.string[0, 512])
+ @io.string[0, 512])
end
end
@@ -194,7 +192,7 @@ class TestGemPackageTarWriter < Gem::Package::TarTestCase
@tar_writer.add_file_simple 'x', 0, 100
assert_headers_equal tar_file_header('x', '', 0, 100, Time.now),
- @io.string[0, 512]
+ @io.string[0, 512]
end
assert_equal "\0" * 512, @io.string[512, 512]
@@ -209,7 +207,7 @@ class TestGemPackageTarWriter < Gem::Package::TarTestCase
end
def test_add_file_simple_size
- assert_raises Gem::Package::TarWriter::FileOverflow do
+ assert_raise Gem::Package::TarWriter::FileOverflow do
@tar_writer.add_file_simple("lib/foo/bar", 0, 10) do |io|
io.write "1" * 11
end
@@ -221,27 +219,27 @@ class TestGemPackageTarWriter < Gem::Package::TarTestCase
assert_equal "\0" * 1024, @io.string
- e = assert_raises IOError do
+ e = assert_raise IOError do
@tar_writer.close
end
assert_equal 'closed Gem::Package::TarWriter', e.message
- e = assert_raises IOError do
+ e = assert_raise IOError do
@tar_writer.flush
end
assert_equal 'closed Gem::Package::TarWriter', e.message
- e = assert_raises IOError do
+ e = assert_raise IOError do
@tar_writer.add_file 'x', 0
end
assert_equal 'closed Gem::Package::TarWriter', e.message
- e = assert_raises IOError do
+ e = assert_raise IOError do
@tar_writer.add_file_simple 'x', 0, 0
end
assert_equal 'closed Gem::Package::TarWriter', e.message
- e = assert_raises IOError do
+ e = assert_raise IOError do
@tar_writer.mkdir 'x', 0
end
assert_equal 'closed Gem::Package::TarWriter', e.message
@@ -297,7 +295,7 @@ class TestGemPackageTarWriter < Gem::Package::TarTestCase
assert_equal ['b' * 100, 'a'], @tar_writer.split_name(name)
name = File.join 'a', 'b' * 101
- exception = assert_raises Gem::Package::TooLongFileName do
+ exception = assert_raise Gem::Package::TooLongFileName do
@tar_writer.split_name name
end
assert_includes exception.message, name
@@ -305,7 +303,7 @@ class TestGemPackageTarWriter < Gem::Package::TarTestCase
# note, GNU tar 1.28 is unable to handle this case too,
# tested with "tar --format=ustar -cPf /tmp/foo.tartar -- /aaaaaa....a"
name = '/' + 'a' * 100
- exception = assert_raises Gem::Package::TooLongFileName do
+ exception = assert_raise Gem::Package::TooLongFileName do
@tar_writer.split_name name
end
assert_includes exception.message, name
@@ -316,7 +314,7 @@ class TestGemPackageTarWriter < Gem::Package::TarTestCase
assert_equal ['b', 'a' * 155], @tar_writer.split_name(name)
name = File.join 'a' * 156, 'b'
- exception = assert_raises Gem::Package::TooLongFileName do
+ exception = assert_raise Gem::Package::TooLongFileName do
@tar_writer.split_name name
end
assert_includes exception.message, name
@@ -324,7 +322,7 @@ class TestGemPackageTarWriter < Gem::Package::TarTestCase
def test_split_name_too_long_total
name = 'a' * 257
- exception = assert_raises Gem::Package::TooLongFileName do
+ exception = assert_raise Gem::Package::TooLongFileName do
@tar_writer.split_name name
end
assert_includes exception.message, name
diff --git a/test/rubygems/test_gem_package_task.rb b/test/rubygems/test_gem_package_task.rb
index ee9b8d44d4..6f217061d2 100644
--- a/test/rubygems/test_gem_package_task.rb
+++ b/test/rubygems/test_gem_package_task.rb
@@ -40,7 +40,7 @@ class TestGemPackageTask < Gem::TestCase
Rake.application['package'].invoke
- assert_path_exists 'pkg/pkgr-1.2.3.gem'
+ assert_path_exist 'pkg/pkgr-1.2.3.gem'
end
ensure
RakeFileUtils.verbose_flag = original_rake_fileutils_verbosity
@@ -56,7 +56,7 @@ class TestGemPackageTask < Gem::TestCase
g.summary = 'summary'
end
- _, err = capture_io do
+ _, err = capture_output do
Rake.application = Rake::Application.new
pkg = Gem::PackageTask.new(gem) do |p|
diff --git a/test/rubygems/test_gem_path_support.rb b/test/rubygems/test_gem_path_support.rb
index f24041a2d8..719aee52f6 100644
--- a/test/rubygems/test_gem_path_support.rb
+++ b/test/rubygems/test_gem_path_support.rb
@@ -130,7 +130,7 @@ class TestGemPathSupport < Gem::TestCase
begin
File.symlink(dir, symlink)
rescue NotImplementedError, SystemCallError
- skip 'symlinks not supported'
+ pend 'symlinks not supported'
end
not_existing = "#{@tempdir}/does_not_exist"
path = "#{symlink}#{File::PATH_SEPARATOR}#{not_existing}"
diff --git a/test/rubygems/test_gem_rdoc.rb b/test/rubygems/test_gem_rdoc.rb
index 13fd4ba40b..a8089bdb94 100644
--- a/test/rubygems/test_gem_rdoc.rb
+++ b/test/rubygems/test_gem_rdoc.rb
@@ -24,7 +24,7 @@ class TestGemRDoc < Gem::TestCase
begin
Gem::RDoc.load_rdoc
rescue Gem::DocumentError => e
- skip e.message
+ pend e.message
end
Gem.configuration[:rdoc] = nil
@@ -84,16 +84,16 @@ class TestGemRDoc < Gem::TestCase
refute @hook.rdoc_installed?
refute @hook.ri_installed?
- assert_path_exists @a.doc_dir
+ assert_path_exist @a.doc_dir
end
def test_remove_unwritable
- skip 'chmod not supported' if Gem.win_platform?
- skip 'skipped in root privilege' if Process.uid.zero?
+ pend 'chmod not supported' if Gem.win_platform?
+ pend 'skipped in root privilege' if Process.uid.zero?
FileUtils.mkdir_p @a.base_dir
FileUtils.chmod 0, @a.base_dir
- e = assert_raises Gem::FilePermissionError do
+ e = assert_raise Gem::FilePermissionError do
@hook.remove
end
@@ -113,16 +113,16 @@ class TestGemRDoc < Gem::TestCase
def test_setup
@hook.setup
- assert_path_exists @a.doc_dir
+ assert_path_exist @a.doc_dir
end
def test_setup_unwritable
- skip 'chmod not supported' if Gem.win_platform?
- skip 'skipped in root privilege' if Process.uid.zero?
+ pend 'chmod not supported' if Gem.win_platform?
+ pend 'skipped in root privilege' if Process.uid.zero?
FileUtils.mkdir_p @a.doc_dir
FileUtils.chmod 0, @a.doc_dir
- e = assert_raises Gem::FilePermissionError do
+ e = assert_raise Gem::FilePermissionError do
@hook.setup
end
diff --git a/test/rubygems/test_gem_remote_fetcher.rb b/test/rubygems/test_gem_remote_fetcher.rb
index b032f1613b..69f62b6ca4 100644
--- a/test/rubygems/test_gem_remote_fetcher.rb
+++ b/test/rubygems/test_gem_remote_fetcher.rb
@@ -10,7 +10,6 @@ end
require 'rubygems/remote_fetcher'
require 'rubygems/package'
-require 'minitest/mock'
# = Testing Proxy Settings
#
@@ -146,7 +145,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
fetcher = Gem::RemoteFetcher.new nil
@fetcher = fetcher
- e = assert_raises ArgumentError do
+ e = assert_raise ArgumentError do
@fetcher.fetch_path("gems.example.com/yaml", nil, true)
end
@@ -184,7 +183,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
assert_equal 'hello', data
- refute_path_exists path
+ assert_path_not_exist path
end
def util_fuck_with_fetcher(data, blow = false)
@@ -390,7 +389,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
def test_download_unsupported
inst = Gem::RemoteFetcher.fetcher
- e = assert_raises ArgumentError do
+ e = assert_raise ArgumentError do
inst.download @a1, 'ftp://gems.rubyforge.org'
end
@@ -451,7 +450,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
url = 'http://example.com/uri'
- e = assert_raises Gem::RemoteFetcher::FetchError do
+ e = assert_raise Gem::RemoteFetcher::FetchError do
fetcher.fetch_path url
end
@@ -469,7 +468,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
url = 'http://example.com/uri'
- e = assert_raises Gem::RemoteFetcher::FetchError do
+ e = assert_raise Gem::RemoteFetcher::FetchError do
fetcher.fetch_path url
end
@@ -487,7 +486,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
url = 'http://example.com/uri'
- e = assert_raises Gem::RemoteFetcher::FetchError do
+ e = assert_raise Gem::RemoteFetcher::FetchError do
fetcher.fetch_path url
end
@@ -506,7 +505,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
url = 'http://example.com/uri'
- e = assert_raises Gem::RemoteFetcher::FetchError do
+ e = assert_raise Gem::RemoteFetcher::FetchError do
fetcher.fetch_path url
end
@@ -525,7 +524,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
url = 'http://example.com/uri'
- e = assert_raises Gem::RemoteFetcher::FetchError do
+ e = assert_raise Gem::RemoteFetcher::FetchError do
fetcher.fetch_path url
end
@@ -544,7 +543,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
url = 'http://example.com/uri'
- e = assert_raises Gem::RemoteFetcher::FetchError do
+ e = assert_raise Gem::RemoteFetcher::FetchError do
fetcher.fetch_path url
end
@@ -634,7 +633,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
res
end
- e = assert_raises Gem::RemoteFetcher::FetchError do
+ e = assert_raise Gem::RemoteFetcher::FetchError do
fetcher.fetch_http URI.parse(url)
end
@@ -651,7 +650,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
res
end
- e = assert_raises Gem::RemoteFetcher::FetchError do
+ e = assert_raise Gem::RemoteFetcher::FetchError do
fetcher.fetch_http URI.parse(url)
end
@@ -836,7 +835,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
fetcher = Gem::RemoteFetcher.new nil
@fetcher = fetcher
- e = assert_raises Gem::RemoteFetcher::FetchError do
+ e = assert_raise Gem::RemoteFetcher::FetchError do
fetcher.fetch_s3 URI.parse(url)
end
@@ -952,7 +951,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
with_configured_fetcher(
":ssl_ca_cert: #{temp_ca_cert}\n" +
":ssl_client_cert: #{temp_client_cert}\n") do |fetcher|
- assert_raises Gem::RemoteFetcher::FetchError do
+ assert_raise Gem::RemoteFetcher::FetchError do
fetcher.fetch_path("https://localhost:#{ssl_server.config[:Port]}/yaml")
end
end
@@ -961,7 +960,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
def test_do_not_allow_insecure_ssl_connection_by_default
ssl_server = start_ssl_server
with_configured_fetcher do |fetcher|
- assert_raises Gem::RemoteFetcher::FetchError do
+ assert_raise Gem::RemoteFetcher::FetchError do
fetcher.fetch_path("https://localhost:#{ssl_server.config[:Port]}/yaml")
end
end
@@ -981,7 +980,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
"redirecting to non-https resource: #{@server_uri} (https://localhost:#{ssl_server.config[:Port]}/insecure_redirect?to=#{@server_uri})"
with_configured_fetcher(":ssl_ca_cert: #{temp_ca_cert}") do |fetcher|
- err = assert_raises Gem::RemoteFetcher::FetchError do
+ err = assert_raise Gem::RemoteFetcher::FetchError do
fetcher.fetch_path("https://localhost:#{ssl_server.config[:Port]}/insecure_redirect?to=#{@server_uri}")
end
@@ -994,7 +993,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
temp_ca_cert = nil
with_configured_fetcher(":ssl_ca_cert: #{temp_ca_cert}") do |fetcher|
- assert_raises Gem::RemoteFetcher::FetchError do
+ assert_raise Gem::RemoteFetcher::FetchError do
fetcher.fetch_path("https://localhost:#{ssl_server.config[:Port]}")
end
end
@@ -1084,7 +1083,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
end
def start_ssl_server(config = {})
- skip "starting this test server fails randomly on jruby" if Gem.java_platform?
+ pend "starting this test server fails randomly on jruby" if Gem.java_platform?
null_logger = NilLog.new
server = WEBrick::HTTPServer.new({
diff --git a/test/rubygems/test_gem_request.rb b/test/rubygems/test_gem_request.rb
index 47e5f97074..094d0aecf3 100644
--- a/test/rubygems/test_gem_request.rb
+++ b/test/rubygems/test_gem_request.rb
@@ -327,7 +327,7 @@ class TestGemRequest < Gem::TestCase
end
def test_verify_certificate
- skip if Gem.java_platform?
+ pend if Gem.java_platform?
store = OpenSSL::X509::Store.new
context = OpenSSL::X509::StoreContext.new store
context.error = OpenSSL::X509::V_ERR_OUT_OF_MEM
@@ -341,7 +341,7 @@ class TestGemRequest < Gem::TestCase
end
def test_verify_certificate_extra_message
- skip if Gem.java_platform?
+ pend if Gem.java_platform?
store = OpenSSL::X509::Store.new
context = OpenSSL::X509::StoreContext.new store
context.error = OpenSSL::X509::V_ERR_INVALID_CA
diff --git a/test/rubygems/test_gem_request_connection_pools.rb b/test/rubygems/test_gem_request_connection_pools.rb
index 2bd2d28469..a6ab002396 100644
--- a/test/rubygems/test_gem_request_connection_pools.rb
+++ b/test/rubygems/test_gem_request_connection_pools.rb
@@ -140,7 +140,7 @@ class TestGemRequestConnectionPool < Gem::TestCase
pool.checkout
Thread.new do
- assert_raises(Timeout::Error) do
+ assert_raise(Timeout::Error) do
Timeout.timeout(1) do
pool.checkout
end
diff --git a/test/rubygems/test_gem_request_set.rb b/test/rubygems/test_gem_request_set.rb
index 54ae7720c0..404e9b61aa 100644
--- a/test/rubygems/test_gem_request_set.rb
+++ b/test/rubygems/test_gem_request_set.rb
@@ -64,8 +64,8 @@ class TestGemRequestSet < Gem::TestCase
end
assert_includes installed, 'a-2'
- assert_path_exists File.join @gemhome, 'gems', 'a-2'
- assert_path_exists 'gem.deps.rb.lock'
+ assert_path_exist File.join @gemhome, 'gems', 'a-2'
+ assert_path_exist 'gem.deps.rb.lock'
assert rs.remote
refute done_installing_ran
@@ -87,9 +87,10 @@ Gems to install:
a-2
EXPECTED
- assert_output expected do
+ actual, _ = capture_output do
rs.install_from_gemdeps :gemdeps => io.path, :explain => true
end
+ assert_equal(expected, actual)
end
end
@@ -99,7 +100,7 @@ Gems to install:
end
util_clear_gems
- refute_path_exists File.join Gem.dir, 'gems', 'a-2'
+ assert_path_not_exist File.join Gem.dir, 'gems', 'a-2'
rs = Gem::RequestSet.new
installed = []
@@ -118,7 +119,7 @@ Gems to install:
end
assert_includes installed, 'a-2'
- refute_path_exists File.join Gem.dir, 'gems', 'a-2'
+ assert_path_not_exist File.join Gem.dir, 'gems', 'a-2'
end
def test_install_from_gemdeps_local
@@ -132,7 +133,7 @@ Gems to install:
io.puts 'gem "a"'
io.flush
- assert_raises Gem::UnsatisfiableDependencyError do
+ assert_raise Gem::UnsatisfiableDependencyError do
rs.install_from_gemdeps :gemdeps => io.path, :domain => :local
end
end
@@ -178,8 +179,8 @@ DEPENDENCIES
assert_includes installed, 'b-1'
assert_includes installed, 'a-1'
- assert_path_exists File.join @gemhome, 'specifications', 'a-1.gemspec'
- assert_path_exists 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
@@ -231,7 +232,7 @@ end
assert_includes installed, 'z-1.0.3'
- assert_path_exists 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
@@ -443,7 +444,7 @@ ruby "0"
set = StaticSet.new [a1, a2]
- assert_raises Gem::UnsatisfiableDependencyError do
+ assert_raise Gem::UnsatisfiableDependencyError do
rs.resolve set
end
end
@@ -524,8 +525,8 @@ ruby "0"
assert_equal %w[b-1 a-1],
installers.map {|installer| installer.spec.full_name }
- assert_path_exists File.join @gemhome, 'specifications', 'a-1.gemspec'
- assert_path_exists 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 }
@@ -547,8 +548,8 @@ ruby "0"
assert_equal @tempdir, ENV['GEM_HOME']
end
- assert_path_exists File.join @tempdir, 'specifications', 'a-1.gemspec'
- assert_path_exists 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
diff --git a/test/rubygems/test_gem_request_set_gem_dependency_api.rb b/test/rubygems/test_gem_request_set_gem_dependency_api.rb
index 2a9663959c..5891882119 100644
--- a/test/rubygems/test_gem_request_set_gem_dependency_api.rb
+++ b/test/rubygems/test_gem_request_set_gem_dependency_api.rb
@@ -81,7 +81,7 @@ class TestGemRequestSetGemDependencyAPI < Gem::TestCase
def test_gem_duplicate
@gda.gem 'a'
- _, err = capture_io do
+ _, err = capture_output do
@gda.gem 'a'
end
@@ -129,7 +129,7 @@ class TestGemRequestSetGemDependencyAPI < Gem::TestCase
end
def test_gem_git_branch
- _, err = capture_io do
+ _, err = capture_output do
@gda.gem 'a', :git => 'git/a', :branch => 'other', :tag => 'v1'
end
expected = "Gem dependencies file gem.deps.rb includes git reference for both ref/branch and tag but only ref/branch is used."
@@ -150,7 +150,7 @@ class TestGemRequestSetGemDependencyAPI < Gem::TestCase
end
def test_gem_git_ref
- _, err = capture_io do
+ _, err = capture_output do
@gda.gem 'a', :git => 'git/a', :ref => 'abcd123', :branch => 'other'
end
expected = "Gem dependencies file gem.deps.rb includes git reference for both ref and branch but only ref is used."
@@ -388,7 +388,7 @@ class TestGemRequestSetGemDependencyAPI < Gem::TestCase
end
def test_gem_platforms_unknown
- e = assert_raises ArgumentError do
+ e = assert_raise ArgumentError do
@gda.gem 'a', :platforms => :unknown
end
@@ -455,7 +455,7 @@ class TestGemRequestSetGemDependencyAPI < Gem::TestCase
gda = @GDA.new @set, nil
gda.gem name
- e = assert_raises ArgumentError do
+ e = assert_raise ArgumentError do
gda.gem name, :path => directory
end
@@ -466,7 +466,7 @@ class TestGemRequestSetGemDependencyAPI < Gem::TestCase
gda.instance_variable_set :@vendor_set, @vendor_set
gda.gem name, :path => directory
- e = assert_raises ArgumentError do
+ e = assert_raise ArgumentError do
gda.gem name
end
@@ -517,8 +517,8 @@ class TestGemRequestSetGemDependencyAPI < Gem::TestCase
def test_gemspec_bad
FileUtils.touch 'a.gemspec'
- e = assert_raises ArgumentError do
- capture_io do
+ e = assert_raise ArgumentError do
+ capture_output do
@gda.gemspec
end
end
@@ -550,7 +550,7 @@ class TestGemRequestSetGemDependencyAPI < Gem::TestCase
s.add_dependency 'c', 3
end
- e = assert_raises ArgumentError do
+ e = assert_raise ArgumentError do
@gda.gemspec
end
@@ -582,7 +582,7 @@ class TestGemRequestSetGemDependencyAPI < Gem::TestCase
end
def test_gemspec_none
- e = assert_raises ArgumentError do
+ e = assert_raise ArgumentError do
@gda.gemspec
end
@@ -658,14 +658,14 @@ end
gda.send :pin_gem_source, 'a'
gda.send :pin_gem_source, 'a'
- e = assert_raises ArgumentError do
+ e = assert_raise ArgumentError do
gda.send :pin_gem_source, 'a', :path, 'vendor/a'
end
assert_equal "duplicate source path: vendor/a for gem a",
e.message
- e = assert_raises ArgumentError do
+ e = assert_raise ArgumentError do
gda.send :pin_gem_source, 'a', :git, 'git://example/repo.git'
end
@@ -770,7 +770,7 @@ end
def test_ruby_engine_mismatch_engine
with_engine_version 'ruby', '2.0.0' do
- e = assert_raises Gem::RubyVersionMismatch do
+ e = assert_raise Gem::RubyVersionMismatch do
@gda.ruby RUBY_VERSION, :engine => 'jruby', :engine_version => '1.7.4'
end
@@ -781,7 +781,7 @@ end
def test_ruby_engine_mismatch_version
with_engine_version 'jruby', '1.7.6' do
- e = assert_raises Gem::RubyVersionMismatch do
+ e = assert_raise Gem::RubyVersionMismatch do
@gda.ruby RUBY_VERSION, :engine => 'jruby', :engine_version => '1.7.4'
end
@@ -791,7 +791,7 @@ end
end
def test_ruby_engine_no_engine_version
- e = assert_raises ArgumentError do
+ e = assert_raise ArgumentError do
@gda.ruby RUBY_VERSION, :engine => 'jruby'
end
@@ -800,7 +800,7 @@ end
end
def test_ruby_mismatch
- e = assert_raises Gem::RubyVersionMismatch do
+ e = assert_raise Gem::RubyVersionMismatch do
@gda.ruby '1.8.0'
end
diff --git a/test/rubygems/test_gem_request_set_lockfile.rb b/test/rubygems/test_gem_request_set_lockfile.rb
index 44a47f2e00..2ad743c5a1 100644
--- a/test/rubygems/test_gem_request_set_lockfile.rb
+++ b/test/rubygems/test_gem_request_set_lockfile.rb
@@ -443,7 +443,7 @@ DEPENDENCIES
gem_deps_lock_file = "#{@gem_deps_file}.lock"
- assert_path_exists gem_deps_lock_file
+ assert_path_exist gem_deps_lock_file
refute_empty File.read gem_deps_lock_file
end
@@ -457,11 +457,11 @@ DEPENDENCIES
io.write 'hello'
end
- assert_raises Gem::UnsatisfiableDependencyError do
+ assert_raise Gem::UnsatisfiableDependencyError do
lockfile.write
end
- assert_path_exists gem_deps_lock_file
+ assert_path_exist gem_deps_lock_file
assert_equal 'hello', File.read(gem_deps_lock_file)
end
diff --git a/test/rubygems/test_gem_request_set_lockfile_parser.rb b/test/rubygems/test_gem_request_set_lockfile_parser.rb
index 9a42d81d0e..2954df70d8 100644
--- a/test/rubygems/test_gem_request_set_lockfile_parser.rb
+++ b/test/rubygems/test_gem_request_set_lockfile_parser.rb
@@ -25,7 +25,7 @@ class TestGemRequestSetLockfileParser < Gem::TestCase
tokenizer = Gem::RequestSet::Lockfile::Tokenizer.new "foo", filename, 1, 0
parser = tokenizer.make_parser nil, nil
- e = assert_raises Gem::RequestSet::Lockfile::ParseError do
+ e = assert_raise Gem::RequestSet::Lockfile::ParseError do
parser.get :section
end
@@ -52,7 +52,7 @@ class TestGemRequestSetLockfileParser < Gem::TestCase
tokenizer = Gem::RequestSet::Lockfile::Tokenizer.new "x", filename, 1
parser = tokenizer.make_parser nil, nil
- e = assert_raises Gem::RequestSet::Lockfile::ParseError do
+ e = assert_raise Gem::RequestSet::Lockfile::ParseError do
parser.get :text, 'y'
end
@@ -518,7 +518,7 @@ DEPENDENCIES
end
def test_parse_missing
- assert_raises(Errno::ENOENT) do
+ assert_raise(Errno::ENOENT) do
parse_lockfile @set, []
end
diff --git a/test/rubygems/test_gem_request_set_lockfile_tokenizer.rb b/test/rubygems/test_gem_request_set_lockfile_tokenizer.rb
index b485b2c0b7..a81ecac7b7 100644
--- a/test/rubygems/test_gem_request_set_lockfile_tokenizer.rb
+++ b/test/rubygems/test_gem_request_set_lockfile_tokenizer.rb
@@ -193,7 +193,7 @@ DEPENDENCIES
def test_tokenize_conflict_markers
write_lockfile '<<<<<<<'
- e = assert_raises Gem::RequestSet::Lockfile::ParseError do
+ e = assert_raise Gem::RequestSet::Lockfile::ParseError do
tokenize_lockfile
end
@@ -202,7 +202,7 @@ DEPENDENCIES
write_lockfile '|||||||'
- e = assert_raises Gem::RequestSet::Lockfile::ParseError do
+ e = assert_raise Gem::RequestSet::Lockfile::ParseError do
tokenize_lockfile
end
@@ -211,7 +211,7 @@ DEPENDENCIES
write_lockfile '======='
- e = assert_raises Gem::RequestSet::Lockfile::ParseError do
+ e = assert_raise Gem::RequestSet::Lockfile::ParseError do
tokenize_lockfile
end
@@ -220,7 +220,7 @@ DEPENDENCIES
write_lockfile '>>>>>>>'
- e = assert_raises Gem::RequestSet::Lockfile::ParseError do
+ e = assert_raise Gem::RequestSet::Lockfile::ParseError do
tokenize_lockfile
end
diff --git a/test/rubygems/test_gem_requirement.rb b/test/rubygems/test_gem_requirement.rb
index aa4c57ac27..f7cdbab92e 100644
--- a/test/rubygems/test_gem_requirement.rb
+++ b/test/rubygems/test_gem_requirement.rb
@@ -97,7 +97,7 @@ class TestGemRequirement < Gem::TestCase
'= junk',
'1..2',
].each do |bad|
- e = assert_raises Gem::Requirement::BadRequirementError do
+ e = assert_raise Gem::Requirement::BadRequirementError do
Gem::Requirement.parse bad
end
@@ -128,7 +128,7 @@ class TestGemRequirement < Gem::TestCase
refute_satisfied_by "1.2", r
assert_satisfied_by "1.3", r
- assert_raises ArgumentError do
+ assert_raise ArgumentError do
assert_satisfied_by nil, r
end
end
@@ -140,7 +140,7 @@ class TestGemRequirement < Gem::TestCase
assert_satisfied_by "1.2", r
refute_satisfied_by "1.3", r
- assert_raises ArgumentError do
+ assert_raise ArgumentError do
assert_satisfied_by nil, r
end
end
@@ -152,7 +152,7 @@ class TestGemRequirement < Gem::TestCase
assert_satisfied_by "1.2", r
refute_satisfied_by "1.3", r
- assert_raises ArgumentError do
+ assert_raise ArgumentError do
assert_satisfied_by nil, r
end
end
@@ -164,7 +164,7 @@ class TestGemRequirement < Gem::TestCase
refute_satisfied_by "1.2", r
assert_satisfied_by "1.3", r
- assert_raises ArgumentError do
+ assert_raise ArgumentError do
r.satisfied_by? nil
end
end
@@ -176,7 +176,7 @@ class TestGemRequirement < Gem::TestCase
assert_satisfied_by "1.2", r
assert_satisfied_by "1.3", r
- assert_raises ArgumentError do
+ assert_raise ArgumentError do
r.satisfied_by? nil
end
end
@@ -188,7 +188,7 @@ class TestGemRequirement < Gem::TestCase
assert_satisfied_by "1.2", r
refute_satisfied_by "1.3", r
- assert_raises ArgumentError do
+ assert_raise ArgumentError do
r.satisfied_by? nil
end
end
@@ -200,7 +200,7 @@ class TestGemRequirement < Gem::TestCase
refute_satisfied_by "1.2", r
refute_satisfied_by "1.3", r
- assert_raises ArgumentError do
+ assert_raise ArgumentError do
r.satisfied_by? nil
end
end
@@ -212,7 +212,7 @@ class TestGemRequirement < Gem::TestCase
assert_satisfied_by "1.2", r
refute_satisfied_by "1.3", r
- assert_raises ArgumentError do
+ assert_raise ArgumentError do
r.satisfied_by? nil
end
end
@@ -224,7 +224,7 @@ class TestGemRequirement < Gem::TestCase
assert_satisfied_by "1.2", r
assert_satisfied_by "1.3", r
- assert_raises ArgumentError do
+ assert_raise ArgumentError do
r.satisfied_by? nil
end
end
@@ -282,18 +282,18 @@ class TestGemRequirement < Gem::TestCase
def test_illformed_requirements
[ ">>> 1.3.5", "> blah" ].each do |rq|
- assert_raises Gem::Requirement::BadRequirementError, "req [#{rq}] should fail" do
+ assert_raise Gem::Requirement::BadRequirementError, "req [#{rq}] should fail" do
Gem::Requirement.new rq
end
end
end
def test_satisfied_by_eh_non_versions
- assert_raises ArgumentError do
+ assert_raise ArgumentError do
req(">= 0").satisfied_by? Object.new
end
- assert_raises ArgumentError do
+ assert_raise ArgumentError do
req(">= 0").satisfied_by? Gem::Requirement.default
end
end
diff --git a/test/rubygems/test_gem_resolver.rb b/test/rubygems/test_gem_resolver.rb
index 09feeac55b..fbf9438122 100644
--- a/test/rubygems/test_gem_resolver.rb
+++ b/test/rubygems/test_gem_resolver.rb
@@ -76,7 +76,7 @@ class TestGemResolver < Gem::TestCase
assert_same index_set, composed
- e = assert_raises ArgumentError do
+ e = assert_raise ArgumentError do
@DR.compose_sets nil
end
@@ -266,7 +266,7 @@ class TestGemResolver < Gem::TestCase
res = Gem::Resolver.new [a_dep], Gem::Resolver::IndexSet.new
- e = assert_raises Gem::UnsatisfiableDepedencyError do
+ e = assert_raise Gem::UnsatisfiableDepedencyError do
res.resolve
end
@@ -445,7 +445,7 @@ class TestGemResolver < Gem::TestCase
r = Gem::Resolver.new([ad, bd], s)
- e = assert_raises Gem::DependencyResolutionError do
+ e = assert_raise Gem::DependencyResolutionError do
r.resolve
end
@@ -469,7 +469,7 @@ class TestGemResolver < Gem::TestCase
r = Gem::Resolver.new([ad], set)
- e = assert_raises Gem::UnsatisfiableDepedencyError do
+ e = assert_raise Gem::UnsatisfiableDepedencyError do
r.resolve
end
@@ -486,7 +486,7 @@ class TestGemResolver < Gem::TestCase
r = Gem::Resolver.new([ad], set(a1))
- e = assert_raises Gem::UnsatisfiableDepedencyError do
+ e = assert_raise Gem::UnsatisfiableDepedencyError do
r.resolve
end
@@ -499,7 +499,7 @@ class TestGemResolver < Gem::TestCase
r = Gem::Resolver.new([ad], set(a1))
- e = assert_raises Gem::UnsatisfiableDepedencyError do
+ e = assert_raise Gem::UnsatisfiableDepedencyError do
r.resolve
end
@@ -516,7 +516,7 @@ class TestGemResolver < Gem::TestCase
r = Gem::Resolver.new([ad], set(a1))
- e = assert_raises Gem::UnsatisfiableDepedencyError do
+ e = assert_raise Gem::UnsatisfiableDepedencyError do
r.resolve
end
@@ -539,7 +539,7 @@ class TestGemResolver < Gem::TestCase
r = Gem::Resolver.new([ad, bd], s)
- e = assert_raises Gem::DependencyResolutionError do
+ e = assert_raise Gem::DependencyResolutionError do
r.resolve
end
@@ -611,7 +611,7 @@ class TestGemResolver < Gem::TestCase
r = Gem::Resolver.new([d1, d2, d3], s)
- assert_raises Gem::DependencyResolutionError do
+ assert_raise Gem::DependencyResolutionError do
r.resolve
end
end
@@ -629,7 +629,7 @@ class TestGemResolver < Gem::TestCase
r = Gem::Resolver.new [a_dep, b_dep], s
- assert_raises Gem::DependencyResolutionError do
+ assert_raise Gem::DependencyResolutionError do
r.resolve
end
end
@@ -781,7 +781,7 @@ class TestGemResolver < Gem::TestCase
r = Gem::Resolver.new([ad], set(a1))
- e = assert_raises Gem::UnsatisfiableDepedencyError do
+ e = assert_raise Gem::UnsatisfiableDepedencyError do
r.resolve
end
diff --git a/test/rubygems/test_gem_resolver_best_set.rb b/test/rubygems/test_gem_resolver_best_set.rb
index 019ca70499..df6b438763 100644
--- a/test/rubygems/test_gem_resolver_best_set.rb
+++ b/test/rubygems/test_gem_resolver_best_set.rb
@@ -126,7 +126,7 @@ class TestGemResolverBestSet < Gem::TestCase
error = Gem::RemoteFetcher::FetchError.new 'bogus', @gem_repo
- e = assert_raises Gem::RemoteFetcher::FetchError do
+ e = assert_raise Gem::RemoteFetcher::FetchError do
set.replace_failed_api_set error
end
diff --git a/test/rubygems/test_gem_resolver_git_set.rb b/test/rubygems/test_gem_resolver_git_set.rb
index 6d048b3772..7b0efa0680 100644
--- a/test/rubygems/test_gem_resolver_git_set.rb
+++ b/test/rubygems/test_gem_resolver_git_set.rb
@@ -51,7 +51,7 @@ class TestGemResolverGitSet < Gem::TestCase
assert @set.need_submodules[repository]
- refute_path_exists spec.source.repo_cache_dir
+ assert_path_not_exist spec.source.repo_cache_dir
end
def test_find_all
diff --git a/test/rubygems/test_gem_resolver_git_specification.rb b/test/rubygems/test_gem_resolver_git_specification.rb
index 4283e02765..25e93bb7d5 100644
--- a/test/rubygems/test_gem_resolver_git_specification.rb
+++ b/test/rubygems/test_gem_resolver_git_specification.rb
@@ -62,7 +62,7 @@ class TestGemResolverGitSpecification < Gem::TestCase
# functional test for Gem::Ext::Builder
def test_install_extension
- skip if Gem.java_platform?
+ pend if Gem.java_platform?
name, _, repository, = git_gem 'a', 1 do |s|
s.extensions << 'ext/extconf.rb'
end
@@ -91,7 +91,7 @@ class TestGemResolverGitSpecification < Gem::TestCase
git_spec.install({})
- assert_path_exists File.join git_spec.spec.extension_dir, 'b.rb'
+ assert_path_exist File.join git_spec.spec.extension_dir, 'b.rb'
end
def test_install_installed
diff --git a/test/rubygems/test_gem_resolver_index_specification.rb b/test/rubygems/test_gem_resolver_index_specification.rb
index 702d26777b..382f95c004 100644
--- a/test/rubygems/test_gem_resolver_index_specification.rb
+++ b/test/rubygems/test_gem_resolver_index_specification.rb
@@ -46,7 +46,7 @@ class TestGemResolverIndexSpecification < Gem::TestCase
called = installer
end
- assert_path_exists File.join @gemhome, 'specifications', 'a-2.gemspec'
+ assert_path_exist File.join @gemhome, 'specifications', 'a-2.gemspec'
assert_kind_of Gem::Installer, called
end
diff --git a/test/rubygems/test_gem_resolver_installer_set.rb b/test/rubygems/test_gem_resolver_installer_set.rb
index 76c9c04a3c..d45a527d2f 100644
--- a/test/rubygems/test_gem_resolver_installer_set.rb
+++ b/test/rubygems/test_gem_resolver_installer_set.rb
@@ -16,7 +16,7 @@ class TestGemResolverInstallerSet < Gem::TestCase
assert_equal %w[a-2], set.always_install.map {|s| s.full_name }
- e = assert_raises Gem::UnsatisfiableDependencyError do
+ e = assert_raise Gem::UnsatisfiableDependencyError do
set.add_always_install dep('b')
end
@@ -29,7 +29,7 @@ class TestGemResolverInstallerSet < Gem::TestCase
set = Gem::Resolver::InstallerSet.new :both
- e = assert_raises Gem::UnsatisfiableDependencyError do
+ e = assert_raise Gem::UnsatisfiableDependencyError do
set.add_always_install dep 'a'
end
@@ -71,7 +71,7 @@ class TestGemResolverInstallerSet < Gem::TestCase
set = Gem::Resolver::InstallerSet.new :both
- assert_raises Gem::UnsatisfiableDependencyError do
+ assert_raise Gem::UnsatisfiableDependencyError do
set.add_always_install dep('a')
end
end
@@ -192,7 +192,7 @@ class TestGemResolverInstallerSet < Gem::TestCase
def (set.remote_set).prefetch(_)
raise "called"
end
- assert_raises(RuntimeError){ set.prefetch(nil) }
+ assert_raise(RuntimeError){ set.prefetch(nil) }
set = Gem::Resolver::InstallerSet.new :local
def (set.remote_set).prefetch(_)
diff --git a/test/rubygems/test_gem_resolver_local_specification.rb b/test/rubygems/test_gem_resolver_local_specification.rb
index 0dcc436b29..67b8f34cc1 100644
--- a/test/rubygems/test_gem_resolver_local_specification.rb
+++ b/test/rubygems/test_gem_resolver_local_specification.rb
@@ -24,7 +24,7 @@ class TestGemResolverLocalSpecification < Gem::TestCase
called = installer
end
- assert_path_exists File.join @gemhome, 'specifications', 'a-2.gemspec'
+ assert_path_exist File.join @gemhome, 'specifications', 'a-2.gemspec'
assert_kind_of Gem::Installer, called
end
diff --git a/test/rubygems/test_gem_resolver_specification.rb b/test/rubygems/test_gem_resolver_specification.rb
index e395c473ab..8b50bf91bd 100644
--- a/test/rubygems/test_gem_resolver_specification.rb
+++ b/test/rubygems/test_gem_resolver_specification.rb
@@ -26,7 +26,7 @@ class TestGemResolverSpecification < Gem::TestCase
a_spec.install :install_dir => gemhome
- assert_path_exists File.join gemhome, 'gems', a.full_name
+ assert_path_exist File.join gemhome, 'gems', a.full_name
expected = File.join gemhome, 'specifications', a.spec_name
diff --git a/test/rubygems/test_gem_resolver_vendor_set.rb b/test/rubygems/test_gem_resolver_vendor_set.rb
index d14b877b45..19cc7383c6 100644
--- a/test/rubygems/test_gem_resolver_vendor_set.rb
+++ b/test/rubygems/test_gem_resolver_vendor_set.rb
@@ -27,7 +27,7 @@ class TestGemResolverVendorSet < Gem::TestCase
FileUtils.rm_r directory
- e = assert_raises Gem::GemNotFoundException do
+ e = assert_raise Gem::GemNotFoundException do
@set.add_vendor_gem name, directory
end
@@ -74,7 +74,7 @@ class TestGemResolverVendorSet < Gem::TestCase
def test_load_spec
error = Object.const_defined?(:KeyError) ? KeyError : IndexError
- assert_raises error do
+ assert_raise error do
@set.load_spec 'b', v(1), Gem::Platform::RUBY, nil
end
end
diff --git a/test/rubygems/test_gem_security.rb b/test/rubygems/test_gem_security.rb
index 92f9e55b21..0badb96763 100644
--- a/test/rubygems/test_gem_security.rb
+++ b/test/rubygems/test_gem_security.rb
@@ -135,7 +135,7 @@ class TestGemSecurity < Gem::TestCase
end
def test_class_re_sign_not_self_signed
- e = assert_raises Gem::Security::Exception do
+ e = assert_raise Gem::Security::Exception do
Gem::Security.re_sign CHILD_CERT, CHILD_KEY
end
@@ -149,7 +149,7 @@ class TestGemSecurity < Gem::TestCase
end
def test_class_re_sign_wrong_key
- e = assert_raises Gem::Security::Exception do
+ e = assert_raise Gem::Security::Exception do
Gem::Security.re_sign ALTERNATE_CERT, PRIVATE_KEY
end
@@ -265,7 +265,7 @@ class TestGemSecurity < Gem::TestCase
@SEC.write key, path
- assert_path_exists path
+ assert_path_exist path
key_from_file = File.read path
@@ -281,7 +281,7 @@ class TestGemSecurity < Gem::TestCase
@SEC.write key, path, 0600, passphrase
- assert_path_exists path
+ assert_path_exist path
key_from_file = OpenSSL::PKey::RSA.new File.read(path), passphrase
@@ -299,7 +299,7 @@ class TestGemSecurity < Gem::TestCase
@SEC.write key, path, 0600, passphrase, cipher
- assert_path_exists path
+ assert_path_exist path
key_file_contents = File.read(path)
diff --git a/test/rubygems/test_gem_security_policy.rb b/test/rubygems/test_gem_security_policy.rb
index 85e4590655..a85791c918 100644
--- a/test/rubygems/test_gem_security_policy.rb
+++ b/test/rubygems/test_gem_security_policy.rb
@@ -77,7 +77,7 @@ class TestGemSecurityPolicy < Gem::TestCase
invalid = digest 'hello!'
- e = assert_raises Gem::Security::Exception do
+ e = assert_raise Gem::Security::Exception do
@almost_no.check_data PUBLIC_KEY, @digest, signature, invalid
end
@@ -91,7 +91,7 @@ class TestGemSecurityPolicy < Gem::TestCase
end
def test_check_chain_empty_chain
- e = assert_raises Gem::Security::Exception do
+ e = assert_raise Gem::Security::Exception do
@chain.check_chain [], Time.now
end
@@ -101,7 +101,7 @@ class TestGemSecurityPolicy < Gem::TestCase
def test_check_chain_invalid
chain = [PUBLIC_CERT, CHILD_CERT, INVALIDCHILD_CERT]
- e = assert_raises Gem::Security::Exception do
+ e = assert_raise Gem::Security::Exception do
@chain.check_chain chain, Time.now
end
@@ -111,7 +111,7 @@ class TestGemSecurityPolicy < Gem::TestCase
end
def test_check_chain_no_chain
- e = assert_raises Gem::Security::Exception do
+ e = assert_raise Gem::Security::Exception do
@chain.check_chain nil, Time.now
end
@@ -123,7 +123,7 @@ class TestGemSecurityPolicy < Gem::TestCase
end
def test_check_cert_expired
- e = assert_raises Gem::Security::Exception do
+ e = assert_raise Gem::Security::Exception do
@low.check_cert EXPIRED_CERT, nil, Time.now
end
@@ -133,7 +133,7 @@ class TestGemSecurityPolicy < Gem::TestCase
end
def test_check_cert_future
- e = assert_raises Gem::Security::Exception do
+ e = assert_raise Gem::Security::Exception do
@low.check_cert FUTURE_CERT, nil, Time.now
end
@@ -143,7 +143,7 @@ class TestGemSecurityPolicy < Gem::TestCase
end
def test_check_cert_invalid_issuer
- e = assert_raises Gem::Security::Exception do
+ e = assert_raise Gem::Security::Exception do
@low.check_cert INVALID_ISSUER_CERT, PUBLIC_CERT, Time.now
end
@@ -157,7 +157,7 @@ class TestGemSecurityPolicy < Gem::TestCase
end
def test_check_cert_no_signer
- e = assert_raises Gem::Security::Exception do
+ e = assert_raise Gem::Security::Exception do
@high.check_cert(nil, nil, Time.now)
end
@@ -171,7 +171,7 @@ class TestGemSecurityPolicy < Gem::TestCase
def test_check_key_no_signer
assert @almost_no.check_key(nil, nil)
- e = assert_raises Gem::Security::Exception do
+ e = assert_raise Gem::Security::Exception do
@high.check_key(nil, nil)
end
@@ -179,7 +179,7 @@ class TestGemSecurityPolicy < Gem::TestCase
end
def test_check_key_wrong_key
- e = assert_raises Gem::Security::Exception do
+ e = assert_raise Gem::Security::Exception do
@almost_no.check_key(PUBLIC_CERT, ALTERNATE_KEY)
end
@@ -194,7 +194,7 @@ class TestGemSecurityPolicy < Gem::TestCase
end
def test_check_root_empty_chain
- e = assert_raises Gem::Security::Exception do
+ e = assert_raise Gem::Security::Exception do
@chain.check_root [], Time.now
end
@@ -204,7 +204,7 @@ class TestGemSecurityPolicy < Gem::TestCase
def test_check_root_invalid_signer
chain = [INVALID_SIGNER_CERT]
- e = assert_raises Gem::Security::Exception do
+ e = assert_raise Gem::Security::Exception do
@chain.check_root chain, Time.now
end
@@ -216,7 +216,7 @@ class TestGemSecurityPolicy < Gem::TestCase
def test_check_root_not_self_signed
chain = [INVALID_ISSUER_CERT]
- e = assert_raises Gem::Security::Exception do
+ e = assert_raise Gem::Security::Exception do
@chain.check_root chain, Time.now
end
@@ -226,7 +226,7 @@ class TestGemSecurityPolicy < Gem::TestCase
end
def test_check_root_no_chain
- e = assert_raises Gem::Security::Exception do
+ e = assert_raise Gem::Security::Exception do
@chain.check_root nil, Time.now
end
@@ -246,7 +246,7 @@ class TestGemSecurityPolicy < Gem::TestCase
end
def test_check_trust_empty_chain
- e = assert_raises Gem::Security::Exception do
+ e = assert_raise Gem::Security::Exception do
@chain.check_trust [], @digest, @trust_dir
end
@@ -256,7 +256,7 @@ class TestGemSecurityPolicy < Gem::TestCase
def test_check_trust_mismatch
Gem::Security.trust_dir.trust_cert PUBLIC_CERT
- e = assert_raises Gem::Security::Exception do
+ e = assert_raise Gem::Security::Exception do
@high.check_trust [WRONG_KEY_CERT], @digest, @trust_dir
end
@@ -265,7 +265,7 @@ class TestGemSecurityPolicy < Gem::TestCase
end
def test_check_trust_no_chain
- e = assert_raises Gem::Security::Exception do
+ e = assert_raise Gem::Security::Exception do
@chain.check_trust nil, @digest, @trust_dir
end
@@ -273,7 +273,7 @@ class TestGemSecurityPolicy < Gem::TestCase
end
def test_check_trust_no_trust
- e = assert_raises Gem::Security::Exception do
+ e = assert_raise Gem::Security::Exception do
@high.check_trust [PUBLIC_CERT], @digest, @trust_dir
end
@@ -281,7 +281,7 @@ class TestGemSecurityPolicy < Gem::TestCase
end
def test_check_trust_no_trust_child
- e = assert_raises Gem::Security::Exception do
+ e = assert_raise Gem::Security::Exception do
@high.check_trust [PUBLIC_CERT, CHILD_CERT], @digest, @trust_dir
end
@@ -315,7 +315,7 @@ class TestGemSecurityPolicy < Gem::TestCase
_, signatures = dummy_signatures
- e = assert_raises Gem::Security::Exception do
+ e = assert_raise Gem::Security::Exception do
@almost_no.verify [PUBLIC_CERT], nil, {}, signatures
end
@@ -327,7 +327,7 @@ class TestGemSecurityPolicy < Gem::TestCase
_, signatures = dummy_signatures
- e = assert_raises Gem::Security::Exception do
+ e = assert_raise Gem::Security::Exception do
@no.verify [PUBLIC_CERT], nil, {}, signatures
end
@@ -345,7 +345,7 @@ class TestGemSecurityPolicy < Gem::TestCase
assert_match "WARNING: some_gem is not signed\n", @ui.error
- assert_raises Gem::Security::Exception do
+ assert_raise Gem::Security::Exception do
@high.verify [PUBLIC_CERT], nil, digests, {}
end
end
@@ -370,7 +370,7 @@ class TestGemSecurityPolicy < Gem::TestCase
signatures[1] = PRIVATE_KEY.sign @digest.new, data.digest
- e = assert_raises Gem::Security::Exception do
+ e = assert_raise Gem::Security::Exception do
@almost_no.verify [PUBLIC_CERT], nil, digests, signatures
end
@@ -387,7 +387,7 @@ class TestGemSecurityPolicy < Gem::TestCase
assert_equal "WARNING: email:nobody@example is not trusted for some_gem\n",
@ui.error
- assert_raises Gem::Security::Exception do
+ assert_raise Gem::Security::Exception do
@medium.verify [PUBLIC_CERT], nil, digests, signatures
end
end
@@ -402,7 +402,7 @@ class TestGemSecurityPolicy < Gem::TestCase
signature = PRIVATE_KEY.sign 'sha512', data.digest
signatures = { 0 => signature }
- e = assert_raises Gem::Security::Exception do
+ e = assert_raise Gem::Security::Exception do
@almost_no.verify [PUBLIC_CERT], nil, digests, signatures
end
@@ -486,7 +486,7 @@ class TestGemSecurityPolicy < Gem::TestCase
signatures['metadata.gz'] =
PRIVATE_KEY.sign @digest.new, metadata_gz_digest.digest
- e = assert_raises Gem::Security::Exception do
+ e = assert_raise Gem::Security::Exception do
@high.verify_signatures @spec, digests, signatures
end
@@ -509,7 +509,7 @@ class TestGemSecurityPolicy < Gem::TestCase
digests = package.digest s
digests[Gem::Security::DIGEST_NAME]['data.tar.gz'] = @digest.hexdigest 'hello'
- assert_raises Gem::Security::Exception do
+ assert_raise Gem::Security::Exception do
@high.verify_signatures @spec, digests, {}
end
end
diff --git a/test/rubygems/test_gem_security_signer.rb b/test/rubygems/test_gem_security_signer.rb
index 8a09f97f26..9a369a2518 100644
--- a/test/rubygems/test_gem_security_signer.rb
+++ b/test/rubygems/test_gem_security_signer.rb
@@ -41,7 +41,7 @@ class TestGemSecuritySigner < Gem::TestCase
end
def test_initialize_cert_chain_invalid
- assert_raises OpenSSL::X509::CertificateError do
+ assert_raise OpenSSL::X509::CertificateError do
Gem::Security::Signer.new nil, ['garbage']
end
end
@@ -134,7 +134,7 @@ toqvglr0kdbknSRRjBVLK6tsgr07aLT9gNP7mTW2PA==
def test_sign_expired
signer = Gem::Security::Signer.new PRIVATE_KEY, [EXPIRED_CERT]
- e = assert_raises Gem::Security::Exception do
+ e = assert_raise Gem::Security::Exception do
signer.sign 'hello'
end
@@ -142,7 +142,7 @@ toqvglr0kdbknSRRjBVLK6tsgr07aLT9gNP7mTW2PA==
end
def test_sign_expired_auto_update
- skip if Gem.java_platform?
+ pend if Gem.java_platform?
FileUtils.mkdir_p File.join(Gem.user_home, '.gem'), :mode => 0700
private_key_path = File.join(Gem.user_home, '.gem', 'gem-private_key.pem')
@@ -165,7 +165,7 @@ toqvglr0kdbknSRRjBVLK6tsgr07aLT9gNP7mTW2PA==
expired_path =
File.join Gem.user_home, '.gem', "gem-public_cert.pem.expired.#{expiry}"
- assert_path_exists expired_path
+ assert_path_exist expired_path
assert_equal EXPIRED_CERT.to_pem, File.read(expired_path)
end
@@ -186,7 +186,7 @@ toqvglr0kdbknSRRjBVLK6tsgr07aLT9gNP7mTW2PA==
signer = Gem::Security::Signer.new PRIVATE_KEY, [EXPIRED_CERT]
- e = assert_raises Gem::Security::Exception do
+ e = assert_raise Gem::Security::Exception do
signer.sign 'hello'
end
@@ -202,7 +202,7 @@ toqvglr0kdbknSRRjBVLK6tsgr07aLT9gNP7mTW2PA==
def test_sign_wrong_key
signer = Gem::Security::Signer.new ALTERNATE_KEY, [PUBLIC_CERT]
- assert_raises Gem::Security::Exception do
+ assert_raise Gem::Security::Exception do
signer.sign 'hello'
end
end
@@ -210,7 +210,7 @@ toqvglr0kdbknSRRjBVLK6tsgr07aLT9gNP7mTW2PA==
def test_sign_no_certs
signer = Gem::Security::Signer.new ALTERNATE_KEY, []
- assert_raises Gem::Security::Exception do
+ assert_raise Gem::Security::Exception do
signer.sign 'hello'
end
end
diff --git a/test/rubygems/test_gem_security_trust_dir.rb b/test/rubygems/test_gem_security_trust_dir.rb
index 201de9d36b..6dc0997eaf 100644
--- a/test/rubygems/test_gem_security_trust_dir.rb
+++ b/test/rubygems/test_gem_security_trust_dir.rb
@@ -53,7 +53,7 @@ class TestGemSecurityTrustDir < Gem::TestCase
trusted = @trust_dir.cert_path PUBLIC_CERT
- assert_path_exists trusted
+ assert_path_exist trusted
mask = 0100600 & (~File.umask)
@@ -63,11 +63,11 @@ class TestGemSecurityTrustDir < Gem::TestCase
end
def test_verify
- refute_path_exists @dest_dir
+ assert_path_not_exist @dest_dir
@trust_dir.verify
- assert_path_exists @dest_dir
+ assert_path_exist @dest_dir
mask = 040700 & (~File.umask)
mask |= 0200000 if /aix/ =~ RUBY_PLATFORM
@@ -78,7 +78,7 @@ class TestGemSecurityTrustDir < Gem::TestCase
def test_verify_file
FileUtils.touch @dest_dir
- e = assert_raises Gem::Security::Exception do
+ e = assert_raise Gem::Security::Exception do
@trust_dir.verify
end
diff --git a/test/rubygems/test_gem_server.rb b/test/rubygems/test_gem_server.rb
index 0e283da5a4..7a69429a98 100644
--- a/test/rubygems/test_gem_server.rb
+++ b/test/rubygems/test_gem_server.rb
@@ -133,7 +133,7 @@ class TestGemServer < Gem::TestCase
def test_listen
util_listen
- capture_io do
+ capture_output do
@server.listen
end
@@ -143,7 +143,7 @@ class TestGemServer < Gem::TestCase
def test_listen_addresses
util_listen
- capture_io do
+ capture_output do
@server.listen %w[a b]
end
diff --git a/test/rubygems/test_gem_silent_ui.rb b/test/rubygems/test_gem_silent_ui.rb
index 3c4811aad5..0d46ab592a 100644
--- a/test/rubygems/test_gem_silent_ui.rb
+++ b/test/rubygems/test_gem_silent_ui.rb
@@ -16,7 +16,7 @@ class TestGemSilentUI < Gem::TestCase
def test_ask
value = nil
- out, err = capture_io do
+ out, err = capture_output do
use_ui @sui do
value = @sui.ask 'Problem?'
end
@@ -30,7 +30,7 @@ class TestGemSilentUI < Gem::TestCase
def test_ask_for_password
value = nil
- out, err = capture_io do
+ out, err = capture_output do
use_ui @sui do
value = @sui.ask_for_password 'Problem?'
end
@@ -44,9 +44,9 @@ class TestGemSilentUI < Gem::TestCase
def test_ask_yes_no
value = nil
- out, err = capture_io do
+ out, err = capture_output do
use_ui @sui do
- assert_raises(Gem::OperationNotSupportedError) do
+ assert_raise(Gem::OperationNotSupportedError) do
@sui.ask_yes_no 'Problem?'
end
end
@@ -55,7 +55,7 @@ class TestGemSilentUI < Gem::TestCase
assert_empty out, 'No output'
assert_empty err, 'No output'
- out, err = capture_io do
+ out, err = capture_output do
use_ui @sui do
value = @sui.ask_yes_no 'Problem?', true
end
@@ -66,7 +66,7 @@ class TestGemSilentUI < Gem::TestCase
assert value, 'Value is true'
- out, err = capture_io do
+ out, err = capture_output do
use_ui @sui do
value = @sui.ask_yes_no 'Problem?', false
end
@@ -80,7 +80,7 @@ class TestGemSilentUI < Gem::TestCase
def test_choose_from_list
value = nil
- out, err = capture_io do
+ out, err = capture_output do
use_ui @sui do
value = @sui.choose_from_list 'Problem?', %w[yes no]
end
@@ -93,7 +93,7 @@ class TestGemSilentUI < Gem::TestCase
end
def test_progress_reporter
- out, err = capture_io do
+ out, err = capture_output do
use_ui @sui do
@sui.progress_reporter 10, 'hi'
end
@@ -104,7 +104,7 @@ class TestGemSilentUI < Gem::TestCase
end
def test_download_reporter
- out, err = capture_io do
+ out, err = capture_output do
use_ui @sui do
@sui.download_reporter.fetch 'a.gem', 1024
end
diff --git a/test/rubygems/test_gem_source.rb b/test/rubygems/test_gem_source.rb
index d6c2ffa051..f7b288ae11 100644
--- a/test/rubygems/test_gem_source.rb
+++ b/test/rubygems/test_gem_source.rb
@@ -22,7 +22,7 @@ class TestGemSource < Gem::TestCase
end
def test_initialize_invalid_uri
- assert_raises URI::InvalidURIError do
+ assert_raise URI::InvalidURIError do
Gem::Source.new 'git@example:a.git'
end
end
@@ -185,7 +185,7 @@ class TestGemSource < Gem::TestCase
def test_load_specs_from_unavailable_uri
src = Gem::Source.new("http://not-there.nothing")
- assert_raises Gem::RemoteFetcher::FetchError do
+ assert_raise Gem::RemoteFetcher::FetchError do
src.load_specs :latest
end
end
diff --git a/test/rubygems/test_gem_source_fetch_problem.rb b/test/rubygems/test_gem_source_fetch_problem.rb
index 1a0545a893..87b190a12c 100644
--- a/test/rubygems/test_gem_source_fetch_problem.rb
+++ b/test/rubygems/test_gem_source_fetch_problem.rb
@@ -8,7 +8,7 @@ class TestGemSourceFetchProblem < Gem::TestCase
sf = Gem::SourceFetchProblem.new source, error
- e = assert_raises RuntimeError do
+ e = assert_raise RuntimeError do
raise sf
end
diff --git a/test/rubygems/test_gem_source_git.rb b/test/rubygems/test_gem_source_git.rb
index f5406d2215..749859b024 100644
--- a/test/rubygems/test_gem_source_git.rb
+++ b/test/rubygems/test_gem_source_git.rb
@@ -24,7 +24,7 @@ class TestGemSourceGit < Gem::TestCase
def test_checkout
@source.checkout
- assert_path_exists File.join @source.install_dir, 'a.gemspec'
+ assert_path_exist File.join @source.install_dir, 'a.gemspec'
end
def test_checkout_master
@@ -39,7 +39,7 @@ class TestGemSourceGit < Gem::TestCase
@source.checkout
- assert_path_exists File.join @source.install_dir, 'b.gemspec'
+ assert_path_exist File.join @source.install_dir, 'b.gemspec'
end
def test_checkout_local
@@ -49,7 +49,7 @@ class TestGemSourceGit < Gem::TestCase
install_dir = File.join Gem.dir, 'bundler', 'gems', "a-#{@head[0..11]}"
- refute_path_exists File.join install_dir, 'a.gemspec'
+ assert_path_not_exist File.join install_dir, 'a.gemspec'
end
def test_checkout_local_cached
@@ -59,7 +59,7 @@ class TestGemSourceGit < Gem::TestCase
@source.checkout
- assert_path_exists File.join @source.install_dir, 'a.gemspec'
+ assert_path_exist File.join @source.install_dir, 'a.gemspec'
end
def test_checkout_submodules
@@ -76,14 +76,14 @@ class TestGemSourceGit < Gem::TestCase
source.checkout
- assert_path_exists File.join source.install_dir, 'a.gemspec'
- assert_path_exists File.join source.install_dir, 'b/b.gemspec'
+ assert_path_exist File.join source.install_dir, 'a.gemspec'
+ assert_path_exist File.join source.install_dir, 'b/b.gemspec'
end
def test_cache
assert @source.cache
- assert_path_exists @source.repo_cache_dir
+ assert_path_exist @source.repo_cache_dir
Dir.chdir @source.repo_cache_dir do
assert_equal @head, Gem::Util.popen(@git, 'rev-parse', 'master').strip
@@ -95,7 +95,7 @@ class TestGemSourceGit < Gem::TestCase
@source.cache
- refute_path_exists @source.repo_cache_dir
+ assert_path_not_exist @source.repo_cache_dir
end
def test_dir_shortref
@@ -186,7 +186,7 @@ class TestGemSourceGit < Gem::TestCase
source.cache
- e = assert_raises Gem::Exception do
+ e = assert_raise Gem::Exception do
capture_subprocess_io { source.rev_parse }
end
@@ -240,7 +240,7 @@ class TestGemSourceGit < Gem::TestCase
specs = nil
- capture_io do
+ capture_output do
specs = source.specs
end
@@ -275,7 +275,7 @@ class TestGemSourceGit < Gem::TestCase
source = Gem::Source::Git.new @name, @repository, 'master', true
source.remote = false
- capture_io do
+ capture_output do
assert_empty source.specs
end
end
diff --git a/test/rubygems/test_gem_source_specific_file.rb b/test/rubygems/test_gem_source_specific_file.rb
index 003fbec81d..f6d6aa51d5 100644
--- a/test/rubygems/test_gem_source_specific_file.rb
+++ b/test/rubygems/test_gem_source_specific_file.rb
@@ -27,7 +27,7 @@ class TestGemSourceSpecificFile < Gem::TestCase
end
def test_fetch_spec_fails_on_unknown_name
- assert_raises Gem::Exception do
+ assert_raise Gem::Exception do
@sf.fetch_spec(nil)
end
end
diff --git a/test/rubygems/test_gem_spec_fetcher.rb b/test/rubygems/test_gem_spec_fetcher.rb
index 9c756aacf3..8b94708259 100644
--- a/test/rubygems/test_gem_spec_fetcher.rb
+++ b/test/rubygems/test_gem_spec_fetcher.rb
@@ -38,7 +38,7 @@ class TestGemSpecFetcher < Gem::TestCase
end
def test_initialize_unwritable_home_dir
- skip 'chmod not supported' if Gem.win_platform?
+ pend 'chmod not supported' if Gem.win_platform?
FileUtils.chmod 0000, Gem.user_home
diff --git a/test/rubygems/test_gem_specification.rb b/test/rubygems/test_gem_specification.rb
index 29a3e74bfc..63a9b4ff17 100644
--- a/test/rubygems/test_gem_specification.rb
+++ b/test/rubygems/test_gem_specification.rb
@@ -170,7 +170,7 @@ end
base.activate
tms = Benchmark.measure do
- assert_raises(LoadError) { require 'no_such_file_foo' }
+ assert_raise(LoadError) { require 'no_such_file_foo' }
end
assert_operator tms.total, :<=, 10
end
@@ -406,7 +406,7 @@ end
c = util_spec 'c', '1.0', 'b' => '= 2.0'
install_specs b1, b2, c, a
- e = assert_raises Gem::LoadError do
+ e = assert_raise Gem::LoadError do
assert_activate nil, a, c, "b"
end
@@ -428,7 +428,7 @@ end
install_specs b1, b2, c, a
- e = assert_raises Gem::ConflictError do
+ e = assert_raise Gem::ConflictError do
assert_activate nil, a, c, "b"
end
@@ -537,7 +537,7 @@ end
require "b#{$$}"
- e = assert_raises Gem::LoadError do
+ e = assert_raise Gem::LoadError do
require "d#{$$}"
end
@@ -673,7 +673,7 @@ end
gem "b", "= 1.0"
- assert_raises Gem::LoadError do
+ assert_raise Gem::LoadError do
gem "b", "= 2.0"
end
end
@@ -973,7 +973,7 @@ dependencies: []
io.write @a2.to_ruby_for_cache
end
rescue Errno::EINVAL
- skip "cannot create '#{full_path}' on this platform"
+ pend "cannot create '#{full_path}' on this platform"
end
spec = Gem::Specification.load full_path
@@ -992,7 +992,7 @@ dependencies: []
io.write @a2.to_ruby_for_cache
end
rescue Errno::EINVAL
- skip "cannot create '#{full_path}' on this platform"
+ pend "cannot create '#{full_path}' on this platform"
end
spec = Gem::Specification.load full_path
@@ -1011,7 +1011,7 @@ dependencies: []
io.write @a2.to_ruby_for_cache
end
rescue Errno::EINVAL
- skip "cannot create '#{full_path}' on this platform"
+ pend "cannot create '#{full_path}' on this platform"
end
spec = Gem::Specification.load full_path
@@ -1345,7 +1345,7 @@ dependencies: []
spec.instance_variable_set :@licenses, (class << (Object.new);self;end)
spec.loaded_from = '/path/to/file'
- e = assert_raises Gem::FormatException do
+ e = assert_raise Gem::FormatException do
spec.dup
end
@@ -1451,7 +1451,7 @@ dependencies: []
end
def test_build_args
- skip "extensions don't quite work on jruby" if Gem.java_platform?
+ pend "extensions don't quite work on jruby" if Gem.java_platform?
ext_spec
assert_empty @ext.build_args
@@ -1470,10 +1470,10 @@ dependencies: []
end
def test_build_extensions
- skip "extensions don't quite work on jruby" if Gem.java_platform?
+ pend "extensions don't quite work on jruby" if Gem.java_platform?
ext_spec
- refute_path_exists @ext.extension_dir, 'sanity check'
+ assert_path_not_exist @ext.extension_dir, 'sanity check'
refute_empty @ext.extensions, 'sanity check'
extconf_rb = File.join @ext.gem_dir, @ext.extensions.first
@@ -1491,7 +1491,7 @@ dependencies: []
@ext.build_extensions
- assert_path_exists @ext.extension_dir
+ assert_path_exist @ext.extension_dir
end
def test_default_spec_stub_is_marked_default
@@ -1506,7 +1506,7 @@ dependencies: []
end
def test_build_extensions_built
- skip "extensions don't quite work on jruby" if Gem.java_platform?
+ pend "extensions don't quite work on jruby" if Gem.java_platform?
ext_spec
refute_empty @ext.extensions, 'sanity check'
@@ -1520,7 +1520,7 @@ dependencies: []
@ext.build_extensions
gem_make_out = File.join @ext.extension_dir, 'gem_make.out'
- refute_path_exists gem_make_out
+ assert_path_not_exist gem_make_out
end
def test_build_extensions_default_gem
@@ -1541,25 +1541,25 @@ dependencies: []
spec.build_extensions
- refute_path_exists spec.extension_dir
+ assert_path_not_exist spec.extension_dir
end
def test_build_extensions_error
- skip "extensions don't quite work on jruby" if Gem.java_platform?
+ pend "extensions don't quite work on jruby" if Gem.java_platform?
ext_spec
refute_empty @ext.extensions, 'sanity check'
- assert_raises Gem::Ext::BuildError do
+ assert_raise Gem::Ext::BuildError do
@ext.build_extensions
end
end
def test_build_extensions_extensions_dir_unwritable
- skip 'chmod not supported' if Gem.win_platform?
- skip 'skipped in root privilege' if Process.uid.zero?
+ pend 'chmod not supported' if Gem.win_platform?
+ pend 'skipped in root privilege' if Process.uid.zero?
- skip "extensions don't quite work on jruby" if Gem.java_platform?
+ pend "extensions don't quite work on jruby" if Gem.java_platform?
ext_spec
refute_empty @ext.extensions, 'sanity check'
@@ -1582,7 +1582,7 @@ dependencies: []
FileUtils.chmod 0555, File.join(@ext.base_dir, 'extensions')
@ext.build_extensions
- refute_path_exists @ext.extension_dir
+ assert_path_not_exist @ext.extension_dir
ensure
unless ($DEBUG or win_platform? or Process.uid.zero? or Gem.java_platform?)
FileUtils.chmod 0755, File.join(@ext.base_dir, 'extensions')
@@ -1591,8 +1591,8 @@ dependencies: []
end
def test_build_extensions_no_extensions_dir_unwritable
- skip 'chmod not supported' if Gem.win_platform?
- skip "extensions don't quite work on jruby" if Gem.java_platform?
+ pend 'chmod not supported' if Gem.win_platform?
+ pend "extensions don't quite work on jruby" if Gem.java_platform?
ext_spec
refute_empty @ext.extensions, 'sanity check'
@@ -1616,36 +1616,22 @@ dependencies: []
@ext.build_extensions
gem_make_out = File.join @ext.extension_dir, 'gem_make.out'
- refute_path_exists gem_make_out
+ assert_path_not_exist gem_make_out
ensure
FileUtils.chmod 0755, @gemhome
end
def test_build_extensions_none
- refute_path_exists @a1.extension_dir, 'sanity check'
+ assert_path_not_exist @a1.extension_dir, 'sanity check'
assert_empty @a1.extensions, 'sanity check'
@a1.build_extensions
- refute_path_exists @a1.extension_dir
- end
-
- def test_build_extensions_old
- skip "extensions don't quite work on jruby" if Gem.java_platform?
- ext_spec
-
- refute_empty @ext.extensions, 'sanity check'
-
- @ext.installed_by_version = v(0)
-
- @ext.build_extensions
-
- gem_make_out = File.join @ext.extension_dir, 'gem_make.out'
- refute_path_exists gem_make_out
+ assert_path_not_exist @a1.extension_dir
end
def test_build_extensions_preview
- skip "extensions don't quite work on jruby" if Gem.java_platform?
+ pend "extensions don't quite work on jruby" if Gem.java_platform?
ext_spec
extconf_rb = File.join @ext.gem_dir, @ext.extensions.first
@@ -1668,7 +1654,7 @@ dependencies: []
@ext.build_extensions
gem_make_out = File.join @ext.extension_dir, 'gem_make.out'
- assert_path_exists gem_make_out
+ assert_path_exist gem_make_out
end
def test_contains_requirable_file_eh
@@ -1680,10 +1666,10 @@ dependencies: []
end
def test_contains_requirable_file_eh_extension
- skip "extensions don't quite work on jruby" if Gem.java_platform?
+ pend "extensions don't quite work on jruby" if Gem.java_platform?
ext_spec
- _, err = capture_io do
+ _, err = capture_output do
refute @ext.contains_requirable_file? 'nonexistent'
end
@@ -1696,7 +1682,7 @@ dependencies: []
def test_contains_requirable_file_eh_extension_java_platform
ext_spec(platform: Gem::Platform.new("java"))
- _, err = capture_io do
+ _, err = capture_output do
refute @ext.contains_requirable_file? 'nonexistent'
end
@@ -1718,7 +1704,7 @@ dependencies: []
end
def test_date_equals_string_bad
- assert_raises Gem::InvalidSpecificationException do
+ assert_raise Gem::InvalidSpecificationException do
@a1.date = '9/11/2003'
end
end
@@ -2449,7 +2435,7 @@ end
def test_to_ruby_with_rsa_key
require 'rubygems/openssl'
- skip 'openssl is missing' unless defined?(OpenSSL::PKey::RSA)
+ pend 'openssl is missing' unless defined?(OpenSSL::PKey::RSA)
rsa_key = OpenSSL::PKey::RSA.new(2048)
@a2.signing_key = rsa_key
@@ -2633,7 +2619,7 @@ end
def test_to_yaml
yaml_str = @a1.to_yaml
- refute_match '!!null', yaml_str
+ refute_match %r{!!null}, yaml_str
same_spec = Gem::Specification.from_yaml(yaml_str)
@@ -2663,7 +2649,7 @@ end
yaml_str = @a1.to_yaml
- same_spec = YAML.load yaml_str
+ same_spec = load_yaml yaml_str
assert_equal Gem::Platform.new('powerpc-darwin7'), same_spec.platform
assert_equal 'powerpc-darwin7.9.0', same_spec.original_platform
@@ -2704,7 +2690,7 @@ end
assert_equal [], @a1.authors
- e = assert_raises Gem::InvalidSpecificationException do
+ e = assert_raise Gem::InvalidSpecificationException do
@a1.validate
end
@@ -2712,7 +2698,7 @@ end
@a1.authors = ["#{f} (who is writing this software)"]
- e = assert_raises Gem::InvalidSpecificationException do
+ e = assert_raise Gem::InvalidSpecificationException do
@a1.validate
end
@@ -2720,7 +2706,7 @@ end
@a1.authors = ["#{t} (who is writing this software)"]
- e = assert_raises Gem::InvalidSpecificationException do
+ e = assert_raise Gem::InvalidSpecificationException do
@a1.validate
end
@@ -2799,7 +2785,7 @@ end
@a1.add_development_dependency 'c', '>= 1.2.3'
use_ui @ui do
- e = assert_raises Gem::InvalidSpecificationException do
+ e = assert_raise Gem::InvalidSpecificationException do
@a1.validate
end
@@ -2903,7 +2889,7 @@ duplicate dependency on c (>= 1.2.3, development), (~> 1.2) use:
@a1.description = "#{f} (describe your package)"
- e = assert_raises Gem::InvalidSpecificationException do
+ e = assert_raise Gem::InvalidSpecificationException do
@a1.validate
end
@@ -2911,7 +2897,7 @@ duplicate dependency on c (>= 1.2.3, development), (~> 1.2) use:
@a1.description = "#{t} (describe your package)"
- e = assert_raises Gem::InvalidSpecificationException do
+ e = assert_raise Gem::InvalidSpecificationException do
@a1.validate
end
@@ -2925,7 +2911,7 @@ duplicate dependency on c (>= 1.2.3, development), (~> 1.2) use:
Dir.chdir @tempdir do
@a1.email = "FIxxxXME (your e-mail)".sub(/xxx/, "")
- e = assert_raises Gem::InvalidSpecificationException do
+ e = assert_raise Gem::InvalidSpecificationException do
@a1.validate
end
@@ -2933,7 +2919,7 @@ duplicate dependency on c (>= 1.2.3, development), (~> 1.2) use:
@a1.email = "#{t} (your e-mail)"
- e = assert_raises Gem::InvalidSpecificationException do
+ e = assert_raise Gem::InvalidSpecificationException do
@a1.validate
end
@@ -2942,7 +2928,7 @@ duplicate dependency on c (>= 1.2.3, development), (~> 1.2) use:
end
def test_validate_empty
- e = assert_raises Gem::InvalidSpecificationException do
+ e = assert_raise Gem::InvalidSpecificationException do
Gem::Specification.new.validate
end
@@ -2950,7 +2936,7 @@ duplicate dependency on c (>= 1.2.3, development), (~> 1.2) use:
end
def test_validate_error
- assert_raises Gem::InvalidSpecificationException do
+ assert_raise Gem::InvalidSpecificationException do
use_ui @ui do
Gem::Specification.new.validate
end
@@ -2980,12 +2966,12 @@ duplicate dependency on c (>= 1.2.3, development), (~> 1.2) use:
def test_validate_empty_require_paths
if win_platform?
- skip 'test_validate_empty_require_paths skipped on MS Windows (symlink)'
+ pend 'test_validate_empty_require_paths skipped on MS Windows (symlink)'
else
util_setup_validate
@a1.require_paths = []
- e = assert_raises Gem::InvalidSpecificationException do
+ e = assert_raise Gem::InvalidSpecificationException do
@a1.validate
end
@@ -2995,7 +2981,7 @@ duplicate dependency on c (>= 1.2.3, development), (~> 1.2) use:
end
def test_validate_files
- skip 'test_validate_files skipped on MS Windows (symlink)' if win_platform?
+ pend 'test_validate_files skipped on MS Windows (symlink)' if win_platform?
util_setup_validate
@a1.files += ['lib', 'lib2']
@@ -3035,9 +3021,11 @@ WARN: Clearing out unresolved specs. Try 'gem cleanup <gem>'
Please report a bug if this causes problems.
EXPECTED
- assert_output nil, expected do
+ actual_stdout, actual_stderr = capture_output do
specification.reset
end
+ assert_empty actual_stdout
+ assert_equal(expected, actual_stderr)
end
def test_unresolved_specs_with_versions
@@ -3066,16 +3054,20 @@ WARN: Clearing out unresolved specs. Try 'gem cleanup <gem>'
Please report a bug if this causes problems.
EXPECTED
- assert_output nil, expected do
+ actual_stdout, actual_stderr = capture_output do
specification.reset
end
+ assert_empty actual_stdout
+ assert_equal(expected, actual_stderr)
end
def test_duplicate_runtime_dependency
expected = "WARNING: duplicated b dependency [\"~> 3.0\", \"~> 3.0\"]\n"
- assert_output nil, expected do
+ out, err = capture_output do
@a1.add_runtime_dependency "b", "~> 3.0", "~> 3.0"
end
+ assert_empty out
+ assert_equal(expected, err)
end
def set_orig(cls)
@@ -3090,7 +3082,7 @@ Please report a bug if this causes problems.
@a1.files = [@a1.file_name]
- e = assert_raises Gem::InvalidSpecificationException do
+ e = assert_raise Gem::InvalidSpecificationException do
@a1.validate
end
@@ -3122,7 +3114,7 @@ Please report a bug if this causes problems.
@a1.homepage = 'over at my cool site'
- e = assert_raises Gem::InvalidSpecificationException do
+ e = assert_raise Gem::InvalidSpecificationException do
@a1.validate
end
@@ -3130,7 +3122,7 @@ Please report a bug if this causes problems.
@a1.homepage = 'ftp://rubygems.org'
- e = assert_raises Gem::InvalidSpecificationException do
+ e = assert_raise Gem::InvalidSpecificationException do
@a1.validate
end
@@ -3319,7 +3311,7 @@ Did you mean 'Ruby'?
def test_validate_name
util_setup_validate
- e = assert_raises Gem::InvalidSpecificationException do
+ e = assert_raise Gem::InvalidSpecificationException do
@a1.name = :json
@a1.validate
end
@@ -3327,31 +3319,31 @@ Did you mean 'Ruby'?
assert_equal 'invalid value for attribute name: ":json" must be a string', e.message
@a1.name = []
- e = assert_raises Gem::InvalidSpecificationException do
+ e = assert_raise Gem::InvalidSpecificationException do
@a1.validate
end
assert_equal "invalid value for attribute name: \"[]\" must be a string", e.message
@a1.name = ""
- e = assert_raises Gem::InvalidSpecificationException do
+ e = assert_raise Gem::InvalidSpecificationException do
@a1.validate
end
assert_equal "invalid value for attribute name: \"\" must include at least one letter", e.message
@a1.name = "12345"
- e = assert_raises Gem::InvalidSpecificationException do
+ e = assert_raise Gem::InvalidSpecificationException do
@a1.validate
end
assert_equal "invalid value for attribute name: \"12345\" must include at least one letter", e.message
@a1.name = "../malicious"
- e = assert_raises Gem::InvalidSpecificationException do
+ e = assert_raise Gem::InvalidSpecificationException do
@a1.validate
end
assert_equal "invalid value for attribute name: \"../malicious\" can only include letters, numbers, dashes, and underscores", e.message
@a1.name = "\ba\t"
- e = assert_raises Gem::InvalidSpecificationException do
+ e = assert_raise Gem::InvalidSpecificationException do
@a1.validate
end
assert_equal "invalid value for attribute name: \"\\ba\\t\" can only include letters, numbers, dashes, and underscores", e.message
@@ -3368,7 +3360,7 @@ Did you mean 'Ruby'?
spec = @a1.dup
spec.instance_variable_set "@#{name}", nil
- e = assert_raises Gem::InvalidSpecificationException do
+ e = assert_raise Gem::InvalidSpecificationException do
spec.validate
end
@@ -3378,7 +3370,7 @@ Did you mean 'Ruby'?
end
def test_validate_permissions
- skip 'chmod not supported' if Gem.win_platform?
+ pend 'chmod not supported' if Gem.win_platform?
util_setup_validate
@@ -3397,7 +3389,7 @@ Did you mean 'Ruby'?
end
def test_validate_permissions_of_missing_file_non_packaging
- skip 'chmod not supported' if Gem.win_platform?
+ pend 'chmod not supported' if Gem.win_platform?
util_setup_validate
@@ -3429,7 +3421,7 @@ Did you mean 'Ruby'?
util_setup_validate
@a1.rubygems_version = "3"
- e = assert_raises Gem::InvalidSpecificationException do
+ e = assert_raise Gem::InvalidSpecificationException do
@a1.validate
end
@@ -3443,7 +3435,7 @@ Did you mean 'Ruby'?
Dir.chdir @tempdir do
@a1.specification_version = '1.0'
- e = assert_raises Gem::InvalidSpecificationException do
+ e = assert_raise Gem::InvalidSpecificationException do
use_ui @ui do
@a1.validate
end
@@ -3468,7 +3460,7 @@ Did you mean 'Ruby'?
@a1.summary = "#{f} (describe your package)"
- e = assert_raises Gem::InvalidSpecificationException do
+ e = assert_raise Gem::InvalidSpecificationException do
@a1.validate
end
@@ -3476,7 +3468,7 @@ Did you mean 'Ruby'?
@a1.summary = "#{t} (describe your package)"
- e = assert_raises Gem::InvalidSpecificationException do
+ e = assert_raise Gem::InvalidSpecificationException do
@a1.validate
end
@@ -3529,7 +3521,7 @@ Did you mean 'Ruby'?
specfile.write "raise 'boom'"
specfile.close
begin
- capture_io do
+ capture_output do
Gem::Specification.load(specfile.path)
end
rescue => e
@@ -3599,7 +3591,7 @@ Did you mean 'Ruby'?
s.metadata = { 1 => "fail" }
end
- e = assert_raises Gem::InvalidSpecificationException do
+ e = assert_raise Gem::InvalidSpecificationException do
@m2.validate
end
@@ -3616,7 +3608,7 @@ Did you mean 'Ruby'?
s.metadata = { ("x" * 129) => "fail" }
end
- e = assert_raises Gem::InvalidSpecificationException do
+ e = assert_raise Gem::InvalidSpecificationException do
@m2.validate
end
@@ -3633,7 +3625,7 @@ Did you mean 'Ruby'?
s.metadata = { 'fail' => [] }
end
- e = assert_raises Gem::InvalidSpecificationException do
+ e = assert_raise Gem::InvalidSpecificationException do
@m2.validate
end
@@ -3650,7 +3642,7 @@ Did you mean 'Ruby'?
s.metadata = { 'fail' => ("x" * 1025) }
end
- e = assert_raises Gem::InvalidSpecificationException do
+ e = assert_raise Gem::InvalidSpecificationException do
@m2.validate
end
@@ -3667,7 +3659,7 @@ Did you mean 'Ruby'?
s.metadata = { 'homepage_uri' => 'http:/example.com' }
end
- e = assert_raises Gem::InvalidSpecificationException do
+ e = assert_raise Gem::InvalidSpecificationException do
@m2.validate
end
@@ -3707,7 +3699,7 @@ end
end
def test_missing_extensions_eh
- skip "extensions don't quite work on jruby" if Gem.java_platform?
+ pend "extensions don't quite work on jruby" if Gem.java_platform?
ext_spec
assert @ext.missing_extensions?
@@ -3737,18 +3729,6 @@ end
refute spec.missing_extensions?
end
- def test_missing_extensions_eh_legacy
- ext_spec
-
- @ext.installed_by_version = v '2.2.0.preview.2'
-
- assert @ext.missing_extensions?
-
- @ext.installed_by_version = v '2.2.0.preview.1'
-
- refute @ext.missing_extensions?
- end
-
def test_missing_extensions_eh_none
refute @a1.missing_extensions?
end
@@ -3786,7 +3766,7 @@ end
assert Gem::Specification.find_by_name "a", "1"
assert Gem::Specification.find_by_name "a", ">1"
- assert_raises Gem::MissingSpecError do
+ assert_raise Gem::MissingSpecError do
Gem::Specification.find_by_name "monkeys"
end
end
@@ -3807,7 +3787,7 @@ end
assert Gem::Specification.find_by_name "b"
- assert_raises Gem::MissingSpecVersionError do
+ assert_raise Gem::MissingSpecVersionError do
Gem::Specification.find_by_name "b", "1"
end
diff --git a/test/rubygems/test_gem_stream_ui.rb b/test/rubygems/test_gem_stream_ui.rb
index a62e9ea0cf..9148ad1385 100644
--- a/test/rubygems/test_gem_stream_ui.rb
+++ b/test/rubygems/test_gem_stream_ui.rb
@@ -90,7 +90,7 @@ class TestGemStreamUI < Gem::TestCase
@in.tty = false
Timeout.timeout(SHORT_TIMEOUT) do
- assert_raises(Gem::OperationNotSupportedError) do
+ assert_raise(Gem::OperationNotSupportedError) do
@sui.ask_yes_no("do coconuts migrate?")
end
end
diff --git a/test/rubygems/test_gem_stub_specification.rb b/test/rubygems/test_gem_stub_specification.rb
index 2ee94dcf8d..4f2e40dde0 100644
--- a/test/rubygems/test_gem_stub_specification.rb
+++ b/test/rubygems/test_gem_stub_specification.rb
@@ -65,9 +65,9 @@ class TestStubSpecification < Gem::TestCase
end
def test_contains_requirable_file_eh_extension
- skip "I guess making the stub match the running platform should work" if Gem.java_platform?
+ pend "I guess making the stub match the running platform should work" if Gem.java_platform?
stub_with_extension do |stub|
- _, err = capture_io do
+ _, err = capture_output do
refute stub.contains_requirable_file? 'nonexistent'
end
@@ -122,7 +122,7 @@ class TestStubSpecification < Gem::TestCase
end
def test_missing_extensions_eh
- skip "I guess making the stub match the running platform should work" if Gem.java_platform?
+ pend "I guess making the stub match the running platform should work" if Gem.java_platform?
stub = stub_with_extension do |s|
extconf_rb = File.join s.gem_dir, s.extensions.first
FileUtils.mkdir_p File.dirname extconf_rb
@@ -189,7 +189,7 @@ class TestStubSpecification < Gem::TestCase
def test_to_spec_missing_extensions
stub = stub_with_extension
- capture_io do
+ capture_output do
stub.contains_requirable_file? 'nonexistent'
end
diff --git a/test/rubygems/test_gem_uninstaller.rb b/test/rubygems/test_gem_uninstaller.rb
index 1ca4991d1e..47d49f6cc6 100644
--- a/test/rubygems/test_gem_uninstaller.rb
+++ b/test/rubygems/test_gem_uninstaller.rb
@@ -54,7 +54,7 @@ class TestGemUninstaller < Gem::InstallerTestCase
uninstaller.remove_all [@spec]
end
- refute_path_exists @spec.gem_dir
+ assert_path_not_exist @spec.gem_dir
end
def test_remove_executables_force_keep
@@ -138,7 +138,7 @@ class TestGemUninstaller < Gem::InstallerTestCase
Dir.mkdir "#{@gemhome}2"
uninstaller = Gem::Uninstaller.new nil, :install_dir => "#{@gemhome}2"
- e = assert_raises Gem::GemNotInHomeException do
+ e = assert_raise Gem::GemNotInHomeException do
use_ui ui do
uninstaller.remove @spec
end
@@ -149,11 +149,11 @@ class TestGemUninstaller < Gem::InstallerTestCase
assert_equal expected, e.message
- assert_path_exists @spec.gem_dir
+ assert_path_exist @spec.gem_dir
end
def test_remove_symlinked_gem_home
- skip "Symlinks not supported or not enabled" unless symlink_supported?
+ pend "Symlinks not supported or not enabled" unless symlink_supported?
Dir.mktmpdir("gem_home") do |dir|
symlinked_gem_home = "#{dir}/#{File.basename(@gemhome)}"
@@ -166,7 +166,7 @@ class TestGemUninstaller < Gem::InstallerTestCase
uninstaller.remove @spec
end
- refute_path_exists @spec.gem_dir
+ assert_path_not_exist @spec.gem_dir
end
end
@@ -297,7 +297,7 @@ class TestGemUninstaller < Gem::InstallerTestCase
uninstaller.uninstall
- refute_path_exists spec.gem_dir
+ assert_path_not_exist spec.gem_dir
end
def test_uninstall_extension
@@ -318,18 +318,18 @@ create_makefile '#{@spec.name}'
installer.install
end
- assert_path_exists @spec.extension_dir, 'sanity check'
+ assert_path_exist @spec.extension_dir, 'sanity check'
uninstaller = Gem::Uninstaller.new @spec.name, :executables => true
uninstaller.uninstall
- refute_path_exists @spec.extension_dir
+ assert_path_not_exist @spec.extension_dir
end
def test_uninstall_nonexistent
uninstaller = Gem::Uninstaller.new 'bogus', :executables => true
- e = assert_raises Gem::InstallError do
+ e = assert_raise Gem::InstallError do
uninstaller.uninstall
end
@@ -351,7 +351,7 @@ create_makefile '#{@spec.name}'
ui = Gem::MockGemUi.new "n\n"
- assert_raises Gem::DependencyRemovalException do
+ assert_raise Gem::DependencyRemovalException do
use_ui ui do
uninstaller.uninstall
end
@@ -371,16 +371,16 @@ create_makefile '#{@spec.name}'
gem_dir = File.join @user_spec.gem_dir
Gem.pre_uninstall do
- assert_path_exists gem_dir
+ assert_path_exist gem_dir
end
Gem.post_uninstall do
- refute_path_exists gem_dir
+ assert_path_not_exist gem_dir
end
uninstaller.uninstall
- refute_path_exists gem_dir
+ assert_path_not_exist gem_dir
assert_same uninstaller, @pre_uninstall_hook_arg
assert_same uninstaller, @post_uninstall_hook_arg
@@ -392,7 +392,7 @@ create_makefile '#{@spec.name}'
uninstaller = Gem::Uninstaller.new @spec.name, :executables => true
- e = assert_raises Gem::InstallError do
+ e = assert_raise Gem::InstallError do
uninstaller.uninstall
end
@@ -546,7 +546,7 @@ create_makefile '#{@spec.name}'
un = Gem::Uninstaller.new('q', :abort_on_dependent => true)
ui = Gem::MockGemUi.new("y\n")
- assert_raises Gem::DependencyRemovalException do
+ assert_raise Gem::DependencyRemovalException do
use_ui ui do
un.uninstall
end
@@ -619,7 +619,7 @@ create_makefile '#{@spec.name}'
end
FileUtils.stub :rm_r, stub_rm_r do
- assert_raises Gem::UninstallError do
+ assert_raise Gem::UninstallError do
uninstaller.uninstall
end
end
diff --git a/test/rubygems/test_gem_util.rb b/test/rubygems/test_gem_util.rb
index 7197f664e2..69b7043328 100644
--- a/test/rubygems/test_gem_util.rb
+++ b/test/rubygems/test_gem_util.rb
@@ -4,20 +4,22 @@ require 'rubygems/util'
class TestGemUtil < Gem::TestCase
def test_class_popen
- skip "popen with a block does not behave well on jruby" if Gem.java_platform?
+ pend "popen with a block does not behave well on jruby" if Gem.java_platform?
assert_equal "0\n", Gem::Util.popen(*ruby_with_rubygems_in_load_path, '-e', 'p 0')
- assert_raises Errno::ECHILD do
+ assert_raise Errno::ECHILD do
Process.wait(-1)
end
end
def test_silent_system
- skip if Gem.java_platform?
+ pend if Gem.java_platform?
Gem::Deprecate.skip_during do
- assert_silent do
+ out, err = capture_output do
Gem::Util.silent_system(*ruby_with_rubygems_in_load_path, '-e', 'puts "hello"; warn "hello"')
end
+ assert_empty out
+ assert_empty err
end
end
@@ -33,14 +35,14 @@ class TestGemUtil < Gem::TestCase
end
def test_traverse_parents_does_not_crash_on_permissions_error
- skip 'skipped on MS Windows (chmod has no effect)' if win_platform? || java_platform?
+ pend 'skipped on MS Windows (chmod has no effect)' if win_platform? || java_platform?
FileUtils.mkdir_p 'd/e/f'
# remove 'execute' permission from "e" directory and make it
# impossible to cd into it and its children
FileUtils.chmod(0666, 'd/e')
- skip 'skipped in root privilege' if Process.uid.zero?
+ pend 'skipped in root privilege' if Process.uid.zero?
paths = Gem::Util.traverse_parents('d/e/f').to_a
diff --git a/test/rubygems/test_gem_version.rb b/test/rubygems/test_gem_version.rb
index 7b382809c9..91325c2214 100644
--- a/test/rubygems/test_gem_version.rb
+++ b/test/rubygems/test_gem_version.rb
@@ -2,8 +2,6 @@
require 'rubygems/test_case'
require "rubygems/version"
-require "minitest/benchmark"
-
class TestGemVersion < Gem::TestCase
class V < ::Gem::Version
end
@@ -47,9 +45,11 @@ class TestGemVersion < Gem::TestCase
assert_equal false, Gem::Version.correct?("an incorrect version")
expected = "nil versions are discouraged and will be deprecated in Rubygems 4\n"
- assert_output nil, expected do
+ actual_stdout, actual_stderr = capture_output do
Gem::Version.correct?(nil)
end
+ assert_empty actual_stdout
+ assert_equal(expected, actual_stderr)
end
def test_class_new_subclass
@@ -100,7 +100,7 @@ class TestGemVersion < Gem::TestCase
invalid_versions << "2.3422222.222.222222222.22222.ads0as.dasd0.ddd2222.2.qd3e."
invalid_versions.each do |invalid|
- e = assert_raises ArgumentError, invalid do
+ e = assert_raise ArgumentError, invalid do
Gem::Version.new invalid
end
@@ -108,15 +108,6 @@ class TestGemVersion < Gem::TestCase
end
end
- def bench_anchored_version_pattern
- assert_performance_linear 0.5 do |count|
- version_string = count.times.map {|i| "0" * i.succ }.join(".") << "."
- version_string =~ Gem::Version::ANCHORED_VERSION_PATTERN
- end
- rescue RegexpError
- skip "It fails to allocate the memory for regex pattern of Gem::Version::ANCHORED_VERSION_PATTERN"
- end
-
def test_empty_version
["", " ", " "].each do |empty|
assert_equal "0", Gem::Version.new(empty).version
diff --git a/test/rubygems/test_kernel.rb b/test/rubygems/test_kernel.rb
index 0fa36a0dec..c427203b35 100644
--- a/test/rubygems/test_kernel.rb
+++ b/test/rubygems/test_kernel.rb
@@ -38,7 +38,7 @@ class TestKernel < Gem::TestCase
def test_gem_re_gem_mismatch
assert gem('a', '=1')
- assert_raises Gem::LoadError do
+ assert_raise Gem::LoadError do
gem('a', '= 2')
end
@@ -65,7 +65,7 @@ class TestKernel < Gem::TestCase
def test_gem_env_req
ENV["GEM_REQUIREMENT_A"] = '~> 2.0'
- assert_raises(Gem::MissingSpecVersionError) { gem('a', '= 1') }
+ assert_raise(Gem::MissingSpecVersionError) { gem('a', '= 1') }
assert gem('a', '> 1')
assert_equal @a2, Gem.loaded_specs['a']
end
@@ -73,7 +73,7 @@ class TestKernel < Gem::TestCase
def test_gem_conflicting
assert gem('a', '= 1'), "Should load"
- ex = assert_raises Gem::LoadError do
+ ex = assert_raise Gem::LoadError do
gem 'a', '= 2'
end
@@ -120,7 +120,7 @@ class TestKernel < Gem::TestCase
quick_gem 'bundler', '1'
quick_gem 'bundler', '2.a'
- e = assert_raises Gem::MissingSpecVersionError do
+ e = assert_raise Gem::MissingSpecVersionError do
gem('bundler')
end
assert_match "Could not find 'bundler' (55) required by reason.", e.message
diff --git a/test/rubygems/test_project_sanity.rb b/test/rubygems/test_project_sanity.rb
index 831a2c00aa..97fc64fb6a 100644
--- a/test/rubygems/test_project_sanity.rb
+++ b/test/rubygems/test_project_sanity.rb
@@ -5,7 +5,7 @@ require "open3"
class TestProjectSanity < Gem::TestCase
def test_manifest_is_up_to_date
- skip unless File.exist?(File.expand_path("../../../Rakefile", __FILE__))
+ pend unless File.exist?(File.expand_path("../../../Rakefile", __FILE__))
_, status = Open3.capture2e("rake check_manifest")
diff --git a/test/rubygems/test_remote_fetch_error.rb b/test/rubygems/test_remote_fetch_error.rb
index 29aaaa8adb..a1c25bcdda 100644
--- a/test/rubygems/test_remote_fetch_error.rb
+++ b/test/rubygems/test_remote_fetch_error.rb
@@ -4,7 +4,7 @@ require 'rubygems/test_case'
class TestRemoteFetchError < Gem::TestCase
def test_password_redacted
error = Gem::RemoteFetcher::FetchError.new('There was an error fetching', 'https://user:secret@gemsource.org')
- refute_match 'secret', error.to_s
+ refute_match %r{secret}, error.to_s
end
def test_invalid_url
diff --git a/test/rubygems/test_require.rb b/test/rubygems/test_require.rb
index 8c7d06edc3..f5d3480a4f 100644
--- a/test/rubygems/test_require.rb
+++ b/test/rubygems/test_require.rb
@@ -28,7 +28,7 @@ class TestGemRequire < Gem::TestCase
super
@old_loaded_features = $LOADED_FEATURES.dup
- assert_raises LoadError do
+ assert_raise LoadError do
require 'test_gem_require_a'
end
$LOADED_FEATURES.replace @old_loaded_features
@@ -147,8 +147,8 @@ class TestGemRequire < Gem::TestCase
end
def test_dash_i_respects_default_library_extension_priority
- skip "extensions don't quite work on jruby" if Gem.java_platform?
- skip "not installed yet" unless RbConfig::TOPDIR
+ pend "extensions don't quite work on jruby" if Gem.java_platform?
+ pend "not installed yet" unless RbConfig::TOPDIR
dash_i_ext_arg = util_install_extension_file('a')
dash_i_lib_arg = util_install_ruby_file('a')
@@ -245,12 +245,12 @@ class TestGemRequire < Gem::TestCase
end
def test_activate_via_require_respects_loaded_files
- skip "Not sure what's going on. If another spec creates a 'a' gem before
+ pend "Not sure what's going on. If another spec creates a 'a' gem before
this test, somehow require will load the benchmark in b, and ignore that the
stdlib one is already in $LOADED_FEATURES?. Reproducible by running the
spaceship_specific_file test before this one" if java_platform?
- skip "not installed yet" unless RbConfig::TOPDIR
+ pend "not installed yet" unless RbConfig::TOPDIR
lib_dir = File.expand_path("../../lib", File.dirname(__FILE__))
rubylibdir = File.realdirpath(RbConfig::CONFIG["rubylibdir"])
@@ -359,7 +359,7 @@ class TestGemRequire < Gem::TestCase
assert_equal %w[a-1 c-1], loaded_spec_names
assert_equal ["b (> 0)", "x (> 0)"], unresolved_names
- e = assert_raises(Gem::LoadError) do
+ e = assert_raise(Gem::LoadError) do
require("ib")
end
@@ -382,7 +382,7 @@ class TestGemRequire < Gem::TestCase
assert_equal %w[a-1 c-1], loaded_spec_names
assert_equal ["b (> 0)"], unresolved_names
- e = assert_raises(Gem::LoadError) do
+ e = assert_raise(Gem::LoadError) do
require("ib")
end
@@ -467,7 +467,7 @@ class TestGemRequire < Gem::TestCase
def test_realworld_default_gem
testing_ruby_repo = !ENV["GEM_COMMAND"].nil?
- skip "this test can't work under ruby-core setup" if testing_ruby_repo || java_platform?
+ pend "this test can't work under ruby-core setup" if testing_ruby_repo || java_platform?
cmd = <<-RUBY
$stderr = $stdout
@@ -481,7 +481,7 @@ class TestGemRequire < Gem::TestCase
def test_realworld_upgraded_default_gem
testing_ruby_repo = !ENV["GEM_COMMAND"].nil?
- skip "this test can't work under ruby-core setup" if testing_ruby_repo
+ pend "this test can't work under ruby-core setup" if testing_ruby_repo
newer_json = util_spec("json", "999.99.9", nil, ["lib/json.rb"])
install_gem newer_json
@@ -626,7 +626,7 @@ class TestGemRequire < Gem::TestCase
b2a = util_spec('bundler', '2.a', nil, "lib/bundler/setup.rb")
install_specs b1, b2a
- e = assert_raises Gem::MissingSpecVersionError do
+ e = assert_raise Gem::MissingSpecVersionError do
gem('bundler')
end
assert_match "Could not find 'bundler' (55) required by reason.", e.message
@@ -679,7 +679,7 @@ class TestGemRequire < Gem::TestCase
end
def test_no_crash_when_overriding_warn_with_warning_module
- skip "https://github.com/oracle/truffleruby/issues/2109" if RUBY_ENGINE == "truffleruby"
+ pend "https://github.com/oracle/truffleruby/issues/2109" if RUBY_ENGINE == "truffleruby"
Dir.mktmpdir("warn_test") do |dir|
File.write(dir + "/main.rb", "module Warning; def warn(str); super; end; end; warn 'Foo Bar'")
@@ -753,12 +753,12 @@ class TestGemRequire < Gem::TestCase
spec.files += ["extconf.rb", "depend", "#{name}.c"]
so = File.join(spec.gem_dir, "#{name}.#{RbConfig::CONFIG["DLEXT"]}")
- refute_path_exists so
+ assert_path_not_exist so
path = Gem::Package.build spec
installer = Gem::Installer.at path
installer.install
- assert_path_exists so
+ assert_path_exist so
spec.gem_dir
end