Skip to content

Commit 1ae04fb

Browse files
committed
We can only test rspec-rails 3 with capybara on 1.9.3 and above
* See the comment for more details
1 parent 0eb04b7 commit 1ae04fb

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed

Gemfile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,8 @@ end
2626

2727
gem 'sqlite3', '~> 1.3.6'
2828

29-
# Capybara 2.1 requires Ruby >= 1.9.3
30-
if RUBY_VERSION < '1.9.3'
31-
gem 'capybara', '>= 2.0.0', '< 2.1.0'
32-
else
29+
# Capybara versions that support RSpec 3 only support RUBY_VERSION >= 1.9.3
30+
if RUBY_VERSION >= '1.9.3'
3331
gem 'capybara', :github => 'thomas-holmes/capybara', :branch => 'support-rspec-3'
3432
end
3533

features/feature_specs/feature_spec.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
@capybara
12
Feature: feature spec
23

34
Feature specs are high-level tests meant to exercise slices of functionality

features/support/capybara.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Around "@capybara" do |scenario, block|
2+
# We are caught in a weird situation here. rspec-rails supports 1.8.7 and
3+
# above, but capybara beyond a certain version only supports 1.9.3 and above.
4+
# On 1.8.7 and 1.9.2, we run most of the rspec-rails test suite but leave out
5+
# parts that require capybara.
6+
block.call if defined?(::Capybara)
7+
end

rspec-rails.gemspec

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,4 @@ Gem::Specification.new do |s|
3737
s.add_development_dependency 'aruba', '~> 0.4.11'
3838
s.add_development_dependency 'ZenTest', '4.9.0'
3939
s.add_development_dependency 'ammeter', '0.2.5'
40-
s.add_development_dependency 'capybara', '>= 2.0.0'
4140
end

0 commit comments

Comments
 (0)