Sha256: 198b28ef0a3c652df24d0bcc40f521466dc00c793c65c71491691288f5366d9a

Contents?: true

Size: 1.14 KB

Versions: 11

Compression:

Stored size: 1.14 KB

Contents

begin
  require 'capybara/rspec'
rescue LoadError
end

begin
  require 'capybara/rails'
rescue LoadError
end

if defined?(Capybara)
  require 'rspec/support/comparable_version'
  unless RSpec::Support::ComparableVersion.new(Capybara::VERSION) >= '2.2.0'
    raise "You are using capybara #{Capybara::VERSION}. RSpec requires >= 2.2.0."
  end

  RSpec.configure do |c|
    if defined?(Capybara::DSL)
      c.include Capybara::DSL, :type => :feature
      if defined?(ActionPack) && ActionPack::VERSION::STRING >= "5.1"
        c.include Capybara::DSL, :type => :system
      end
    end

    if defined?(Capybara::RSpecMatchers)
      c.include Capybara::RSpecMatchers, :type => :view
      c.include Capybara::RSpecMatchers, :type => :helper
      c.include Capybara::RSpecMatchers, :type => :mailer
      c.include Capybara::RSpecMatchers, :type => :controller
      c.include Capybara::RSpecMatchers, :type => :feature
      c.include Capybara::RSpecMatchers, :type => :system
    end

    unless defined?(Capybara::RSpecMatchers) || defined?(Capybara::DSL)
      c.include Capybara, :type => :request
      c.include Capybara, :type => :controller
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
rspec-rails-3.9.1 lib/rspec/rails/vendor/capybara.rb
rspec-rails-4.0.0.beta3 lib/rspec/rails/vendor/capybara.rb
rspec-rails-3.8.3 lib/rspec/rails/vendor/capybara.rb
rspec-rails-3.9.0 lib/rspec/rails/vendor/capybara.rb
rspec-rails-4.0.0.beta2 lib/rspec/rails/vendor/capybara.rb
rspec-rails-3.8.2 lib/rspec/rails/vendor/capybara.rb
rspec-rails-3.8.1 lib/rspec/rails/vendor/capybara.rb
rspec-rails-3.8.0 lib/rspec/rails/vendor/capybara.rb
rspec-rails-3.7.2 lib/rspec/rails/vendor/capybara.rb
rspec-rails-3.7.1 lib/rspec/rails/vendor/capybara.rb
rspec-rails-3.7.0 lib/rspec/rails/vendor/capybara.rb