diff options
151 files changed, 448 insertions, 184 deletions
diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 8abe1e76..10d9e58f 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,6 +1,6 @@ # This configuration was generated by # `rubocop --auto-gen-config` -# on 2016-11-19 11:43:45 -0600 using RuboCop version 0.45.0. +# on 2017-01-15 12:02:24 -0600 using RuboCop version 0.46.0. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new @@ -58,13 +58,13 @@ Lint/UselessAssignment: - 'lib/bundler/index.rb' - 'lib/bundler/installer.rb' -# Offense count: 7 +# Offense count: 8 # Configuration parameters: CountComments. Metrics/BlockLength: Max: 46 -# Offense count: 1855 -# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives. +# Offense count: 1890 +# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns. # URISchemes: http, https Metrics/LineLength: Max: 207 @@ -127,10 +127,23 @@ Style/ConditionalAssignment: - 'lib/bundler/source/git.rb' - 'lib/bundler/source/rubygems.rb' -# Offense count: 148 +# Offense count: 152 Style/Documentation: Enabled: false +# Offense count: 17 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, SupportedStyles. +# SupportedStyles: compact, expanded +Style/EmptyMethod: + Exclude: + - 'exe/bundle_ruby' + - 'lib/bundler/cli.rb' + - 'lib/bundler/plugin/api/source.rb' + - 'lib/bundler/rubygems_integration.rb' + - 'lib/bundler/ui/silent.rb' + - 'spec/support/artifice/fail.rb' + # Offense count: 2 # Cop supports --auto-correct. # Configuration parameters: AllowForAlignment, ForceEqualSignAlignment. @@ -145,7 +158,7 @@ Style/GlobalVars: - 'lib/bundler/cli.rb' - 'spec/spec_helper.rb' -# Offense count: 19 +# Offense count: 18 # Configuration parameters: MinBodyLength. Style/GuardClause: Exclude: @@ -159,7 +172,6 @@ Style/GuardClause: - 'lib/bundler/installer.rb' - 'lib/bundler/lockfile_parser.rb' - 'lib/bundler/runtime.rb' - - 'lib/bundler/shared_helpers.rb' - 'lib/bundler/source/path/installer.rb' - 'lib/bundler/source_list.rb' - 'spec/commands/newgem_spec.rb' @@ -276,7 +288,7 @@ Style/SpaceAroundOperators: Exclude: - 'lib/bundler/retry.rb' -# Offense count: 1 +# Offense count: 2 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles, EnforcedStyleForEmptyBraces, SpaceBeforeBlockParameters. # SupportedStyles: space, no_space @@ -287,20 +299,19 @@ Style/SpaceInsideBlockBraces: # Offense count: 2 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles, AllowSafeAssignment. -# SupportedStyles: require_parentheses, require_no_parentheses +# SupportedStyles: require_parentheses, require_no_parentheses, require_parentheses_when_complex Style/TernaryParentheses: Exclude: - 'lib/bundler/cli/common.rb' - 'lib/bundler/gem_version_promoter.rb' -# Offense count: 10 +# Offense count: 9 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyleForMultiline, SupportedStyles. # SupportedStyles: comma, consistent_comma, no_comma Style/TrailingCommaInLiteral: Exclude: - 'lib/bundler/cli/gem.rb' - - 'lib/bundler/dependency.rb' - 'lib/bundler/fetcher.rb' - 'lib/bundler/gem_helpers.rb' - 'lib/bundler/graph.rb' @@ -308,7 +319,7 @@ Style/TrailingCommaInLiteral: - 'lib/bundler/similarity_detector.rb' - 'spec/support/artifice/endpoint.rb' -# Offense count: 18 +# Offense count: 7 # Cop supports --auto-correct. Style/UnneededInterpolation: Exclude: @@ -317,14 +328,11 @@ Style/UnneededInterpolation: - 'spec/bundler/shared_helpers_spec.rb' - 'spec/cache/git_spec.rb' - 'spec/commands/exec_spec.rb' - - 'spec/support/artifice/endpoint.rb' - - 'spec/support/artifice/endpoint_500.rb' # Offense count: 2 -# Configuration parameters: SupportedStyles. +# Configuration parameters: EnforcedStyle, SupportedStyles. # SupportedStyles: snake_case, normalcase, non_integer Style/VariableNumber: - EnforcedStyle: normalcase Exclude: - 'spec/commands/help_spec.rb' - 'spec/other/ext_spec.rb' @@ -39,7 +39,7 @@ namespace :spec do deps = Hash[BUNDLER_SPEC.development_dependencies.map do |d| [d.name, d.requirement.to_s] end] - deps["rubocop"] ||= "= 0.45.0" if RUBY_VERSION >= "2.0.0" # can't go in the gemspec because of the ruby version requirement + deps["rubocop"] ||= "= 0.46.0" if RUBY_VERSION >= "2.0.0" # can't go in the gemspec because of the ruby version requirement # JRuby can't build ronn or rdiscount, so we skip that if defined?(RUBY_ENGINE) && RUBY_ENGINE == "jruby" @@ -93,7 +93,7 @@ begin if RUBY_VERSION >= "2.0.0" # can't go in the gemspec because of the ruby version requirement - gem "rubocop", "= 0.45.0" + gem "rubocop", "= 0.46.0" require "rubocop/rake_task" RuboCop::RakeTask.new end diff --git a/bin/rubocop b/bin/rubocop index 83e8e78c..aedb4db2 100755 --- a/bin/rubocop +++ b/bin/rubocop @@ -10,7 +10,7 @@ bundler_spec.dependencies.each do |dep| gem dep.name, dep.requirement end -gem "rubocop", "= 0.45.0" +gem "rubocop", "= 0.46.0" Gem.finish_resolve if Gem.respond_to?(:finish_resolve) diff --git a/lib/bundler.rb b/lib/bundler.rb index 852eb512..2cd8d991 100644 --- a/lib/bundler.rb +++ b/lib/bundler.rb @@ -133,7 +133,7 @@ module Bundler @locked_gems ||= if defined?(@definition) && @definition definition.locked_gems - elsif Bundler.default_lockfile.exist? + elsif Bundler.default_lockfile.file? lock = Bundler.read_file(Bundler.default_lockfile) LockfileParser.new(lock) end diff --git a/lib/bundler/cli.rb b/lib/bundler/cli.rb index eb9362a5..a70d66f2 100644 --- a/lib/bundler/cli.rb +++ b/lib/bundler/cli.rb @@ -13,6 +13,7 @@ module Bundler Bundler.ui = UI::Shell.new raise e ensure + warn_on_outdated_bundler Bundler::SharedHelpers.print_major_deprecations! end @@ -579,5 +580,26 @@ module Bundler command.reject!(&:empty?) Bundler.ui.info "Running `#{command * " "}` with bundler #{Bundler::VERSION}" end + + def self.warn_on_outdated_bundler + return if Bundler.settings[:disable_version_check] + + latest = Fetcher::CompactIndex. + new(nil, Source::Rubygems::Remote.new(URI("https://rubygems.org")), nil). + send(:compact_index_client). + instance_variable_get(:@cache). + dependencies("bundler"). + map {|d| Gem::Version.new(d.first) }. + max + return unless latest + + current = Gem::Version.new(VERSION) + return if current >= latest + + Bundler.ui.warn "The latest bundler is #{latest}, but you are currently running #{current}.\nTo update, run `gem install bundler#{" --pre" if latest.prerelease?}`" + rescue + nil + end + private_class_method :warn_on_outdated_bundler end end diff --git a/lib/bundler/cli/check.rb b/lib/bundler/cli/check.rb index 3f504ff6..057a7e56 100644 --- a/lib/bundler/cli/check.rb +++ b/lib/bundler/cli/check.rb @@ -28,7 +28,7 @@ module Bundler not_installed.each {|s| Bundler.ui.error " * #{s.name} (#{s.version})" } Bundler.ui.warn "Install missing gems with `bundle install`" exit 1 - elsif !Bundler.default_lockfile.exist? && Bundler.settings[:frozen] + elsif !Bundler.default_lockfile.file? && Bundler.settings[:frozen] Bundler.ui.error "This bundle has been frozen, but there is no #{Bundler.default_lockfile.relative_path_from(SharedHelpers.pwd)} present" exit 1 else diff --git a/lib/bundler/inline.rb b/lib/bundler/inline.rb index c0f5bd0e..4d3791bf 100644 --- a/lib/bundler/inline.rb +++ b/lib/bundler/inline.rb @@ -39,7 +39,7 @@ def gemfile(install = false, options = {}, &gemfile) def Bundler.root Bundler::SharedHelpers.pwd.expand_path end - ENV["BUNDLE_GEMFILE"] ||= "Gemfile" + ENV["BUNDLE_GEMFILE"] = "Gemfile" Bundler::Plugin.gemfile_install(&gemfile) if Bundler.feature_flag.plugins? builder = Bundler::Dsl.new diff --git a/lib/bundler/installer.rb b/lib/bundler/installer.rb index 46131ea8..4aa337a0 100644 --- a/lib/bundler/installer.rb +++ b/lib/bundler/installer.rb @@ -212,7 +212,7 @@ module Bundler end def resolve_if_need(options) - if Bundler.default_lockfile.exist? && !options["update"] && !options[:inline] + if !options["update"] && !options[:inline] && Bundler.default_lockfile.file? local = Bundler.ui.silence do begin tmpdef = Definition.build(Bundler.default_gemfile, Bundler.default_lockfile, nil) diff --git a/lib/bundler/resolver.rb b/lib/bundler/resolver.rb index bdb8f488..2eff76d7 100644 --- a/lib/bundler/resolver.rb +++ b/lib/bundler/resolver.rb @@ -14,7 +14,7 @@ module Bundler def message conflicts.sort.reduce(String.new) do |o, (name, conflict)| - o << %(Bundler could not find compatible versions for gem "#{name}":\n) + o << %(\nBundler could not find compatible versions for gem "#{name}":\n) if conflict.locked_requirement o << %( In snapshot (#{Bundler.default_lockfile.basename}):\n) o << %( #{printable_dep(conflict.locked_requirement)}\n) @@ -62,7 +62,7 @@ module Bundler end end o - end + end.strip end end @@ -315,6 +315,7 @@ module Bundler dependencies.sort_by do |dependency| name = name_for(dependency) [ + @base_dg.vertex_named(name) ? 0 : 1, activated.vertex_named(name).payload ? 0 : 1, amount_constrained(dependency), conflicts[name] ? 0 : 1, diff --git a/lib/bundler/settings.rb b/lib/bundler/settings.rb index 4c14f636..4ba7ab4a 100644 --- a/lib/bundler/settings.rb +++ b/lib/bundler/settings.rb @@ -14,6 +14,8 @@ module Bundler disable_exec_load disable_local_branch_check disable_shared_gems + disable_version_check + force_ruby_platform frozen gem.coc gem.mit @@ -21,7 +23,6 @@ module Bundler major_deprecations no_install no_prune - force_ruby_platform only_update_to_newer_versions plugins silence_root_warning diff --git a/lib/bundler/templates/newgem/spec/spec_helper.rb.tt b/lib/bundler/templates/newgem/spec/spec_helper.rb.tt index a5e7f92f..805cf57e 100644 --- a/lib/bundler/templates/newgem/spec/spec_helper.rb.tt +++ b/lib/bundler/templates/newgem/spec/spec_helper.rb.tt @@ -5,6 +5,9 @@ RSpec.configure do |config| # Enable flags like --only-failures and --next-failure config.example_status_persistence_file_path = ".rspec_status" + # Disable RSpec exposing methods globally on `Module` and `main` + config.disable_monkey_patching! + config.expect_with :rspec do |c| c.syntax = :expect end diff --git a/man/bundle-config.ronn b/man/bundle-config.ronn index fd15a242..85fe3dd2 100644 --- a/man/bundle-config.ronn +++ b/man/bundle-config.ronn @@ -169,6 +169,9 @@ learn more about their operation in [bundle install(1)][bundle-install]. * `disable_checksum_validation` (`BUNDLE_DISABLE_CHECKSUM_VALIDATION`): Allow installing gems even if they do not match the checksum provided by RubyGems. +* `disable_version_check` (`BUNDLE_DISABLE_VERSION_CHECK`): + Stop Bundler from checking if a newer Bundler version is available on + rubygems.org. In general, you should set these settings per-application by using the applicable flag to the [bundle install(1)][bundle-install] or [bundle package(1)][bundle-package] command. diff --git a/spec/bundler/bundler_spec.rb b/spec/bundler/bundler_spec.rb index 1b72f7fd..4458efce 100644 --- a/spec/bundler/bundler_spec.rb +++ b/spec/bundler/bundler_spec.rb @@ -3,7 +3,7 @@ require "spec_helper" require "bundler" -describe Bundler do +RSpec.describe Bundler do describe "#load_gemspec_uncached" do let(:app_gemspec_path) { tmp("test.gemspec") } subject { Bundler.load_gemspec_uncached(app_gemspec_path) } diff --git a/spec/bundler/cli_spec.rb b/spec/bundler/cli_spec.rb index ac704fb4..ec1d3848 100644 --- a/spec/bundler/cli_spec.rb +++ b/spec/bundler/cli_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" require "bundler/cli" -describe "bundle executable" do +RSpec.describe "bundle executable" do it "returns non-zero exit status when passed unrecognized options" do bundle "--invalid_argument" expect(exitstatus).to_not be_zero if exitstatus @@ -61,9 +61,72 @@ describe "bundle executable" do expect(out).to start_with("Running `bundle config --verbose` with bundler #{Bundler::VERSION}") end end + + describe "printing the outdated warning" do + shared_examples_for "no warning" do + it "prints no warning" do + bundle "fail" + expect(err + out).to eq("Could not find command \"fail\".") + end + end + + let(:bundler_version) { "1.1" } + let(:latest_version) { nil } + before do + simulate_bundler_version(bundler_version) + if latest_version + info_path = home(".bundle/cache/compact_index/rubygems.org.443.29b0360b937aa4d161703e6160654e47/info/bundler") + info_path.parent.mkpath + info_path.open("w") {|f| f.write "#{latest_version}\n" } + end + end + + context "when there is no latest version" do + include_examples "no warning" + end + + context "when the latest version is equal to the current version" do + let(:latest_version) { bundler_version } + include_examples "no warning" + end + + context "when the latest version is less than the current version" do + let(:latest_version) { "0.9" } + include_examples "no warning" + end + + context "when the latest version is greater than the current version" do + let(:latest_version) { "2.0" } + it "prints the version warning" do + bundle "fail" + expect(err + out).to eq(<<-EOS.strip) +The latest bundler is #{latest_version}, but you are currently running #{bundler_version}. +To update, run `gem install bundler` +Could not find command "fail". + EOS + end + + context "and disable_version_check is set" do + before { bundle! "config disable_version_check true" } + include_examples "no warning" + end + + context "and is a pre-release" do + let(:latest_version) { "2.0.0.pre.4" } + it "prints the version warning" do + bundle "fail" + expect(err + out).to eq(<<-EOS.strip) +The latest bundler is #{latest_version}, but you are currently running #{bundler_version}. +To update, run `gem install bundler --pre` +Could not find command "fail". + EOS + end + end + end + end end -describe "bundler executable" do +RSpec.describe "bundler executable" do it "shows the bundler version just as the `bundle` executable does" do bundler "--version" expect(out).to eq("Bundler version #{Bundler::VERSION}") diff --git a/spec/bundler/definition_spec.rb b/spec/bundler/definition_spec.rb index 1bd6575d..73d44a93 100644 --- a/spec/bundler/definition_spec.rb +++ b/spec/bundler/definition_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" require "bundler/definition" -describe Bundler::Definition do +RSpec.describe Bundler::Definition do describe "#lock" do before do allow(Bundler).to receive(:settings) { Bundler::Settings.new(".") } diff --git a/spec/bundler/dsl_spec.rb b/spec/bundler/dsl_spec.rb index bd5d9431..0561cb7d 100644 --- a/spec/bundler/dsl_spec.rb +++ b/spec/bundler/dsl_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe Bundler::Dsl do +RSpec.describe Bundler::Dsl do before do @rubygems = double("rubygems") allow(Bundler::Source::Rubygems).to receive(:new) { @rubygems } diff --git a/spec/bundler/endpoint_specification_spec.rb b/spec/bundler/endpoint_specification_spec.rb index b1e71df3..0b8da840 100644 --- a/spec/bundler/endpoint_specification_spec.rb +++ b/spec/bundler/endpoint_specification_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe Bundler::EndpointSpecification do +RSpec.describe Bundler::EndpointSpecification do let(:name) { "foo" } let(:version) { "1.0.0" } let(:platform) { Gem::Platform::RUBY } diff --git a/spec/bundler/env_spec.rb b/spec/bundler/env_spec.rb index f2cf26c4..269c323a 100644 --- a/spec/bundler/env_spec.rb +++ b/spec/bundler/env_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" require "bundler/settings" -describe Bundler::Env do +RSpec.describe Bundler::Env do let(:env) { described_class.new } let(:git_proxy_stub) { Bundler::Source::Git::GitProxy.new(nil, nil, nil) } diff --git a/spec/bundler/environment_preserver_spec.rb b/spec/bundler/environment_preserver_spec.rb index 496646d6..41d26500 100644 --- a/spec/bundler/environment_preserver_spec.rb +++ b/spec/bundler/environment_preserver_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe Bundler::EnvironmentPreserver do +RSpec.describe Bundler::EnvironmentPreserver do let(:preserver) { described_class.new(env, ["foo"]) } describe "#backup" do diff --git a/spec/bundler/fetcher/base_spec.rb b/spec/bundler/fetcher/base_spec.rb index bd1c0366..38b69429 100644 --- a/spec/bundler/fetcher/base_spec.rb +++ b/spec/bundler/fetcher/base_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe Bundler::Fetcher::Base do +RSpec.describe Bundler::Fetcher::Base do let(:downloader) { double(:downloader) } let(:remote) { double(:remote) } let(:display_uri) { "http://sample_uri.com" } diff --git a/spec/bundler/fetcher/compact_index_spec.rb b/spec/bundler/fetcher/compact_index_spec.rb index 691e19f6..5e85f906 100644 --- a/spec/bundler/fetcher/compact_index_spec.rb +++ b/spec/bundler/fetcher/compact_index_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe Bundler::Fetcher::CompactIndex do +RSpec.describe Bundler::Fetcher::CompactIndex do let(:downloader) { double(:downloader) } let(:remote) { double(:remote, :cache_slug => "lsjdf") } let(:display_uri) { URI("http://sampleuri.com") } diff --git a/spec/bundler/fetcher/dependency_spec.rb b/spec/bundler/fetcher/dependency_spec.rb index d021a246..134ca1bc 100644 --- a/spec/bundler/fetcher/dependency_spec.rb +++ b/spec/bundler/fetcher/dependency_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe Bundler::Fetcher::Dependency do +RSpec.describe Bundler::Fetcher::Dependency do let(:downloader) { double(:downloader) } let(:remote) { double(:remote, :uri => URI("http://localhost:5000")) } let(:display_uri) { "http://sample_uri.com" } diff --git a/spec/bundler/fetcher/downloader_spec.rb b/spec/bundler/fetcher/downloader_spec.rb index 8371bcfa..8b26b8e4 100644 --- a/spec/bundler/fetcher/downloader_spec.rb +++ b/spec/bundler/fetcher/downloader_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe Bundler::Fetcher::Downloader do +RSpec.describe Bundler::Fetcher::Downloader do let(:connection) { double(:connection) } let(:redirect_limit) { 5 } let(:uri) { URI("http://www.uri-to-fetch.com/api/v2/endpoint") } diff --git a/spec/bundler/fetcher/index_spec.rb b/spec/bundler/fetcher/index_spec.rb index f81a655c..b17e0d17 100644 --- a/spec/bundler/fetcher/index_spec.rb +++ b/spec/bundler/fetcher/index_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe Bundler::Fetcher::Index do +RSpec.describe Bundler::Fetcher::Index do let(:downloader) { nil } let(:remote) { nil } let(:display_uri) { "http://sample_uri.com" } diff --git a/spec/bundler/fetcher_spec.rb b/spec/bundler/fetcher_spec.rb index 015eb81f..5244fc2b 100644 --- a/spec/bundler/fetcher_spec.rb +++ b/spec/bundler/fetcher_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" require "bundler/fetcher" -describe Bundler::Fetcher do +RSpec.describe Bundler::Fetcher do let(:uri) { URI("https://example.com") } let(:remote) { double("remote", :uri => uri, :original_uri => nil) } diff --git a/spec/bundler/friendly_errors_spec.rb b/spec/bundler/friendly_errors_spec.rb index 1d88403c..365b2d12 100644 --- a/spec/bundler/friendly_errors_spec.rb +++ b/spec/bundler/friendly_errors_spec.rb @@ -4,7 +4,7 @@ require "bundler" require "bundler/friendly_errors" require "cgi" -describe Bundler, "friendly errors" do +RSpec.describe Bundler, "friendly errors" do context "with invalid YAML in .gemrc" do before do File.open(Gem.configuration.config_file_name, "w") do |f| diff --git a/spec/bundler/gem_helper_spec.rb b/spec/bundler/gem_helper_spec.rb index 4e1af32c..a827568d 100644 --- a/spec/bundler/gem_helper_spec.rb +++ b/spec/bundler/gem_helper_spec.rb @@ -3,7 +3,7 @@ require "spec_helper" require "rake" require "bundler/gem_helper" -describe Bundler::GemHelper do +RSpec.describe Bundler::GemHelper do let(:app_name) { "lorem__ipsum" } let(:app_path) { bundled_app app_name } let(:app_gemspec_path) { app_path.join("#{app_name}.gemspec") } diff --git a/spec/bundler/gem_version_promoter_spec.rb b/spec/bundler/gem_version_promoter_spec.rb index 9e5a7bb5..c7620e26 100644 --- a/spec/bundler/gem_version_promoter_spec.rb +++ b/spec/bundler/gem_version_promoter_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe Bundler::GemVersionPromoter do +RSpec.describe Bundler::GemVersionPromoter do context "conservative resolver" do def versions(result) result.flatten.map(&:version).map(&:to_s) diff --git a/spec/bundler/index_spec.rb b/spec/bundler/index_spec.rb index 1ff592ca..09b09e08 100644 --- a/spec/bundler/index_spec.rb +++ b/spec/bundler/index_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe Bundler::Index do +RSpec.describe Bundler::Index do let(:specs) { [] } subject { described_class.build {|i| i.use(specs) } } diff --git a/spec/bundler/installer/parallel_installer_spec.rb b/spec/bundler/installer/parallel_installer_spec.rb index 0f4e7dba..7d2c4413 100644 --- a/spec/bundler/installer/parallel_installer_spec.rb +++ b/spec/bundler/installer/parallel_installer_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" require "bundler/installer/parallel_installer" -describe Bundler::ParallelInstaller do +RSpec.describe Bundler::ParallelInstaller do let(:installer) { instance_double("Installer") } let(:all_specs) { [] } let(:size) { 1 } diff --git a/spec/bundler/installer/spec_installation_spec.rb b/spec/bundler/installer/spec_installation_spec.rb index b18695bf..1e368ab7 100644 --- a/spec/bundler/installer/spec_installation_spec.rb +++ b/spec/bundler/installer/spec_installation_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" require "bundler/installer/parallel_installer" -describe Bundler::ParallelInstaller::SpecInstallation do +RSpec.describe Bundler::ParallelInstaller::SpecInstallation do let!(:dep) do a_spec = Object.new def a_spec.name diff --git a/spec/bundler/lockfile_parser_spec.rb b/spec/bundler/lockfile_parser_spec.rb index 98d7b68c..17bb4471 100644 --- a/spec/bundler/lockfile_parser_spec.rb +++ b/spec/bundler/lockfile_parser_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" require "bundler/lockfile_parser" -describe Bundler::LockfileParser do +RSpec.describe Bundler::LockfileParser do let(:lockfile_contents) { strip_whitespace(<<-L) } GIT remote: https://github.com/alloy/peiji-san.git diff --git a/spec/bundler/mirror_spec.rb b/spec/bundler/mirror_spec.rb index 6a81ef2a..9051a804 100644 --- a/spec/bundler/mirror_spec.rb +++ b/spec/bundler/mirror_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" require "bundler/mirror" -describe Bundler::Settings::Mirror do +RSpec.describe Bundler::Settings::Mirror do let(:mirror) { Bundler::Settings::Mirror.new } it "returns zero when fallback_timeout is not set" do @@ -144,7 +144,7 @@ describe Bundler::Settings::Mirror do end end -describe Bundler::Settings::Mirrors do +RSpec.describe Bundler::Settings::Mirrors do let(:localhost_uri) { URI("http://localhost:9292") } context "with a just created mirror" do @@ -293,7 +293,7 @@ describe Bundler::Settings::Mirrors do end end -describe Bundler::Settings::TCPSocketProbe do +RSpec.describe Bundler::Settings::TCPSocketProbe do let(:probe) { Bundler::Settings::TCPSocketProbe.new } context "with a listening TCP Server" do diff --git a/spec/bundler/plugin/api/source_spec.rb b/spec/bundler/plugin/api/source_spec.rb index d62127a6..4dbb993b 100644 --- a/spec/bundler/plugin/api/source_spec.rb +++ b/spec/bundler/plugin/api/source_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe Bundler::Plugin::API::Source do +RSpec.describe Bundler::Plugin::API::Source do let(:uri) { "uri://to/test" } let(:type) { "spec_type" } diff --git a/spec/bundler/plugin/api_spec.rb b/spec/bundler/plugin/api_spec.rb index 0eba5230..e40b9adb 100644 --- a/spec/bundler/plugin/api_spec.rb +++ b/spec/bundler/plugin/api_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe Bundler::Plugin::API do +RSpec.describe Bundler::Plugin::API do context "plugin declarations" do before do stub_const "UserPluginClass", Class.new(Bundler::Plugin::API) diff --git a/spec/bundler/plugin/dsl_spec.rb b/spec/bundler/plugin/dsl_spec.rb index 9a694833..cd15b6ea 100644 --- a/spec/bundler/plugin/dsl_spec.rb +++ b/spec/bundler/plugin/dsl_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe Bundler::Plugin::DSL do +RSpec.describe Bundler::Plugin::DSL do DSL = Bundler::Plugin::DSL subject(:dsl) { Bundler::Plugin::DSL.new } diff --git a/spec/bundler/plugin/index_spec.rb b/spec/bundler/plugin/index_spec.rb index 5a754f35..23b2a898 100644 --- a/spec/bundler/plugin/index_spec.rb +++ b/spec/bundler/plugin/index_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe Bundler::Plugin::Index do +RSpec.describe Bundler::Plugin::Index do Index = Bundler::Plugin::Index before do diff --git a/spec/bundler/plugin/installer_spec.rb b/spec/bundler/plugin/installer_spec.rb index 9d6eb1c5..2454ef00 100644 --- a/spec/bundler/plugin/installer_spec.rb +++ b/spec/bundler/plugin/installer_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe Bundler::Plugin::Installer do +RSpec.describe Bundler::Plugin::Installer do subject(:installer) { Bundler::Plugin::Installer.new } describe "cli install" do diff --git a/spec/bundler/plugin/source_list_spec.rb b/spec/bundler/plugin/source_list_spec.rb index 774156b2..86cc4ac4 100644 --- a/spec/bundler/plugin/source_list_spec.rb +++ b/spec/bundler/plugin/source_list_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe Bundler::Plugin::SourceList do +RSpec.describe Bundler::Plugin::SourceList do SourceList = Bundler::Plugin::SourceList before do diff --git a/spec/bundler/plugin_spec.rb b/spec/bundler/plugin_spec.rb index 54027803..5bbb7384 100644 --- a/spec/bundler/plugin_spec.rb +++ b/spec/bundler/plugin_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe Bundler::Plugin do +RSpec.describe Bundler::Plugin do Plugin = Bundler::Plugin let(:installer) { double(:installer) } diff --git a/spec/bundler/psyched_yaml_spec.rb b/spec/bundler/psyched_yaml_spec.rb index 4b7715b4..18e40d6b 100644 --- a/spec/bundler/psyched_yaml_spec.rb +++ b/spec/bundler/psyched_yaml_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" require "bundler/psyched_yaml" -describe "Bundler::YamlLibrarySyntaxError" do +RSpec.describe "Bundler::YamlLibrarySyntaxError" do it "is raised on YAML parse errors" do expect { YAML.parse "{foo" }.to raise_error(Bundler::YamlLibrarySyntaxError) end diff --git a/spec/bundler/remote_specification_spec.rb b/spec/bundler/remote_specification_spec.rb index d958ca85..c8832d35 100644 --- a/spec/bundler/remote_specification_spec.rb +++ b/spec/bundler/remote_specification_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe Bundler::RemoteSpecification do +RSpec.describe Bundler::RemoteSpecification do let(:name) { "foo" } let(:version) { Gem::Version.new("1.0.0") } let(:platform) { Gem::Platform::RUBY } diff --git a/spec/bundler/retry_spec.rb b/spec/bundler/retry_spec.rb index 7f5779a5..525f05d3 100644 --- a/spec/bundler/retry_spec.rb +++ b/spec/bundler/retry_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe Bundler::Retry do +RSpec.describe Bundler::Retry do it "return successful result if no errors" do attempts = 0 result = Bundler::Retry.new(nil, nil, 3).attempt do diff --git a/spec/bundler/ruby_dsl_spec.rb b/spec/bundler/ruby_dsl_spec.rb index ac73747a..3e0ec9d7 100644 --- a/spec/bundler/ruby_dsl_spec.rb +++ b/spec/bundler/ruby_dsl_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" require "bundler/ruby_dsl" -describe Bundler::RubyDsl do +RSpec.describe Bundler::RubyDsl do class MockDSL include Bundler::RubyDsl diff --git a/spec/bundler/ruby_version_spec.rb b/spec/bundler/ruby_version_spec.rb index e983c184..f77ec606 100644 --- a/spec/bundler/ruby_version_spec.rb +++ b/spec/bundler/ruby_version_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" require "bundler/ruby_version" -describe "Bundler::RubyVersion and its subclasses" do +RSpec.describe "Bundler::RubyVersion and its subclasses" do let(:version) { "2.0.0" } let(:patchlevel) { "645" } let(:engine) { "jruby" } diff --git a/spec/bundler/rubygems_integration_spec.rb b/spec/bundler/rubygems_integration_spec.rb index fbc49c41..37eb499e 100644 --- a/spec/bundler/rubygems_integration_spec.rb +++ b/spec/bundler/rubygems_integration_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe Bundler::RubygemsIntegration do +RSpec.describe Bundler::RubygemsIntegration do it "uses the same chdir lock as rubygems", :rubygems => "2.1" do expect(Bundler.rubygems.ext_lock).to eq(Gem::Ext::Builder::CHDIR_MONITOR) end diff --git a/spec/bundler/settings_spec.rb b/spec/bundler/settings_spec.rb index 04e221a5..c67ae81b 100644 --- a/spec/bundler/settings_spec.rb +++ b/spec/bundler/settings_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" require "bundler/settings" -describe Bundler::Settings do +RSpec.describe Bundler::Settings do subject(:settings) { described_class.new(bundled_app) } describe "#set_local" do diff --git a/spec/bundler/shared_helpers_spec.rb b/spec/bundler/shared_helpers_spec.rb index fc3371ac..8bd72156 100644 --- a/spec/bundler/shared_helpers_spec.rb +++ b/spec/bundler/shared_helpers_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe Bundler::SharedHelpers do +RSpec.describe Bundler::SharedHelpers do let(:ext_lock_double) { double(:ext_lock) } before do diff --git a/spec/bundler/source/git/git_proxy_spec.rb b/spec/bundler/source/git/git_proxy_spec.rb index ce6b79b2..34fe21e9 100644 --- a/spec/bundler/source/git/git_proxy_spec.rb +++ b/spec/bundler/source/git/git_proxy_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe Bundler::Source::Git::GitProxy do +RSpec.describe Bundler::Source::Git::GitProxy do let(:uri) { "https://github.com/bundler/bundler.git" } subject { described_class.new(Pathname("path"), uri, "HEAD") } diff --git a/spec/bundler/source/rubygems/remote_spec.rb b/spec/bundler/source/rubygems/remote_spec.rb index a541bf14..54394fc0 100644 --- a/spec/bundler/source/rubygems/remote_spec.rb +++ b/spec/bundler/source/rubygems/remote_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" require "bundler/source/rubygems/remote" -describe Bundler::Source::Rubygems::Remote do +RSpec.describe Bundler::Source::Rubygems::Remote do def remote(uri) Bundler::Source::Rubygems::Remote.new(uri) end diff --git a/spec/bundler/source/rubygems_spec.rb b/spec/bundler/source/rubygems_spec.rb index 9fb4bf0a..b8f9f09c 100644 --- a/spec/bundler/source/rubygems_spec.rb +++ b/spec/bundler/source/rubygems_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe Bundler::Source::Rubygems do +RSpec.describe Bundler::Source::Rubygems do before do allow(Bundler).to receive(:root) { Pathname.new("root") } end diff --git a/spec/bundler/source_list_spec.rb b/spec/bundler/source_list_spec.rb index 3657ac09..6a23c8bc 100644 --- a/spec/bundler/source_list_spec.rb +++ b/spec/bundler/source_list_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe Bundler::SourceList do +RSpec.describe Bundler::SourceList do before do allow(Bundler).to receive(:root) { Pathname.new "./tmp/bundled_app" } diff --git a/spec/bundler/source_spec.rb b/spec/bundler/source_spec.rb index ea171d38..d35a6916 100644 --- a/spec/bundler/source_spec.rb +++ b/spec/bundler/source_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe Bundler::Source do +RSpec.describe Bundler::Source do class ExampleSource < Bundler::Source end diff --git a/spec/bundler/spec_set_spec.rb b/spec/bundler/spec_set_spec.rb index 29d81cb3..8f7c27f0 100644 --- a/spec/bundler/spec_set_spec.rb +++ b/spec/bundler/spec_set_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe Bundler::SpecSet do +RSpec.describe Bundler::SpecSet do let(:specs) do [ build_spec("a", "1.0"), diff --git a/spec/bundler/ssl_certs/certificate_manager_spec.rb b/spec/bundler/ssl_certs/certificate_manager_spec.rb index cc8c8a49..51552f72 100644 --- a/spec/bundler/ssl_certs/certificate_manager_spec.rb +++ b/spec/bundler/ssl_certs/certificate_manager_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" require "bundler/ssl_certs/certificate_manager" -describe Bundler::SSLCerts::CertificateManager do +RSpec.describe Bundler::SSLCerts::CertificateManager do let(:rubygems_path) { root } let(:stub_cert) { File.join(root.to_s, "lib", "rubygems", "ssl_certs", "rubygems.org", "ssl-cert.pem") } let(:rubygems_certs_dir) { File.join(root.to_s, "lib", "rubygems", "ssl_certs", "rubygems.org") } diff --git a/spec/bundler/uri_credentials_filter_spec.rb b/spec/bundler/uri_credentials_filter_spec.rb index 70f71cec..1dd01b4b 100644 --- a/spec/bundler/uri_credentials_filter_spec.rb +++ b/spec/bundler/uri_credentials_filter_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe Bundler::URICredentialsFilter do +RSpec.describe Bundler::URICredentialsFilter do subject { described_class } describe "#credential_filtered_uri" do diff --git a/spec/bundler/worker_spec.rb b/spec/bundler/worker_spec.rb index 786778b0..fbfe6dda 100644 --- a/spec/bundler/worker_spec.rb +++ b/spec/bundler/worker_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" require "bundler/worker" -describe Bundler::Worker do +RSpec.describe Bundler::Worker do let(:size) { 5 } let(:name) { "Spec Worker" } let(:function) { proc {|object, worker_number| [object, worker_number] } } diff --git a/spec/bundler/yaml_serializer_spec.rb b/spec/bundler/yaml_serializer_spec.rb index bf86d2a0..361159e0 100644 --- a/spec/bundler/yaml_serializer_spec.rb +++ b/spec/bundler/yaml_serializer_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" require "bundler/yaml_serializer" -describe Bundler::YAMLSerializer do +RSpec.describe Bundler::YAMLSerializer do subject(:serializer) { Bundler::YAMLSerializer } describe "#dump" do diff --git a/spec/cache/cache_path_spec.rb b/spec/cache/cache_path_spec.rb index 59416288..ec6d6e31 100644 --- a/spec/cache/cache_path_spec.rb +++ b/spec/cache/cache_path_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe "bundle package" do +RSpec.describe "bundle package" do before do gemfile <<-G source "file://#{gem_repo1}" diff --git a/spec/cache/gems_spec.rb b/spec/cache/gems_spec.rb index 19dd16e4..7828c87f 100644 --- a/spec/cache/gems_spec.rb +++ b/spec/cache/gems_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe "bundle cache" do +RSpec.describe "bundle cache" do describe "when there are only gemsources" do before :each do gemfile <<-G diff --git a/spec/cache/git_spec.rb b/spec/cache/git_spec.rb index c15ee26c..b256c8d9 100644 --- a/spec/cache/git_spec.rb +++ b/spec/cache/git_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe "git base name" do +RSpec.describe "git base name" do it "base_name should strip private repo uris" do source = Bundler::Source::Git.new("uri" => "git@github.com:bundler.git") expect(source.send(:base_name)).to eq("bundler") @@ -14,7 +14,7 @@ describe "git base name" do end %w(cache package).each do |cmd| - describe "bundle #{cmd} with git" do + RSpec.describe "bundle #{cmd} with git" do it "copies repository to vendor cache and uses it" do git = build_git "foo" ref = git.ref_for("master", 11) diff --git a/spec/cache/path_spec.rb b/spec/cache/path_spec.rb index 4233b3e8..bbce4487 100644 --- a/spec/cache/path_spec.rb +++ b/spec/cache/path_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" %w(cache package).each do |cmd| - describe "bundle #{cmd} with path" do + RSpec.describe "bundle #{cmd} with path" do it "is no-op when the path is within the bundle" do build_lib "foo", :path => bundled_app("lib/foo") diff --git a/spec/cache/platform_spec.rb b/spec/cache/platform_spec.rb index 259eff0e..ed80c949 100644 --- a/spec/cache/platform_spec.rb +++ b/spec/cache/platform_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe "bundle cache with multiple platforms" do +RSpec.describe "bundle cache with multiple platforms" do before :each do gemfile <<-G source "file://#{gem_repo1}" diff --git a/spec/commands/binstubs_spec.rb b/spec/commands/binstubs_spec.rb index 0f8c5af3..9bb4f2a7 100644 --- a/spec/commands/binstubs_spec.rb +++ b/spec/commands/binstubs_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe "bundle binstubs <gem>" do +RSpec.describe "bundle binstubs <gem>" do context "when the gem exists in the lockfile" do it "sets up the binstub" do install_gemfile <<-G diff --git a/spec/commands/check_spec.rb b/spec/commands/check_spec.rb index 42d64597..532be07c 100644 --- a/spec/commands/check_spec.rb +++ b/spec/commands/check_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe "bundle check" do +RSpec.describe "bundle check" do it "returns success when the Gemfile is satisfied" do install_gemfile <<-G source "file://#{gem_repo1}" diff --git a/spec/commands/clean_spec.rb b/spec/commands/clean_spec.rb index acec0eef..8fd4b6fb 100644 --- a/spec/commands/clean_spec.rb +++ b/spec/commands/clean_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe "bundle clean" do +RSpec.describe "bundle clean" do def should_have_gems(*gems) gems.each do |g| expect(vendored_gems("gems/#{g}")).to exist diff --git a/spec/commands/config_spec.rb b/spec/commands/config_spec.rb index fce6102c..ea0d2a78 100644 --- a/spec/commands/config_spec.rb +++ b/spec/commands/config_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe ".bundle/config" do +RSpec.describe ".bundle/config" do before :each do gemfile <<-G source "file://#{gem_repo1}" @@ -276,7 +276,7 @@ E end end -describe "setting gemfile via config" do +RSpec.describe "setting gemfile via config" do context "when only the non-default Gemfile exists" do it "persists the gemfile location to .bundle/config" do File.open(bundled_app("NotGemfile"), "w") do |f| diff --git a/spec/commands/console_spec.rb b/spec/commands/console_spec.rb index 131b4736..de14b6db 100644 --- a/spec/commands/console_spec.rb +++ b/spec/commands/console_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe "bundle console" do +RSpec.describe "bundle console" do before :each do install_gemfile <<-G source "file://#{gem_repo1}" diff --git a/spec/commands/doctor_spec.rb b/spec/commands/doctor_spec.rb index 8debeb55..7c6e48ce 100644 --- a/spec/commands/doctor_spec.rb +++ b/spec/commands/doctor_spec.rb @@ -4,7 +4,7 @@ require "stringio" require "bundler/cli" require "bundler/cli/doctor" -describe "bundle doctor" do +RSpec.describe "bundle doctor" do before(:each) do @stdout = StringIO.new diff --git a/spec/commands/exec_spec.rb b/spec/commands/exec_spec.rb index cb4daa46..bf20ec7d 100644 --- a/spec/commands/exec_spec.rb +++ b/spec/commands/exec_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe "bundle exec" do +RSpec.describe "bundle exec" do let(:system_gems_to_install) { %w(rack-1.0.0 rack-0.9.1) } before :each do system_gems(system_gems_to_install) diff --git a/spec/commands/help_spec.rb b/spec/commands/help_spec.rb index 380e3be1..017c53cf 100644 --- a/spec/commands/help_spec.rb +++ b/spec/commands/help_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe "bundle help" do +RSpec.describe "bundle help" do # Rubygems 1.4+ no longer load gem plugins so this test is no longer needed rubygems_under_14 = Gem::Requirement.new("< 1.4").satisfied_by?(Gem::Version.new(Gem::VERSION)) it "complains if older versions of bundler are installed", :if => rubygems_under_14 do diff --git a/spec/commands/init_spec.rb b/spec/commands/init_spec.rb index 70d11430..03a46a8b 100644 --- a/spec/commands/init_spec.rb +++ b/spec/commands/init_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe "bundle init" do +RSpec.describe "bundle init" do it "generates a Gemfile" do bundle :init expect(bundled_app("Gemfile")).to exist diff --git a/spec/commands/inject_spec.rb b/spec/commands/inject_spec.rb index d0112915..96209bda 100644 --- a/spec/commands/inject_spec.rb +++ b/spec/commands/inject_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe "bundle inject" do +RSpec.describe "bundle inject" do before :each do gemfile <<-G source "file://#{gem_repo1}" diff --git a/spec/commands/install_spec.rb b/spec/commands/install_spec.rb index 0d05766e..49eee019 100644 --- a/spec/commands/install_spec.rb +++ b/spec/commands/install_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe "bundle install with gem sources" do +RSpec.describe "bundle install with gem sources" do describe "the simple case" do it "prints output and returns if no dependencies are specified" do gemfile <<-G diff --git a/spec/commands/licenses_spec.rb b/spec/commands/licenses_spec.rb index dd9f261e..0ee1a469 100644 --- a/spec/commands/licenses_spec.rb +++ b/spec/commands/licenses_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe "bundle licenses" do +RSpec.describe "bundle licenses" do before :each do install_gemfile <<-G source "file://#{gem_repo1}" diff --git a/spec/commands/lock_spec.rb b/spec/commands/lock_spec.rb index 52dfa23b..52c281a6 100644 --- a/spec/commands/lock_spec.rb +++ b/spec/commands/lock_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe "bundle lock" do +RSpec.describe "bundle lock" do def strip_lockfile(lockfile) strip_whitespace(lockfile).sub(/\n\Z/, "") end diff --git a/spec/commands/newgem_spec.rb b/spec/commands/newgem_spec.rb index 766def16..354a038c 100644 --- a/spec/commands/newgem_spec.rb +++ b/spec/commands/newgem_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe "bundle gem" do +RSpec.describe "bundle gem" do def reset! super global_config "BUNDLE_GEM__MIT" => "false", "BUNDLE_GEM__TEST" => "false", "BUNDLE_GEM__COC" => "false" diff --git a/spec/commands/open_spec.rb b/spec/commands/open_spec.rb index 3bf2983f..6872e859 100644 --- a/spec/commands/open_spec.rb +++ b/spec/commands/open_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe "bundle open" do +RSpec.describe "bundle open" do before :each do install_gemfile <<-G source "file://#{gem_repo1}" diff --git a/spec/commands/outdated_spec.rb b/spec/commands/outdated_spec.rb index e335ee91..eb47557d 100644 --- a/spec/commands/outdated_spec.rb +++ b/spec/commands/outdated_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe "bundle outdated" do +RSpec.describe "bundle outdated" do before :each do build_repo2 do build_git "foo", :path => lib_path("foo") diff --git a/spec/commands/package_spec.rb b/spec/commands/package_spec.rb index a72b94a0..86c09db3 100644 --- a/spec/commands/package_spec.rb +++ b/spec/commands/package_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe "bundle package" do +RSpec.describe "bundle package" do context "with --gemfile" do it "finds the gemfile" do gemfile bundled_app("NotGemfile"), <<-G @@ -222,7 +222,7 @@ describe "bundle package" do end end -describe "bundle install with gem sources" do +RSpec.describe "bundle install with gem sources" do describe "when cached and locked" do it "does not hit the remote at all" do build_repo2 diff --git a/spec/commands/show_spec.rb b/spec/commands/show_spec.rb index 84352c54..240bebcc 100644 --- a/spec/commands/show_spec.rb +++ b/spec/commands/show_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe "bundle show" do +RSpec.describe "bundle show" do context "with a standard Gemfile" do before :each do install_gemfile <<-G diff --git a/spec/commands/update_spec.rb b/spec/commands/update_spec.rb index 63fe951c..bb24c501 100644 --- a/spec/commands/update_spec.rb +++ b/spec/commands/update_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe "bundle update" do +RSpec.describe "bundle update" do before :each do build_repo2 @@ -254,7 +254,7 @@ describe "bundle update" do end end -describe "bundle update in more complicated situations" do +RSpec.describe "bundle update in more complicated situations" do before :each do build_repo2 end @@ -295,7 +295,7 @@ describe "bundle update in more complicated situations" do end end -describe "bundle update without a Gemfile.lock" do +RSpec.describe "bundle update without a Gemfile.lock" do it "should not explode" do build_repo2 @@ -311,7 +311,7 @@ describe "bundle update without a Gemfile.lock" do end end -describe "bundle update when a gem depends on a newer version of bundler" do +RSpec.describe "bundle update when a gem depends on a newer version of bundler" do before(:each) do build_repo2 do build_gem "rails", "3.0.1" do |s| @@ -338,7 +338,7 @@ describe "bundle update when a gem depends on a newer version of bundler" do end end -describe "bundle update" do +RSpec.describe "bundle update" do it "shows the previous version of the gem when updated from rubygems source" do build_repo2 @@ -370,7 +370,7 @@ describe "bundle update" do end end -describe "bundle update --ruby" do +RSpec.describe "bundle update --ruby" do before do install_gemfile <<-G ::RUBY_VERSION = '2.1.3' @@ -480,7 +480,7 @@ describe "bundle update --ruby" do end # these specs are slow and focus on integration and therefore are not exhaustive. unit specs elsewhere handle that. -describe "bundle update conservative" do +RSpec.describe "bundle update conservative" do context "patch and minor options" do before do build_repo4 do diff --git a/spec/commands/viz_spec.rb b/spec/commands/viz_spec.rb index f3fab927..123e7bef 100644 --- a/spec/commands/viz_spec.rb +++ b/spec/commands/viz_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe "bundle viz", :ruby => "1.9.3", :if => Bundler.which("dot") do +RSpec.describe "bundle viz", :ruby => "1.9.3", :if => Bundler.which("dot") do let(:graphviz_lib) do graphviz_glob = base_system_gems.join("gems/ruby-graphviz*/lib") Dir[graphviz_glob].first diff --git a/spec/install/allow_offline_install_spec.rb b/spec/install/allow_offline_install_spec.rb index 44100ca9..1bca055c 100644 --- a/spec/install/allow_offline_install_spec.rb +++ b/spec/install/allow_offline_install_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe "bundle install with :allow_offline_install" do +RSpec.describe "bundle install with :allow_offline_install" do before do bundle "config allow_offline_install true" end diff --git a/spec/install/binstubs_spec.rb b/spec/install/binstubs_spec.rb index a7e0b847..a1a9ab16 100644 --- a/spec/install/binstubs_spec.rb +++ b/spec/install/binstubs_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe "bundle install" do +RSpec.describe "bundle install" do describe "when system_bindir is set" do # On OS X, Gem.bindir defaults to /usr/bin, so system_bindir is useful if # you want to avoid sudo installs for system gems with OS X's default ruby diff --git a/spec/install/bundler_spec.rb b/spec/install/bundler_spec.rb index 9f06a480..2b16fafa 100644 --- a/spec/install/bundler_spec.rb +++ b/spec/install/bundler_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe "bundle install" do +RSpec.describe "bundle install" do describe "with bundler dependencies" do before(:each) do build_repo2 do diff --git a/spec/install/deploy_spec.rb b/spec/install/deploy_spec.rb index 02f9983c..1d97ceb4 100644 --- a/spec/install/deploy_spec.rb +++ b/spec/install/deploy_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe "install with --deployment or --frozen" do +RSpec.describe "install with --deployment or --frozen" do before do gemfile <<-G source "file://#{gem_repo1}" diff --git a/spec/install/force_spec.rb b/spec/install/force_spec.rb index 2027660c..6d852b3b 100644 --- a/spec/install/force_spec.rb +++ b/spec/install/force_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe "bundle install" do +RSpec.describe "bundle install" do describe "with --force" do before :each do gemfile <<-G diff --git a/spec/install/gemfile/eval_gemfile_spec.rb b/spec/install/gemfile/eval_gemfile_spec.rb index 29f27550..4f5a109e 100644 --- a/spec/install/gemfile/eval_gemfile_spec.rb +++ b/spec/install/gemfile/eval_gemfile_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe "bundle install with gemfile that uses eval_gemfile" do +RSpec.describe "bundle install with gemfile that uses eval_gemfile" do before do build_lib("gunks", :path => bundled_app.join("gems/gunks")) do |s| s.name = "gunks" diff --git a/spec/install/gemfile/gemspec_spec.rb b/spec/install/gemfile/gemspec_spec.rb index 69875652..3ed4d116 100644 --- a/spec/install/gemfile/gemspec_spec.rb +++ b/spec/install/gemfile/gemspec_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe "bundle install from an existing gemspec" do +RSpec.describe "bundle install from an existing gemspec" do before(:each) do build_gem "bar", :to_system => true build_gem "bar-dev", :to_system => true diff --git a/spec/install/gemfile/git_spec.rb b/spec/install/gemfile/git_spec.rb index aa5ca7cf..ce639ee8 100644 --- a/spec/install/gemfile/git_spec.rb +++ b/spec/install/gemfile/git_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe "bundle install with git sources" do +RSpec.describe "bundle install with git sources" do describe "when floating on master" do before :each do build_git "foo" do |s| diff --git a/spec/install/gemfile/groups_spec.rb b/spec/install/gemfile/groups_spec.rb index cb052b6c..a3a5eeef 100644 --- a/spec/install/gemfile/groups_spec.rb +++ b/spec/install/gemfile/groups_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe "bundle install with groups" do +RSpec.describe "bundle install with groups" do describe "installing with no options" do before :each do install_gemfile <<-G diff --git a/spec/install/gemfile/path_spec.rb b/spec/install/gemfile/path_spec.rb index 0a733352..a1c41aeb 100644 --- a/spec/install/gemfile/path_spec.rb +++ b/spec/install/gemfile/path_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe "bundle install with explicit source paths" do +RSpec.describe "bundle install with explicit source paths" do it "fetches gems" do build_lib "foo" diff --git a/spec/install/gemfile/platform_spec.rb b/spec/install/gemfile/platform_spec.rb index ebf69f40..3889ad57 100644 --- a/spec/install/gemfile/platform_spec.rb +++ b/spec/install/gemfile/platform_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe "bundle install across platforms" do +RSpec.describe "bundle install across platforms" do it "maintains the same lockfile if all gems are compatible across platforms" do lockfile <<-G GEM @@ -105,7 +105,7 @@ describe "bundle install across platforms" do end end -describe "bundle install with platform conditionals" do +RSpec.describe "bundle install with platform conditionals" do it "installs gems tagged w/ the current platforms" do install_gemfile <<-G source "file://#{gem_repo1}" @@ -223,7 +223,7 @@ The dependency #{Gem::Dependency.new("rack", ">= 0")} will be unused by any of t end end -describe "when a gem has no architecture" do +RSpec.describe "when a gem has no architecture" do it "still installs correctly" do simulate_platform mswin diff --git a/spec/install/gemfile/ruby_spec.rb b/spec/install/gemfile/ruby_spec.rb index 1adbf108..3f895791 100644 --- a/spec/install/gemfile/ruby_spec.rb +++ b/spec/install/gemfile/ruby_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe "ruby requirement" do +RSpec.describe "ruby requirement" do def locked_ruby_version Bundler::RubyVersion.from_string(Bundler::LockfileParser.new(lockfile).ruby_version) end diff --git a/spec/install/gemfile/sources_spec.rb b/spec/install/gemfile/sources_spec.rb index e687e9af..c5375b4a 100644 --- a/spec/install/gemfile/sources_spec.rb +++ b/spec/install/gemfile/sources_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe "bundle install with gems on multiple sources" do +RSpec.describe "bundle install with gems on multiple sources" do # repo1 is built automatically before all of the specs run # it contains rack-obama 1.0.0 and rack 0.9.1 & 1.0.0 amongst other gems diff --git a/spec/install/gemfile/specific_platform_spec.rb b/spec/install/gemfile/specific_platform_spec.rb index 3e12f94c..76ac9765 100644 --- a/spec/install/gemfile/specific_platform_spec.rb +++ b/spec/install/gemfile/specific_platform_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe "bundle install with specific_platform enabled" do +RSpec.describe "bundle install with specific_platform enabled" do before do bundle "config specific_platform true" diff --git a/spec/install/gemfile_spec.rb b/spec/install/gemfile_spec.rb index f6602c05..bc490530 100644 --- a/spec/install/gemfile_spec.rb +++ b/spec/install/gemfile_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe "bundle install" do +RSpec.describe "bundle install" do context "with duplicated gems" do it "will display a warning" do install_gemfile <<-G diff --git a/spec/install/gems/compact_index_spec.rb b/spec/install/gems/compact_index_spec.rb index 04cc5d74..12f82e90 100644 --- a/spec/install/gems/compact_index_spec.rb +++ b/spec/install/gems/compact_index_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe "compact index api" do +RSpec.describe "compact index api" do let(:source_hostname) { "localgemserver.test" } let(:source_uri) { "http://#{source_hostname}" } diff --git a/spec/install/gems/dependency_api_spec.rb b/spec/install/gems/dependency_api_spec.rb index 9d5b7400..d2de0d35 100644 --- a/spec/install/gems/dependency_api_spec.rb +++ b/spec/install/gems/dependency_api_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe "gemcutter's dependency API" do +RSpec.describe "gemcutter's dependency API" do let(:source_hostname) { "localgemserver.test" } let(:source_uri) { "http://#{source_hostname}" } diff --git a/spec/install/gems/env_spec.rb b/spec/install/gems/env_spec.rb index d7d3a323..9b1d8e54 100644 --- a/spec/install/gems/env_spec.rb +++ b/spec/install/gems/env_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe "bundle install with ENV conditionals" do +RSpec.describe "bundle install with ENV conditionals" do describe "when just setting an ENV key as a string" do before :each do gemfile <<-G diff --git a/spec/install/gems/flex_spec.rb b/spec/install/gems/flex_spec.rb index 2f900893..2c2d3c16 100644 --- a/spec/install/gems/flex_spec.rb +++ b/spec/install/gems/flex_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe "bundle flex_install" do +RSpec.describe "bundle flex_install" do it "installs the gems as expected" do install_gemfile <<-G source "file://#{gem_repo1}" diff --git a/spec/install/gems/mirror_spec.rb b/spec/install/gems/mirror_spec.rb index e7b4317f..798156fb 100644 --- a/spec/install/gems/mirror_spec.rb +++ b/spec/install/gems/mirror_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe "bundle install with a mirror configured" do +RSpec.describe "bundle install with a mirror configured" do describe "when the mirror does not match the gem source" do before :each do gemfile <<-G diff --git a/spec/install/gems/native_extensions_spec.rb b/spec/install/gems/native_extensions_spec.rb index 6134663f..3b146495 100644 --- a/spec/install/gems/native_extensions_spec.rb +++ b/spec/install/gems/native_extensions_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe "installing a gem with native extensions" do +RSpec.describe "installing a gem with native extensions" do it "installs" do build_repo2 do build_gem "c_extension" do |s| diff --git a/spec/install/gems/post_install_spec.rb b/spec/install/gems/post_install_spec.rb index 596fa641..c3ea3e7c 100644 --- a/spec/install/gems/post_install_spec.rb +++ b/spec/install/gems/post_install_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe "bundle install" do +RSpec.describe "bundle install" do context "with gem sources" do context "when gems include post install messages" do it "should display the post-install messages after installing" do diff --git a/spec/install/gems/resolving_spec.rb b/spec/install/gems/resolving_spec.rb index 0204a222..c2279934 100644 --- a/spec/install/gems/resolving_spec.rb +++ b/spec/install/gems/resolving_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe "bundle install with install-time dependencies" do +RSpec.describe "bundle install with install-time dependencies" do it "installs gems with implicit rake dependencies" do install_gemfile <<-G source "file://#{gem_repo1}" diff --git a/spec/install/gems/standalone_spec.rb b/spec/install/gems/standalone_spec.rb index 7a6749de..e1bc0a3d 100644 --- a/spec/install/gems/standalone_spec.rb +++ b/spec/install/gems/standalone_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -shared_examples "bundle install --standalone" do +RSpec.shared_examples "bundle install --standalone" do shared_examples "common functionality" do it "still makes the gems available to normal bundler" do args = expected_gems.map {|k, v| "#{k} #{v}" } @@ -303,11 +303,11 @@ shared_examples "bundle install --standalone" do end end -describe "bundle install --standalone" do +RSpec.describe "bundle install --standalone" do include_examples("bundle install --standalone") end -describe "bundle install --standalone run in a subdirectory" do +RSpec.describe "bundle install --standalone run in a subdirectory" do before do subdir = bundled_app("bob") FileUtils.mkdir_p(subdir) diff --git a/spec/install/gems/sudo_spec.rb b/spec/install/gems/sudo_spec.rb index 66b99018..13abffc1 100644 --- a/spec/install/gems/sudo_spec.rb +++ b/spec/install/gems/sudo_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe "when using sudo", :sudo => true do +RSpec.describe "when using sudo", :sudo => true do describe "and BUNDLE_PATH is writable" do context "but BUNDLE_PATH/build_info is not writable" do before do diff --git a/spec/install/gems/win32_spec.rb b/spec/install/gems/win32_spec.rb index 69ea035f..cdad9a88 100644 --- a/spec/install/gems/win32_spec.rb +++ b/spec/install/gems/win32_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe "bundle install with win32-generated lockfile" do +RSpec.describe "bundle install with win32-generated lockfile" do it "should read lockfile" do File.open(bundled_app("Gemfile.lock"), "wb") do |f| f << "GEM\r\n" diff --git a/spec/install/gemspecs_spec.rb b/spec/install/gemspecs_spec.rb index 8f719bf6..97eaf149 100644 --- a/spec/install/gemspecs_spec.rb +++ b/spec/install/gemspecs_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe "bundle install" do +RSpec.describe "bundle install" do describe "when a gem has a YAML gemspec" do before :each do build_repo2 do diff --git a/spec/install/git_spec.rb b/spec/install/git_spec.rb index f35a5435..a5558220 100644 --- a/spec/install/git_spec.rb +++ b/spec/install/git_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe "bundle install" do +RSpec.describe "bundle install" do context "git sources" do it "displays the revision hash of the gem repository" do build_git "foo", "1.0", :path => lib_path("foo") diff --git a/spec/install/path_spec.rb b/spec/install/path_spec.rb index 9a8d61ea..ad6071d2 100644 --- a/spec/install/path_spec.rb +++ b/spec/install/path_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe "bundle install" do +RSpec.describe "bundle install" do describe "with --path" do before :each do build_gem "rack", "1.0.0", :to_system => true do |s| diff --git a/spec/install/post_bundle_message_spec.rb b/spec/install/post_bundle_message_spec.rb index 7e2eacfb..69f9256c 100644 --- a/spec/install/post_bundle_message_spec.rb +++ b/spec/install/post_bundle_message_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe "post bundle message" do +RSpec.describe "post bundle message" do before :each do gemfile <<-G source "file://#{gem_repo1}" diff --git a/spec/install/prereleases_spec.rb b/spec/install/prereleases_spec.rb index cbf99ca9..6c32094d 100644 --- a/spec/install/prereleases_spec.rb +++ b/spec/install/prereleases_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe "bundle install" do +RSpec.describe "bundle install" do describe "when prerelease gems are available" do it "finds prereleases" do install_gemfile <<-G diff --git a/spec/install/security_policy_spec.rb b/spec/install/security_policy_spec.rb index 7e2c320b..ab531bda 100644 --- a/spec/install/security_policy_spec.rb +++ b/spec/install/security_policy_spec.rb @@ -5,7 +5,7 @@ require "rubygems/security" # unfortunately, testing signed gems with a provided CA is extremely difficult # as 'gem cert' is currently the only way to add CAs to the system. -describe "policies with unsigned gems" do +RSpec.describe "policies with unsigned gems" do before do build_security_repo gemfile <<-G @@ -44,7 +44,7 @@ describe "policies with unsigned gems" do end end -describe "policies with signed gems and no CA" do +RSpec.describe "policies with signed gems and no CA" do before do build_security_repo gemfile <<-G diff --git a/spec/install/yanked_spec.rb b/spec/install/yanked_spec.rb index 4c0c4e40..d42978ce 100644 --- a/spec/install/yanked_spec.rb +++ b/spec/install/yanked_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -context "when installing a bundle that includes yanked gems" do +RSpec.context "when installing a bundle that includes yanked gems" do before(:each) do build_repo4 do build_gem "foo", "9.0.0" @@ -42,7 +42,7 @@ context "when installing a bundle that includes yanked gems" do end end -context "when using gem before installing" do +RSpec.context "when using gem before installing" do it "does not suggest the author has yanked the gem" do gemfile <<-G source "file://#{gem_repo1}" diff --git a/spec/lock/git_spec.rb b/spec/lock/git_spec.rb index 93473db0..b36f6133 100644 --- a/spec/lock/git_spec.rb +++ b/spec/lock/git_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe "bundle lock with git gems" do +RSpec.describe "bundle lock with git gems" do before :each do build_git "foo" diff --git a/spec/lock/lockfile_spec.rb b/spec/lock/lockfile_spec.rb index e6810b40..8ff6b1a7 100644 --- a/spec/lock/lockfile_spec.rb +++ b/spec/lock/lockfile_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe "the lockfile format" do +RSpec.describe "the lockfile format" do include Bundler::GemHelpers it "generates a simple lockfile for a single source, gem" do diff --git a/spec/other/bundle_ruby_spec.rb b/spec/other/bundle_ruby_spec.rb index 4b2ebf4c..09fa2c22 100644 --- a/spec/other/bundle_ruby_spec.rb +++ b/spec/other/bundle_ruby_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe "bundle_ruby" do +RSpec.describe "bundle_ruby" do context "without patchlevel" do it "returns the ruby version" do gemfile <<-G diff --git a/spec/other/cli_dispatch_spec.rb b/spec/other/cli_dispatch_spec.rb index 05dac515..8b34a457 100644 --- a/spec/other/cli_dispatch_spec.rb +++ b/spec/other/cli_dispatch_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe "bundle command names" do +RSpec.describe "bundle command names" do it "work when given fully" do bundle "install" expect(err).to lack_errors diff --git a/spec/other/ext_spec.rb b/spec/other/ext_spec.rb index 7e2e7128..9aed37ad 100644 --- a/spec/other/ext_spec.rb +++ b/spec/other/ext_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe "Gem::Specification#match_platform" do +RSpec.describe "Gem::Specification#match_platform" do it "does not match platforms other than the gem platform" do darwin = gem "lol", "1.0", "platform_specific-1.0-x86-darwin-10" expect(darwin.match_platform(pl("java"))).to eq(false) @@ -16,7 +16,7 @@ describe "Gem::Specification#match_platform" do end end -describe "Bundler::GemHelpers#generic" do +RSpec.describe "Bundler::GemHelpers#generic" do include Bundler::GemHelpers it "converts non-windows platforms into ruby" do @@ -47,7 +47,7 @@ describe "Bundler::GemHelpers#generic" do end end -describe "Gem::SourceIndex#refresh!" do +RSpec.describe "Gem::SourceIndex#refresh!" do rubygems_1_7 = Gem::Version.new(Gem::VERSION) >= Gem::Version.new("1.7.0") before do diff --git a/spec/other/major_deprecation_spec.rb b/spec/other/major_deprecation_spec.rb index 3fc3d06d..1ef17bfa 100644 --- a/spec/other/major_deprecation_spec.rb +++ b/spec/other/major_deprecation_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe "major deprecations" do +RSpec.describe "major deprecations" do let(:warnings) { out } # change to err in 2.0 context "in a .99 version" do diff --git a/spec/other/platform_spec.rb b/spec/other/platform_spec.rb index 7aa0d0f8..6adbcef1 100644 --- a/spec/other/platform_spec.rb +++ b/spec/other/platform_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe "bundle platform" do +RSpec.describe "bundle platform" do context "without flags" do it "returns all the output" do gemfile <<-G diff --git a/spec/other/ssl_cert_spec.rb b/spec/other/ssl_cert_spec.rb index e1a134c9..2de4dfdd 100644 --- a/spec/other/ssl_cert_spec.rb +++ b/spec/other/ssl_cert_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" require "bundler/ssl_certs/certificate_manager" -describe "SSL Certificates", :rubygems_master do +RSpec.describe "SSL Certificates", :rubygems_master do hosts = %w( rubygems.org index.rubygems.org diff --git a/spec/other/trampoline_spec.rb b/spec/other/trampoline_spec.rb index 88e0302f..39de7048 100644 --- a/spec/other/trampoline_spec.rb +++ b/spec/other/trampoline_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe "bundler version trampolining" do +RSpec.describe "bundler version trampolining" do before do ENV["BUNDLE_TRAMPOLINE_DISABLE"] = nil ENV["BUNDLE_TRAMPOLINE_FORCE"] = "true" diff --git a/spec/plugins/command_spec.rb b/spec/plugins/command_spec.rb index 71e87a5b..6ad782b7 100644 --- a/spec/plugins/command_spec.rb +++ b/spec/plugins/command_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe "command plugins" do +RSpec.describe "command plugins" do before do build_repo2 do build_plugin "command-mah" do |s| diff --git a/spec/plugins/hook_spec.rb b/spec/plugins/hook_spec.rb index bafe688d..9850d850 100644 --- a/spec/plugins/hook_spec.rb +++ b/spec/plugins/hook_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe "hook plugins" do +RSpec.describe "hook plugins" do before do build_repo2 do build_plugin "before-install-plugin" do |s| diff --git a/spec/plugins/install_spec.rb b/spec/plugins/install_spec.rb index a24f3181..4ce9e46b 100644 --- a/spec/plugins/install_spec.rb +++ b/spec/plugins/install_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe "bundler plugin install" do +RSpec.describe "bundler plugin install" do before do build_repo2 do build_plugin "foo" diff --git a/spec/plugins/source/example_spec.rb b/spec/plugins/source/example_spec.rb index 520e1b9d..2ae34caf 100644 --- a/spec/plugins/source/example_spec.rb +++ b/spec/plugins/source/example_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe "real source plugins" do +RSpec.describe "real source plugins" do context "with a minimal source plugin" do before do build_repo2 do diff --git a/spec/plugins/source_spec.rb b/spec/plugins/source_spec.rb index 92e948c1..0448bc40 100644 --- a/spec/plugins/source_spec.rb +++ b/spec/plugins/source_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe "bundler source plugin" do +RSpec.describe "bundler source plugin" do describe "plugins dsl eval for #source with :type option" do before do update_repo2 do diff --git a/spec/quality_spec.rb b/spec/quality_spec.rb index 9148bf51..5781d187 100644 --- a/spec/quality_spec.rb +++ b/spec/quality_spec.rb @@ -6,7 +6,7 @@ if defined?(Encoding) && Encoding.default_external.name != "UTF-8" Encoding.default_external = Encoding.find("UTF-8") end -describe "The library itself" do +RSpec.describe "The library itself" do def check_for_spec_defs_with_single_quotes(filename) failing_lines = [] diff --git a/spec/realworld/dependency_api_spec.rb b/spec/realworld/dependency_api_spec.rb index ea02adfe..468fa364 100644 --- a/spec/realworld/dependency_api_spec.rb +++ b/spec/realworld/dependency_api_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe "gemcutter's dependency API", :realworld => true do +RSpec.describe "gemcutter's dependency API", :realworld => true do context "when Gemcutter API takes too long to respond" do before do require_rack diff --git a/spec/realworld/edgecases_spec.rb b/spec/realworld/edgecases_spec.rb index 81fe3d77..302fd57c 100644 --- a/spec/realworld/edgecases_spec.rb +++ b/spec/realworld/edgecases_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe "real world edgecases", :realworld => true, :sometimes => true do +RSpec.describe "real world edgecases", :realworld => true, :sometimes => true do def rubygems_version(name, requirement) require "bundler/source/rubygems/remote" require "bundler/fetcher" @@ -94,6 +94,142 @@ describe "real world edgecases", :realworld => true, :sometimes => true do expect(lockfile).to include(rubygems_version("activesupport", "~> 3.0")) end + it "is able to update a top-level dependency when there is a conflict on a shared transitive child", :ruby => "2.1" do + # from https://github.com/bundler/bundler/issues/5031 + + gemfile <<-G + source "https://rubygems.org" + gem 'rails', '~> 4.2.7.1' + gem 'paperclip', '~> 5.1.0' + G + + lockfile <<-L + GEM + remote: https://rubygems.org/ + specs: + actionmailer (4.2.7.1) + actionpack (= 4.2.7.1) + actionview (= 4.2.7.1) + activejob (= 4.2.7.1) + mail (~> 2.5, >= 2.5.4) + rails-dom-testing (~> 1.0, >= 1.0.5) + actionpack (4.2.7.1) + actionview (= 4.2.7.1) + activesupport (= 4.2.7.1) + rack (~> 1.6) + rack-test (~> 0.6.2) + rails-dom-testing (~> 1.0, >= 1.0.5) + rails-html-sanitizer (~> 1.0, >= 1.0.2) + actionview (4.2.7.1) + activesupport (= 4.2.7.1) + builder (~> 3.1) + erubis (~> 2.7.0) + rails-dom-testing (~> 1.0, >= 1.0.5) + rails-html-sanitizer (~> 1.0, >= 1.0.2) + activejob (4.2.7.1) + activesupport (= 4.2.7.1) + globalid (>= 0.3.0) + activemodel (4.2.7.1) + activesupport (= 4.2.7.1) + builder (~> 3.1) + activerecord (4.2.7.1) + activemodel (= 4.2.7.1) + activesupport (= 4.2.7.1) + arel (~> 6.0) + activesupport (4.2.7.1) + i18n (~> 0.7) + json (~> 1.7, >= 1.7.7) + minitest (~> 5.1) + thread_safe (~> 0.3, >= 0.3.4) + tzinfo (~> 1.1) + arel (6.0.3) + builder (3.2.2) + climate_control (0.0.3) + activesupport (>= 3.0) + cocaine (0.5.8) + climate_control (>= 0.0.3, < 1.0) + concurrent-ruby (1.0.2) + erubis (2.7.0) + globalid (0.3.7) + activesupport (>= 4.1.0) + i18n (0.7.0) + json (1.8.3) + loofah (2.0.3) + nokogiri (>= 1.5.9) + mail (2.6.4) + mime-types (>= 1.16, < 4) + mime-types (3.1) + mime-types-data (~> 3.2015) + mime-types-data (3.2016.0521) + mimemagic (0.3.2) + mini_portile2 (2.1.0) + minitest (5.9.1) + nokogiri (1.6.8) + mini_portile2 (~> 2.1.0) + pkg-config (~> 1.1.7) + paperclip (5.1.0) + activemodel (>= 4.2.0) + activesupport (>= 4.2.0) + cocaine (~> 0.5.5) + mime-types + mimemagic (~> 0.3.0) + pkg-config (1.1.7) + rack (1.6.4) + rack-test (0.6.3) + rack (>= 1.0) + rails (4.2.7.1) + actionmailer (= 4.2.7.1) + actionpack (= 4.2.7.1) + actionview (= 4.2.7.1) + activejob (= 4.2.7.1) + activemodel (= 4.2.7.1) + activerecord (= 4.2.7.1) + activesupport (= 4.2.7.1) + bundler (>= 1.3.0, < 2.0) + railties (= 4.2.7.1) + sprockets-rails + rails-deprecated_sanitizer (1.0.3) + activesupport (>= 4.2.0.alpha) + rails-dom-testing (1.0.7) + activesupport (>= 4.2.0.beta, < 5.0) + nokogiri (~> 1.6.0) + rails-deprecated_sanitizer (>= 1.0.1) + rails-html-sanitizer (1.0.3) + loofah (~> 2.0) + railties (4.2.7.1) + actionpack (= 4.2.7.1) + activesupport (= 4.2.7.1) + rake (>= 0.8.7) + thor (>= 0.18.1, < 2.0) + rake (11.3.0) + sprockets (3.7.0) + concurrent-ruby (~> 1.0) + rack (> 1, < 3) + sprockets-rails (3.2.0) + actionpack (>= 4.0) + activesupport (>= 4.0) + sprockets (>= 3.0.0) + thor (0.19.1) + thread_safe (0.3.5) + tzinfo (1.2.2) + thread_safe (~> 0.1) + + PLATFORMS + ruby + + DEPENDENCIES + paperclip (~> 5.1.0) + rails (~> 4.2.7.1) + + BUNDLED WITH + 1.13.1 + L + + bundle! "lock --update paperclip" + + expect(lockfile).to include(rubygems_version("paperclip", "~> 5.1.0")) + end + # https://github.com/bundler/bundler/issues/1500 it "does not fail install because of gem plugins" do realworld_system_gems("open_gem --version 1.4.2", "rake --version 0.9.2") diff --git a/spec/realworld/gemfile_source_header_spec.rb b/spec/realworld/gemfile_source_header_spec.rb index 95935f76..ba888d43 100644 --- a/spec/realworld/gemfile_source_header_spec.rb +++ b/spec/realworld/gemfile_source_header_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" require "thread" -describe "fetching dependencies with a mirrored source", :realworld => true, :rubygems => ">= 2.0" do +RSpec.describe "fetching dependencies with a mirrored source", :realworld => true, :rubygems => ">= 2.0" do let(:mirror) { "https://server.example.org" } let(:original) { "http://127.0.0.1:#{@port}" } diff --git a/spec/realworld/mirror_probe_spec.rb b/spec/realworld/mirror_probe_spec.rb index 5a4a4a1b..93dca0c1 100644 --- a/spec/realworld/mirror_probe_spec.rb +++ b/spec/realworld/mirror_probe_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" require "thread" -describe "fetching dependencies with a not available mirror", :realworld => true do +RSpec.describe "fetching dependencies with a not available mirror", :realworld => true do let(:mirror) { @mirror_uri } let(:original) { @server_uri } let(:server_port) { @server_port } diff --git a/spec/realworld/parallel_spec.rb b/spec/realworld/parallel_spec.rb index 539b8ab2..6950bead 100644 --- a/spec/realworld/parallel_spec.rb +++ b/spec/realworld/parallel_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe "parallel", :realworld => true, :sometimes => true do +RSpec.describe "parallel", :realworld => true, :sometimes => true do it "installs" do gemfile <<-G source "https://rubygems.org" diff --git a/spec/resolver/basic_spec.rb b/spec/resolver/basic_spec.rb index e3187726..69881d10 100644 --- a/spec/resolver/basic_spec.rb +++ b/spec/resolver/basic_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe "Resolving" do +RSpec.describe "Resolving" do before :each do @index = an_awesome_index end diff --git a/spec/resolver/platform_spec.rb b/spec/resolver/platform_spec.rb index fa91eab9..90d6f637 100644 --- a/spec/resolver/platform_spec.rb +++ b/spec/resolver/platform_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe "Resolving platform craziness" do +RSpec.describe "Resolving platform craziness" do describe "with cross-platform gems" do before :each do @index = an_awesome_index diff --git a/spec/runtime/executable_spec.rb b/spec/runtime/executable_spec.rb index 1ce65bd5..ff27d0b4 100644 --- a/spec/runtime/executable_spec.rb +++ b/spec/runtime/executable_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe "Running bin/* commands" do +RSpec.describe "Running bin/* commands" do before :each do gemfile <<-G source "file://#{gem_repo1}" diff --git a/spec/runtime/gem_tasks_spec.rb b/spec/runtime/gem_tasks_spec.rb index c187efd6..422ec454 100644 --- a/spec/runtime/gem_tasks_spec.rb +++ b/spec/runtime/gem_tasks_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe "require 'bundler/gem_tasks'" do +RSpec.describe "require 'bundler/gem_tasks'" do before :each do bundled_app("foo.gemspec").open("w") do |f| f.write <<-GEMSPEC diff --git a/spec/runtime/inline_spec.rb b/spec/runtime/inline_spec.rb index 15f37236..573de4af 100644 --- a/spec/runtime/inline_spec.rb +++ b/spec/runtime/inline_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe "bundler/inline#gemfile" do +RSpec.describe "bundler/inline#gemfile" do def script(code, options = {}) requires = ["bundler/inline"] requires.unshift File.expand_path("../../support/artifice/" + options.delete(:artifice) + ".rb", __FILE__) if options.key?(:artifice) @@ -232,4 +232,22 @@ describe "bundler/inline#gemfile" do expect(err).to be_empty expect(exitstatus).to be_zero if exitstatus end + + it "installs inline gems when BUNDLE_GEMFILE is set to an empty string" do + ENV["BUNDLE_GEMFILE"] = "" + + in_app_root do + script <<-RUBY + gemfile do + source "file://#{gem_repo1}" + gem "rack" + end + + puts RACK + RUBY + end + + expect(err).to be_empty + expect(exitstatus).to be_zero if exitstatus + end end diff --git a/spec/runtime/load_spec.rb b/spec/runtime/load_spec.rb index 93c80731..d0e308ed 100644 --- a/spec/runtime/load_spec.rb +++ b/spec/runtime/load_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe "Bundler.load" do +RSpec.describe "Bundler.load" do before :each do system_gems "rack-1.0.0" end diff --git a/spec/runtime/platform_spec.rb b/spec/runtime/platform_spec.rb index 4fd09cf4..be1005e8 100644 --- a/spec/runtime/platform_spec.rb +++ b/spec/runtime/platform_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe "Bundler.setup with multi platform stuff" do +RSpec.describe "Bundler.setup with multi platform stuff" do it "raises a friendly error when gems are missing locally" do gemfile <<-G source "file://#{gem_repo1}" diff --git a/spec/runtime/require_spec.rb b/spec/runtime/require_spec.rb index ef88f912..97248e2c 100644 --- a/spec/runtime/require_spec.rb +++ b/spec/runtime/require_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe "Bundler.require" do +RSpec.describe "Bundler.require" do before :each do build_lib "one", "1.0.0" do |s| s.write "lib/baz.rb", "puts 'baz'" @@ -362,7 +362,7 @@ describe "Bundler.require" do end end -describe "Bundler.require with platform specific dependencies" do +RSpec.describe "Bundler.require with platform specific dependencies" do it "does not require the gems that are pinned to other platforms" do install_gemfile <<-G source "file://#{gem_repo1}" diff --git a/spec/runtime/setup_spec.rb b/spec/runtime/setup_spec.rb index 1251f25d..09e88630 100644 --- a/spec/runtime/setup_spec.rb +++ b/spec/runtime/setup_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe "Bundler.setup" do +RSpec.describe "Bundler.setup" do describe "with no arguments" do it "makes all groups available" do install_gemfile <<-G diff --git a/spec/runtime/with_clean_env_spec.rb b/spec/runtime/with_clean_env_spec.rb index 294233a5..b351e86c 100644 --- a/spec/runtime/with_clean_env_spec.rb +++ b/spec/runtime/with_clean_env_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe "Bundler.with_env helpers" do +RSpec.describe "Bundler.with_env helpers" do describe "Bundler.original_env" do before do gemfile "" diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 5574c4ae..53b75275 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -65,6 +65,14 @@ RSpec.configure do |config| # Enable flags like --only-failures and --next-failure config.example_status_persistence_file_path = ".rspec_status" + config.disable_monkey_patching! + + # Since failures cause us to keep a bunch of long strings in memory, stop + # once we have a large number of failures (indicative of core pieces of + # bundler being broken) so that running the full test suite doesn't take + # forever due to memory constraints + config.fail_fast ||= 25 + if ENV["BUNDLER_SUDO_TESTS"] && Spec::Sudo.present? config.filter_run :sudo => true else diff --git a/spec/support/hax.rb b/spec/support/hax.rb index d00bf619..663d3527 100644 --- a/spec/support/hax.rb +++ b/spec/support/hax.rb @@ -10,6 +10,7 @@ end if ENV["BUNDLER_SPEC_VERSION"] module Bundler + remove_const(:VERSION) if const_defined?(:VERSION) VERSION = ENV["BUNDLER_SPEC_VERSION"].dup end end diff --git a/spec/update/gems/post_install_spec.rb b/spec/update/gems/post_install_spec.rb index 0e3683e7..5a4fe7f3 100644 --- a/spec/update/gems/post_install_spec.rb +++ b/spec/update/gems/post_install_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe "bundle update" do +RSpec.describe "bundle update" do let(:config) {} before do diff --git a/spec/update/git_spec.rb b/spec/update/git_spec.rb index b67ddda2..021c8c94 100644 --- a/spec/update/git_spec.rb +++ b/spec/update/git_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe "bundle update" do +RSpec.describe "bundle update" do describe "git sources" do it "floats on a branch when :branch is used" do build_git "foo", "1.0" diff --git a/spec/update/path_spec.rb b/spec/update/path_spec.rb index aa220ad6..5ac4f7b1 100644 --- a/spec/update/path_spec.rb +++ b/spec/update/path_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "spec_helper" -describe "path sources" do +RSpec.describe "path sources" do describe "bundle update --source" do it "shows the previous version of the gem when updated from path source" do build_lib "activesupport", "2.3.5", :path => lib_path("rails/activesupport") |