File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change 5
5
6
6
require "bundler"
7
7
Bundler . setup
8
- # require order matters, capybara needs to be there before aruba for the RSpec shadowing fix to work (see slightly below)
9
8
require "capybara/cucumber"
10
9
require "capybara/apparition"
11
10
require "aruba/cucumber"
12
11
require "aruba/config/jruby" if RUBY_ENGINE == "jruby"
13
12
require "simplecov"
14
13
15
- # Small workaround I found for the RSpec/aruba shadowing problem showcased in https://github.com/PragTob/all_conflict/
16
- # It _seems_ to work for now but it's definitely not ideal. Wish this was fixed in Capybara.
17
- Aruba ::Api ::Core . include ( Capybara ::RSpecMatcherProxies )
14
+ # Monkey-patching Capybara::DSL if Capybara::DSLRSpecProxyInstaller has no `extended` hook
15
+ unless Module . new . extend ( RSpec ::Matchers ) . extend ( Capybara ::DSL ) . singleton_class . ancestors . include? ( Capybara ::RSpecMatcherProxies )
16
+ Capybara ::DSL . extend ( Module . new {
17
+ def extended ( base )
18
+ base . extend ( ::Capybara ::RSpecMatcherProxies ) if defined? ( ::RSpec ::Matchers ) && base . is_a? ( ::RSpec ::Matchers )
19
+ super
20
+ end
21
+ } )
22
+ end
18
23
19
24
# Rack app for Capybara which returns the latest coverage report from Aruba temp project dir
20
25
coverage_dir = File . expand_path ( "../../tmp/aruba/project/coverage/" , __dir__ )
You can’t perform that action at this time.
0 commit comments