Sha256: 4549623229da8c00a6d7cb3e9e01cad614cb4b26157952f0f190d106d0218294

Contents?: true

Size: 575 Bytes

Versions: 4

Compression:

Stored size: 575 Bytes

Contents

require 'capybara/rspec'

RSpec.configure do |config|
  config.before do
    current_example = RSpec.current_example

    if self.class.include?(Capybara::DSL) and current_example.metadata[:turnip]
      Capybara.current_driver = Capybara.javascript_driver if current_example.metadata.has_key?(:javascript)
      current_example.metadata.each do |tag, value|
        has_driver = Capybara::VERSION >= '3.33.0' ? !Capybara.drivers[tag].nil? : Capybara.drivers.has_key?(tag)
        if has_driver
          Capybara.current_driver = tag
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
turnip-4.4.1 lib/turnip/capybara.rb
turnip-4.4.0 lib/turnip/capybara.rb
turnip-4.3.0 lib/turnip/capybara.rb
turnip-4.2.0 lib/turnip/capybara.rb