aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Giddins <segiddins@segiddins.me>2017-01-18 23:32:22 -0600
committerSamuel Giddins <segiddins@segiddins.me>2017-01-18 23:32:22 -0600
commitfd2fb687e329788e1261d3b034c2839ae2c0f5fa (patch)
treeea677f5e77c1fbbe6c9253cc534644bf0fc194d6
parent01d22f047102db76cfc987eec2ca6c3bcf1456e5 (diff)
downloadbundler-fd2fb687e329788e1261d3b034c2839ae2c0f5fa.tar.gz
Use rubygems conditional for specs
-rw-r--r--.rubocop_todo.yml8
-rw-r--r--spec/commands/help_spec.rb3
-rw-r--r--spec/other/ext_spec.rb6
3 files changed, 3 insertions, 14 deletions
diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml
index 10d9e58f..fd3dce32 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 017c53cf..7789fe40 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 9aed37ad..2d6ab941 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