File tree Expand file tree Collapse file tree 3 files changed +29
-22
lines changed Expand file tree Collapse file tree 3 files changed +29
-22
lines changed Original file line number Diff line number Diff line change @@ -49,17 +49,7 @@ def self.add_test_type_configurations(config)
49
49
config . include RSpec ::Rails ::ViewExampleGroup , :type => :view
50
50
config . include RSpec ::Rails ::FeatureExampleGroup , :type => :feature
51
51
config . include RSpec ::Rails ::Matchers
52
-
53
- if ActionPack ::VERSION ::STRING >= "5.1"
54
- begin
55
- require 'puma'
56
- require 'capybara'
57
- config . include RSpec ::Rails ::SystemExampleGroup , :type => :system
58
- # rubocop:disable Lint/HandleExceptions
59
- rescue LoadError
60
- # rubocop:enable Lint/HandleExceptions
61
- end
62
- end
52
+ config . include RSpec ::Rails ::SystemExampleGroup , :type => :system
63
53
end
64
54
65
55
# @private
Original file line number Diff line number Diff line change 8
8
require 'rspec/rails/example/model_example_group'
9
9
require 'rspec/rails/example/job_example_group'
10
10
require 'rspec/rails/example/feature_example_group'
11
- if ActionPack ::VERSION ::STRING >= "5.1"
12
- begin
13
- require 'puma'
14
- require 'capybara'
15
- require 'rspec/rails/example/system_example_group'
16
- # rubocop:disable Lint/HandleExceptions
17
- rescue LoadError
18
- # rubocop:enable Lint/HandleExceptions
19
- end
20
- end
11
+ require 'rspec/rails/example/system_example_group'
Original file line number Diff line number Diff line change 1
- if ActionPack ::VERSION ::STRING >= "5.1"
1
+ can_load_system_tests = false
2
+ begin
3
+ require 'puma'
4
+ require 'capybara'
5
+ can_load_system_tests = ActionPack ::VERSION ::STRING >= "5.1"
6
+ # rubocop:disable Lint/HandleExceptions
7
+ rescue LoadError
8
+ # rubocop:enable Lint/HandleExceptions
9
+ end
10
+
11
+ if !can_load_system_tests
12
+ module RSpec
13
+ module Rails
14
+ module SystemExampleGroup
15
+ extend ActiveSupport ::Concern
16
+
17
+ included do
18
+ abort "" "
19
+ System test integration requires Rails >= 5.1 and has a hard
20
+ dependency on `puma` and `capybara`, please add these to your
21
+ Gemfile before attempting to use system tests.
22
+ " ""
23
+ end
24
+ end
25
+ end
26
+ end
27
+ else
2
28
require 'action_dispatch/system_test_case'
3
29
module RSpec
4
30
module Rails
You can’t perform that action at this time.
0 commit comments