From fd2fb687e329788e1261d3b034c2839ae2c0f5fa Mon Sep 17 00:00:00 2001 From: Samuel Giddins Date: Wed, 18 Jan 2017 23:32:22 -0600 Subject: Use rubygems conditional for specs --- .rubocop_todo.yml | 8 -------- spec/commands/help_spec.rb | 3 +-- spec/other/ext_spec.rb | 6 ++---- 3 files changed, 3 insertions(+), 14 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 10d9e58fa5..fd3dce32f2 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -328,11 +328,3 @@ Style/UnneededInterpolation: - 'spec/bundler/shared_helpers_spec.rb' - 'spec/cache/git_spec.rb' - 'spec/commands/exec_spec.rb' - -# Offense count: 2 -# Configuration parameters: EnforcedStyle, SupportedStyles. -# SupportedStyles: snake_case, normalcase, non_integer -Style/VariableNumber: - Exclude: - - 'spec/commands/help_spec.rb' - - 'spec/other/ext_spec.rb' diff --git a/spec/commands/help_spec.rb b/spec/commands/help_spec.rb index 017c53cfd8..7789fe40b9 100644 --- a/spec/commands/help_spec.rb +++ b/spec/commands/help_spec.rb @@ -3,8 +3,7 @@ require "spec_helper" 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 + it "complains if older versions of bundler are installed", :rubygems => "< 1.4" do system_gems "bundler-0.8.1" bundle "help" diff --git a/spec/other/ext_spec.rb b/spec/other/ext_spec.rb index 9aed37adfd..2d6ab941b8 100644 --- a/spec/other/ext_spec.rb +++ b/spec/other/ext_spec.rb @@ -48,8 +48,6 @@ RSpec.describe "Bundler::GemHelpers#generic" do end RSpec.describe "Gem::SourceIndex#refresh!" do - rubygems_1_7 = Gem::Version.new(Gem::VERSION) >= Gem::Version.new("1.7.0") - before do install_gemfile <<-G source "file://#{gem_repo1}" @@ -57,12 +55,12 @@ RSpec.describe "Gem::SourceIndex#refresh!" do G end - it "does not explode when called", :if => rubygems_1_7 do + it "does not explode when called", :rubygems => "1.7" do run "Gem.source_index.refresh!" run "Gem::SourceIndex.new([]).refresh!" end - it "does not explode when called", :unless => rubygems_1_7 do + it "does not explode when called", :rubygems => "< 1.7" do run "Gem.source_index.refresh!" run "Gem::SourceIndex.from_gems_in([]).refresh!" end -- cgit v1.2.1