|
8 | 8 | rescue LoadError
|
9 | 9 | end
|
10 | 10 |
|
11 |
| -RSpec.configure do |c| |
12 |
| - if defined?(Capybara::RSpecMatchers) |
13 |
| - c.include Capybara::RSpecMatchers, :type => :view |
14 |
| - c.include Capybara::RSpecMatchers, :type => :helper |
15 |
| - c.include Capybara::RSpecMatchers, :type => :mailer |
16 |
| - c.include Capybara::RSpecMatchers, :type => :controller |
17 |
| - end |
| 11 | +if defined?(Capybara) |
| 12 | + RSpec.configure do |c| |
| 13 | + if defined?(Capybara::DSL) |
| 14 | + c.include Capybara::DSL, :type => :controller |
| 15 | + c.include Capybara::DSL, :example_group => { |
| 16 | + :file_path => c.escaped_path(%w[spec features]) |
| 17 | + } |
| 18 | + end |
18 | 19 |
|
19 |
| - if defined?(Capybara::DSL) |
20 |
| - c.include Capybara::DSL, :type => :controller |
21 |
| - end |
| 20 | + if defined?(Capybara::RSpecMatchers) |
| 21 | + c.include Capybara::RSpecMatchers, :type => :view |
| 22 | + c.include Capybara::RSpecMatchers, :type => :helper |
| 23 | + c.include Capybara::RSpecMatchers, :type => :mailer |
| 24 | + c.include Capybara::RSpecMatchers, :type => :controller |
| 25 | + c.include Capybara::RSpecMatchers, :example_group => { |
| 26 | + :file_path => c.escaped_path(%w[spec features]) |
| 27 | + } |
| 28 | + end |
22 | 29 |
|
23 |
| - unless defined?(Capybara::RSpecMatchers) || defined?(Capybara::DSL) |
24 |
| - if defined?(Capybara) |
| 30 | + unless defined?(Capybara::RSpecMatchers) || defined?(Capybara::DSL) |
25 | 31 | c.include Capybara, :type => :request
|
26 | 32 | c.include Capybara, :type => :controller
|
27 | 33 | end
|
|
0 commit comments