diff options
author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2019-02-22 11:03:01 +0100 |
---|---|---|
committer | David RodrÃguez <deivid.rodriguez@riseup.net> | 2019-02-25 21:07:46 +0100 |
commit | 7c8597c486c9efcd708e0314584f78e08fbc03ce (patch) | |
tree | 73af2f7d048dc4f315c8efff4b4dcdf6376307a0 | |
parent | ad9fee2cbd1d0edf029cf91824b38481fad06790 (diff) | |
download | bundler-7c8597c486c9efcd708e0314584f78e08fbc03ce.tar.gz |
Remove unnecessary rubygems filters from specs
-rw-r--r-- | spec/bundler/friendly_errors_spec.rb | 17 | ||||
-rw-r--r-- | spec/bundler/installer/gem_installer_spec.rb | 4 | ||||
-rw-r--r-- | spec/bundler/rubygems_integration_spec.rb | 22 | ||||
-rw-r--r-- | spec/commands/clean_spec.rb | 4 | ||||
-rw-r--r-- | spec/commands/exec_spec.rb | 18 | ||||
-rw-r--r-- | spec/commands/help_spec.rb | 9 | ||||
-rw-r--r-- | spec/commands/install_spec.rb | 2 | ||||
-rw-r--r-- | spec/commands/newgem_spec.rb | 6 | ||||
-rw-r--r-- | spec/commands/show_spec.rb | 2 | ||||
-rw-r--r-- | spec/install/gemfile/gemspec_spec.rb | 2 | ||||
-rw-r--r-- | spec/install/gemfile/git_spec.rb | 6 | ||||
-rw-r--r-- | spec/install/gemfile/path_spec.rb | 2 | ||||
-rw-r--r-- | spec/install/gems/compact_index_spec.rb | 2 | ||||
-rw-r--r-- | spec/install/gems/standalone_spec.rb | 2 | ||||
-rw-r--r-- | spec/install/gems/sudo_spec.rb | 2 | ||||
-rw-r--r-- | spec/install/global_cache_spec.rb | 2 | ||||
-rw-r--r-- | spec/install/path_spec.rb | 2 | ||||
-rw-r--r-- | spec/other/ext_spec.rb | 7 | ||||
-rw-r--r-- | spec/other/platform_spec.rb | 2 | ||||
-rw-r--r-- | spec/realworld/gemfile_source_header_spec.rb | 2 | ||||
-rw-r--r-- | spec/runtime/require_spec.rb | 4 | ||||
-rw-r--r-- | spec/runtime/setup_spec.rb | 2 |
22 files changed, 33 insertions, 88 deletions
diff --git a/spec/bundler/friendly_errors_spec.rb b/spec/bundler/friendly_errors_spec.rb index 9fff7c01be..4ca1e543c1 100644 --- a/spec/bundler/friendly_errors_spec.rb +++ b/spec/bundler/friendly_errors_spec.rb @@ -16,22 +16,7 @@ RSpec.describe Bundler, "friendly errors" do FileUtils.rm(Gem.configuration.config_file_name) end - it "reports a relevant friendly error message", :rubygems => "< 2.5.0" do - gemfile <<-G - source "file://#{gem_repo1}" - gem "rack" - G - - bundle :install, :env => { "DEBUG" => true } - - expect(out).to include("Your RubyGems configuration") - expect(out).to include("invalid YAML syntax") - expect(out).to include("Psych::SyntaxError") - expect(out).not_to include("ERROR REPORT TEMPLATE") - expect(exitstatus).to eq(25) if exitstatus - end - - it "reports a relevant friendly error message", :rubygems => ">= 2.5.0" do + it "reports a relevant friendly error message" do gemfile <<-G source "file://#{gem_repo1}" gem "rack" diff --git a/spec/bundler/installer/gem_installer_spec.rb b/spec/bundler/installer/gem_installer_spec.rb index 7340a3acc0..f559c5e141 100644 --- a/spec/bundler/installer/gem_installer_spec.rb +++ b/spec/bundler/installer/gem_installer_spec.rb @@ -10,14 +10,14 @@ RSpec.describe Bundler::GemInstaller do subject { described_class.new(spec, installer) } context "spec_settings is nil" do - it "invokes install method with empty build_args", :rubygems => ">= 2" do + it "invokes install method with empty build_args" do allow(spec_source).to receive(:install).with(spec, :force => false, :ensure_builtin_gems_cached => false, :build_args => []) subject.install_from_spec end end context "spec_settings is build option" do - it "invokes install method with build_args", :rubygems => ">= 2" do + it "invokes install method with build_args" do allow(Bundler.settings).to receive(:[]).with(:bin) allow(Bundler.settings).to receive(:[]).with(:inline) allow(Bundler.settings).to receive(:[]).with(:forget_cli_options) diff --git a/spec/bundler/rubygems_integration_spec.rb b/spec/bundler/rubygems_integration_spec.rb index b1b15d9e5d..26cbaa630b 100644 --- a/spec/bundler/rubygems_integration_spec.rb +++ b/spec/bundler/rubygems_integration_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true RSpec.describe Bundler::RubygemsIntegration do - it "uses the same chdir lock as rubygems", :rubygems => "2.1" do + it "uses the same chdir lock as rubygems" do expect(Bundler.rubygems.ext_lock).to eq(Gem::Ext::Builder::CHDIR_MONITOR) end @@ -15,30 +15,18 @@ RSpec.describe Bundler::RubygemsIntegration do end subject { Bundler.rubygems.validate(spec) } - it "skips overly-strict gemspec validation", :rubygems => "< 1.7" do - expect(spec).to_not receive(:validate) - subject - end - - it "validates with packaging mode disabled", :rubygems => "1.7" do + it "validates with packaging mode disabled" do expect(spec).to receive(:validate).with(false) subject end - it "should set a summary to avoid an overly-strict error", :rubygems => "~> 1.7.0" do - spec.summary = nil - expect { subject }.not_to raise_error - expect(spec.summary).to eq("") - end - context "with an invalid spec" do before do expect(spec).to receive(:validate).with(false). and_raise(Gem::InvalidSpecificationException.new("TODO is not an author")) end - it "should raise a Gem::InvalidSpecificationException and produce a helpful warning message", - :rubygems => "1.7" do + it "should raise a Gem::InvalidSpecificationException and produce a helpful warning message" do expect { subject }.to raise_error(Gem::InvalidSpecificationException, "The gemspec at #{__FILE__} is not valid. "\ "Please fix this gemspec.\nThe validation error was 'TODO is not an author'\n") @@ -53,7 +41,7 @@ RSpec.describe Bundler::RubygemsIntegration do end end - describe "#download_gem", :rubygems => ">= 2.0" do + describe "#download_gem" do let(:bundler_retry) { double(Bundler::Retry) } let(:retry) { double("Bundler::Retry") } let(:uri) { URI.parse("https://foo.bar") } @@ -78,7 +66,7 @@ RSpec.describe Bundler::RubygemsIntegration do end end - describe "#fetch_all_remote_specs", :rubygems => ">= 2.0" do + describe "#fetch_all_remote_specs" do let(:uri) { URI("https://example.com") } let(:fetcher) { double("gem_remote_fetcher") } let(:specs_response) { Marshal.dump(["specs"]) } diff --git a/spec/commands/clean_spec.rb b/spec/commands/clean_spec.rb index 5c4f1462ef..6cd796f694 100644 --- a/spec/commands/clean_spec.rb +++ b/spec/commands/clean_spec.rb @@ -714,7 +714,7 @@ RSpec.describe "bundle clean" do should_not_have_gems "foo-1.0" end - it "doesn't remove extensions artifacts from bundled git gems after clean", :ruby_repo, :rubygems => "2.2" do + it "doesn't remove extensions artifacts from bundled git gems after clean", :ruby_repo do build_git "very_simple_git_binary", &:add_c_extension revision = revision_for(lib_path("very_simple_git_binary-1.0")) @@ -736,7 +736,7 @@ RSpec.describe "bundle clean" do expect(vendored_gems("bundler/gems/very_simple_git_binary-1.0-#{revision[0..11]}")).to exist end - it "removes extension directories", :ruby_repo, :rubygems => "2.2" do + it "removes extension directories", :ruby_repo do gemfile <<-G source "file://#{gem_repo1}" diff --git a/spec/commands/exec_spec.rb b/spec/commands/exec_spec.rb index 8b394468ea..fd76caf2c4 100644 --- a/spec/commands/exec_spec.rb +++ b/spec/commands/exec_spec.rb @@ -224,7 +224,7 @@ RSpec.describe "bundle exec" do expect(err).to include("bundler: exec needs a command to run") end - it "raises a helpful error when exec'ing to something outside of the bundle", :ruby_repo, :rubygems => ">= 2.5.2" do + it "raises a helpful error when exec'ing to something outside of the bundle", :ruby_repo do bundle! "config clean false" # want to keep the rackup binstub install_gemfile! <<-G source "file://#{gem_repo1}" @@ -237,20 +237,6 @@ RSpec.describe "bundle exec" do end end - # Different error message on old RG versions (before activate_bin_path) because they - # called `Kernel#gem` directly - it "raises a helpful error when exec'ing to something outside of the bundle", :rubygems => "< 2.5.2" do - install_gemfile! <<-G - source "file://#{gem_repo1}" - gem "with_license" - G - [true, false].each do |l| - bundle! "config disable_exec_load #{l}" - bundle "exec rackup" - expect(last_command.stderr).to include "rack is not part of the bundle. Add it to your Gemfile." - end - end - describe "with help flags" do each_prefix = proc do |string, &blk| 1.upto(string.length) {|l| blk.call(string[0, l]) } @@ -444,7 +430,7 @@ RSpec.describe "bundle exec" do end describe "with gems bundled via :path with invalid gemspecs", :ruby_repo do - it "outputs the gemspec validation errors", :rubygems => ">= 1.7.2" do + it "outputs the gemspec validation errors" do build_lib "foo" gemspec = lib_path("foo-1.0").join("foo.gemspec").to_s diff --git a/spec/commands/help_spec.rb b/spec/commands/help_spec.rb index deea079c59..f4f90b9347 100644 --- a/spec/commands/help_spec.rb +++ b/spec/commands/help_spec.rb @@ -1,15 +1,6 @@ # frozen_string_literal: true RSpec.describe "bundle help" do - # RubyGems 1.4+ no longer load gem plugins so this test is no longer needed - it "complains if older versions of bundler are installed", :rubygems => "< 1.4" do - system_gems "bundler-0.8.1" - - bundle "help" - expect(err).to include("older than 0.9") - expect(err).to include("running `gem cleanup bundler`.") - end - it "uses mann when available" do with_fake_man do bundle "help gemfile" diff --git a/spec/commands/install_spec.rb b/spec/commands/install_spec.rb index 1515eed752..f4cb114623 100644 --- a/spec/commands/install_spec.rb +++ b/spec/commands/install_spec.rb @@ -384,7 +384,7 @@ RSpec.describe "bundle install with gem sources" do expect(err).not_to include("file://") end - it "fails gracefully when downloading an invalid specification from the full index", :rubygems => "2.5" do + it "fails gracefully when downloading an invalid specification from the full index" do build_repo2 do build_gem "ajp-rails", "0.0.0", :gemspec => false, :skip_validation => true do |s| bad_deps = [["ruby-ajp", ">= 0.2.0"], ["rails", ">= 0.14"]] diff --git a/spec/commands/newgem_spec.rb b/spec/commands/newgem_spec.rb index 08dca15185..c7cc5e594a 100644 --- a/spec/commands/newgem_spec.rb +++ b/spec/commands/newgem_spec.rb @@ -289,7 +289,7 @@ RSpec.describe "bundle gem" do it_should_behave_like "git config is absent" end - it "sets gemspec metadata['allowed_push_host']", :rubygems => "2.0" do + it "sets gemspec metadata['allowed_push_host']" do expect(generated_gem.gemspec.metadata["allowed_push_host"]). to match(/mygemserver\.com/) end @@ -381,7 +381,7 @@ RSpec.describe "bundle gem" do expect(bundled_app("test_gem/spec/spec_helper.rb")).to exist end - it "depends on a specific version of rspec", :rubygems => ">= 1.8.1" do + it "depends on a specific version of rspec" do rspec_dep = generated_gem.gemspec.development_dependencies.find {|d| d.name == "rspec" } expect(rspec_dep).to be_specific end @@ -431,7 +431,7 @@ RSpec.describe "bundle gem" do bundle "gem #{gem_name} --test=minitest" end - it "depends on a specific version of minitest", :rubygems => ">= 1.8.1" do + it "depends on a specific version of minitest" do rspec_dep = generated_gem.gemspec.development_dependencies.find {|d| d.name == "minitest" } expect(rspec_dep).to be_specific end diff --git a/spec/commands/show_spec.rb b/spec/commands/show_spec.rb index 6692fb0cfb..8e3d0194e6 100644 --- a/spec/commands/show_spec.rb +++ b/spec/commands/show_spec.rb @@ -135,7 +135,7 @@ RSpec.describe "bundle show" do expect(out).to include("foo (1.0 #{sha[0..6]})") end - it "handles when a version is a '-' prerelease", :rubygems => "2.1" do + it "handles when a version is a '-' prerelease" do @git = build_git("foo", "1.0.0-beta.1", :path => lib_path("foo")) install_gemfile <<-G gem "foo", "1.0.0-beta.1", :git => "#{lib_path("foo")}" diff --git a/spec/install/gemfile/gemspec_spec.rb b/spec/install/gemfile/gemspec_spec.rb index 7d21af38e3..ff0f7a8445 100644 --- a/spec/install/gemfile/gemspec_spec.rb +++ b/spec/install/gemfile/gemspec_spec.rb @@ -239,7 +239,7 @@ RSpec.describe "bundle install from an existing gemspec" do expect(the_bundle).to include_gems "foo 1.0.0" end - it "does not break Gem.finish_resolve with conflicts", :rubygems => ">= 2" do + it "does not break Gem.finish_resolve with conflicts" do build_lib("foo", :path => tmp.join("foo")) do |s| s.version = "1.0.0" s.add_dependency "bar", "= 1.0.0" diff --git a/spec/install/gemfile/git_spec.rb b/spec/install/gemfile/git_spec.rb index cf98f1c2c3..aa19fa1ce0 100644 --- a/spec/install/gemfile/git_spec.rb +++ b/spec/install/gemfile/git_spec.rb @@ -1206,7 +1206,7 @@ In Gemfile: expect(out).not_to include("gem install foo") end - it "does not reinstall the extension", :ruby_repo, :rubygems => ">= 2.3.0" do + it "does not reinstall the extension", :ruby_repo do build_git "foo" do |s| s.add_dependency "rake" s.extensions << "Rakefile" @@ -1247,7 +1247,7 @@ In Gemfile: expect(out).to eq(installed_time) end - it "does not reinstall the extension when changing another gem", :rubygems => ">= 2.3.0" do + it "does not reinstall the extension when changing another gem" do build_git "foo" do |s| s.add_dependency "rake" s.extensions << "Rakefile" @@ -1290,7 +1290,7 @@ In Gemfile: expect(out).to eq(installed_time) end - it "does reinstall the extension when changing refs", :rubygems => ">= 2.3.0" do + it "does reinstall the extension when changing refs" do build_git "foo" do |s| s.add_dependency "rake" s.extensions << "Rakefile" diff --git a/spec/install/gemfile/path_spec.rb b/spec/install/gemfile/path_spec.rb index 17f5471f26..224c28269e 100644 --- a/spec/install/gemfile/path_spec.rb +++ b/spec/install/gemfile/path_spec.rb @@ -167,7 +167,7 @@ RSpec.describe "bundle install with explicit source paths" do expect(the_bundle).to include_gems "premailer 1.0.0" end - it "warns on invalid specs", :rubygems => "1.7" do + it "warns on invalid specs" do build_lib "foo" gemspec = lib_path("foo-1.0").join("foo.gemspec").to_s diff --git a/spec/install/gems/compact_index_spec.rb b/spec/install/gems/compact_index_spec.rb index 9d6ba770be..01ad1f991f 100644 --- a/spec/install/gems/compact_index_spec.rb +++ b/spec/install/gems/compact_index_spec.rb @@ -863,7 +863,7 @@ The checksum of /versions does not match the checksum provided by the server! So E end - describe "checksum validation", :rubygems => ">= 2.3.0" do + describe "checksum validation" do it "raises when the checksum does not match" do install_gemfile <<-G, :artifice => "compact_index_wrong_gem_checksum" source "#{source_uri}" diff --git a/spec/install/gems/standalone_spec.rb b/spec/install/gems/standalone_spec.rb index e77cdd7419..2c7dd09f91 100644 --- a/spec/install/gems/standalone_spec.rb +++ b/spec/install/gems/standalone_spec.rb @@ -75,7 +75,7 @@ RSpec.shared_examples "bundle install --standalone" do G end - it "generates a bundle/bundler/setup.rb with the proper paths", :rubygems => "2.4" do + it "generates a bundle/bundler/setup.rb with the proper paths" do expected_path = bundled_app("bundle/bundler/setup.rb") extension_line = File.read(expected_path).each_line.find {|line| line.include? "/extensions/" }.strip expect(extension_line).to start_with '$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/extensions/' diff --git a/spec/install/gems/sudo_spec.rb b/spec/install/gems/sudo_spec.rb index 0ffe87f80e..58f51841a0 100644 --- a/spec/install/gems/sudo_spec.rb +++ b/spec/install/gems/sudo_spec.rb @@ -88,7 +88,7 @@ RSpec.describe "when using sudo", :sudo => true do expect(the_bundle).to include_gems "rack 1.0" end - it "installs extensions/ compiled by RubyGems 2.2", :rubygems => "2.2" do + it "installs extensions/" do install_gemfile <<-G source "file://#{gem_repo1}" gem "very_simple_binary" diff --git a/spec/install/global_cache_spec.rb b/spec/install/global_cache_spec.rb index 72c0fed4f1..e1f5a3074a 100644 --- a/spec/install/global_cache_spec.rb +++ b/spec/install/global_cache_spec.rb @@ -187,7 +187,7 @@ RSpec.describe "global gem caching" do end end - describe "extension caching", :ruby_repo, :rubygems => "2.2" do + describe "extension caching", :ruby_repo do it "works" do build_git "very_simple_git_binary", &:add_c_extension build_lib "very_simple_path_binary", &:add_c_extension diff --git a/spec/install/path_spec.rb b/spec/install/path_spec.rb index e6439a2285..8127c853c3 100644 --- a/spec/install/path_spec.rb +++ b/spec/install/path_spec.rb @@ -207,7 +207,7 @@ RSpec.describe "bundle install" do expect(the_bundle).to include_gems "rack 1.0.0" end - it "re-installs gems whose extensions have been deleted", :ruby_repo, :rubygems => ">= 2.3" do + it "re-installs gems whose extensions have been deleted", :ruby_repo do build_lib "very_simple_binary", "1.0.0", :to_system => true do |s| s.write "lib/very_simple_binary.rb", "raise 'FAIL'" end diff --git a/spec/other/ext_spec.rb b/spec/other/ext_spec.rb index 3f6f8b4928..bc8c781c5d 100644 --- a/spec/other/ext_spec.rb +++ b/spec/other/ext_spec.rb @@ -54,13 +54,8 @@ RSpec.describe "Gem::SourceIndex#refresh!" do G end - it "does not explode when called", :rubygems => "1.7" do + it "does not explode when called" do run "Gem.source_index.refresh!" run "Gem::SourceIndex.new([]).refresh!" end - - it "does not explode when called", :rubygems => "< 1.7" do - run "Gem.source_index.refresh!" - run "Gem::SourceIndex.from_gems_in([]).refresh!" - end end diff --git a/spec/other/platform_spec.rb b/spec/other/platform_spec.rb index dae0739eac..cb47cc024e 100644 --- a/spec/other/platform_spec.rb +++ b/spec/other/platform_spec.rb @@ -149,7 +149,7 @@ G expect(out).to eq("ruby 1.8.7 (rbx 1.2.4)") end - it "handles truffleruby", :rubygems => ">= 2.1.0" do + it "handles truffleruby" do gemfile <<-G source "file://#{gem_repo1}" ruby "2.5.1", :engine => 'truffleruby', :engine_version => '1.0.0-rc6' diff --git a/spec/realworld/gemfile_source_header_spec.rb b/spec/realworld/gemfile_source_header_spec.rb index 4ef7aef07b..ad8897d68c 100644 --- a/spec/realworld/gemfile_source_header_spec.rb +++ b/spec/realworld/gemfile_source_header_spec.rb @@ -2,7 +2,7 @@ require "thread" -RSpec.describe "fetching dependencies with a mirrored source", :realworld => true, :rubygems => ">= 2.0" do +RSpec.describe "fetching dependencies with a mirrored source", :realworld => true do let(:mirror) { "https://server.example.org" } let(:original) { "http://127.0.0.1:#{@port}" } diff --git a/spec/runtime/require_spec.rb b/spec/runtime/require_spec.rb index 4d8b70082e..7a32fc6117 100644 --- a/spec/runtime/require_spec.rb +++ b/spec/runtime/require_spec.rb @@ -371,7 +371,7 @@ RSpec.describe "Bundler.require" do end end - it "does not load rubygems gemspecs that are used", :rubygems => ">= 2.5.2" do + it "does not load rubygems gemspecs that are used" do install_gemfile! <<-G source "file://#{gem_repo1}" gem "rack" @@ -394,7 +394,7 @@ RSpec.describe "Bundler.require" do expect(out).to eq("WIN") end - it "does not load git gemspecs that are used", :rubygems => ">= 2.5.2" do + it "does not load git gemspecs that are used" do build_git "foo" install_gemfile! <<-G diff --git a/spec/runtime/setup_spec.rb b/spec/runtime/setup_spec.rb index 9b1c637bc3..6fd070907c 100644 --- a/spec/runtime/setup_spec.rb +++ b/spec/runtime/setup_spec.rb @@ -727,7 +727,7 @@ RSpec.describe "Bundler.setup" do expect(out).to be_empty end - it "does not load all gemspecs", :rubygems => ">= 2.3" do + it "does not load all gemspecs" do install_gemfile! <<-G source "file://#{gem_repo1}" gem "rack" |