diff options
author | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-04-14 06:01:35 +0000 |
---|---|---|
committer | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-04-14 06:01:35 +0000 |
commit | 68ddd4d300e9a88737c4f37af74e1a0312949b2f (patch) | |
tree | 787e1e83d76934ce039eb336995a8d5bb53a89e6 /spec/bundler/spec_helper.rb | |
parent | d636809c057432e8d42abe30c6c6785eb0721d77 (diff) | |
download | ruby-68ddd4d300e9a88737c4f37af74e1a0312949b2f.tar.gz |
Merge Bundler 2.1.0.pre.1 as developed version from upstream.
https://github.com/bundler/bundler/commit/a53709556b95a914e874b22ed2116a46b0528852
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67539 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'spec/bundler/spec_helper.rb')
-rw-r--r-- | spec/bundler/spec_helper.rb | 48 |
1 files changed, 8 insertions, 40 deletions
diff --git a/spec/bundler/spec_helper.rb b/spec/bundler/spec_helper.rb index c7614e1c43..81c222ea6f 100644 --- a/spec/bundler/spec_helper.rb +++ b/spec/bundler/spec_helper.rb @@ -3,43 +3,11 @@ $:.unshift File.expand_path("..", __FILE__) $:.unshift File.expand_path("../../lib", __FILE__) -require "rubygems" -module Gem - if defined?(@path_to_default_spec_map) - @path_to_default_spec_map.delete_if do |_path, spec| - spec.name == "bundler" - end - end -end - -begin - require File.expand_path("../support/path.rb", __FILE__) - spec = Gem::Specification.load(Spec::Path.gemspec.to_s) - rspec = spec.dependencies.find {|d| d.name == "rspec" } - gem "rspec", rspec.requirement.to_s - require "rspec" - require "diff/lcs" -rescue LoadError - abort "Run rake spec:deps to install development dependencies" -end - require "bundler/psyched_yaml" require "bundler/vendored_fileutils" require "uri" require "digest" -# Delete the default copy of Bundler that RVM installs for us when running in CI -require "fileutils" -if ENV.select {|k, _v| k =~ /TRAVIS/ }.any? && Gem::Version.new(Gem::VERSION) > Gem::Version.new("2.0") - Dir.glob(File.join(Gem::Specification.default_specifications_dir, "bundler*.gemspec")).each do |file| - FileUtils.rm_rf(file) - end - - Dir.glob(File.join(RbConfig::CONFIG["sitelibdir"], "bundler*")).each do |file| - FileUtils.rm_rf(file) - end -end - if File.expand_path(__FILE__) =~ %r{([^\w/\.:\-])} abort "The bundler specs cannot be run from a path that contains special characters (particularly #{$1.inspect})" end @@ -53,9 +21,8 @@ end $debug = false -Spec::Manpages.setup +Spec::Manpages.setup unless Gem.win_platform? Spec::Rubygems.setup -FileUtils.rm_rf(Spec::Path.gem_repo1) ENV["RUBYOPT"] = "#{ENV["RUBYOPT"]} -r#{Spec::Path.spec_dir}/support/hax.rb" ENV["BUNDLE_SPEC_RUN"] = "true" @@ -104,13 +71,10 @@ RSpec.configure do |config| config.filter_run_excluding :realworld => true end - git_version = Bundler::Source::Git::GitProxy.new(nil, nil, nil).version - - config.filter_run_excluding :ruby => LessThanProc.with(RUBY_VERSION) - config.filter_run_excluding :rubygems => LessThanProc.with(Gem::VERSION) - config.filter_run_excluding :git => LessThanProc.with(git_version) + config.filter_run_excluding :ruby => RequirementChecker.against(RUBY_VERSION) + config.filter_run_excluding :rubygems => RequirementChecker.against(Gem::VERSION) config.filter_run_excluding :rubygems_master => (ENV["RGV"] != "master") - config.filter_run_excluding :bundler => LessThanProc.with(Bundler::VERSION.split(".")[0, 2].join(".")) + config.filter_run_excluding :bundler => RequirementChecker.against(Bundler::VERSION.split(".")[0]) config.filter_run_excluding :ruby_repo => !(ENV["BUNDLE_RUBY"] && ENV["BUNDLE_GEM"]).nil? config.filter_run_when_matching :focus unless ENV["CI"] @@ -122,6 +86,10 @@ RSpec.configure do |config| c.syntax = :expect end + config.mock_with :rspec do |mocks| + mocks.allow_message_expectations_on_nil = false + end + config.around :each do |example| if ENV["BUNDLE_RUBY"] orig_ruby = Gem.ruby |