Permalink
Browse files

We can only test rspec-rails 3 with capybara on 1.9.3 and above

* See the comment for more details
  • Loading branch information...
1 parent 0eb04b7 commit 1ae04fb2ce116a82c8229486406e071c7d771690 @alindeman alindeman committed Jul 23, 2013
Showing with 10 additions and 5 deletions.
  1. +2 −4 Gemfile
  2. +1 −0 features/feature_specs/feature_spec.feature
  3. +7 −0 features/support/capybara.rb
  4. +0 −1 rspec-rails.gemspec
View
@@ -26,10 +26,8 @@ end
gem 'sqlite3', '~> 1.3.6'
-# Capybara 2.1 requires Ruby >= 1.9.3
-if RUBY_VERSION < '1.9.3'
- gem 'capybara', '>= 2.0.0', '< 2.1.0'
-else
+# Capybara versions that support RSpec 3 only support RUBY_VERSION >= 1.9.3
+if RUBY_VERSION >= '1.9.3'
gem 'capybara', :github => 'thomas-holmes/capybara', :branch => 'support-rspec-3'
end
@@ -1,3 +1,4 @@
+@capybara
Feature: feature spec
Feature specs are high-level tests meant to exercise slices of functionality
@@ -0,0 +1,7 @@
+Around "@capybara" do |scenario, block|
+ # We are caught in a weird situation here. rspec-rails supports 1.8.7 and
+ # above, but capybara beyond a certain version only supports 1.9.3 and above.
+ # On 1.8.7 and 1.9.2, we run most of the rspec-rails test suite but leave out
+ # parts that require capybara.
+ block.call if defined?(::Capybara)
+end
View
@@ -37,5 +37,4 @@ Gem::Specification.new do |s|
s.add_development_dependency 'aruba', '~> 0.4.11'
s.add_development_dependency 'ZenTest', '4.9.0'
s.add_development_dependency 'ammeter', '0.2.5'
- s.add_development_dependency 'capybara', '>= 2.0.0'
end

0 comments on commit 1ae04fb

Please sign in to comment.