/
additional_cli_steps.rb
42 lines (35 loc) · 1.04 KB
/
additional_cli_steps.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
begin
require "active_job"
rescue LoadError # rubocop:disable Lint/SuppressedException
end
begin
require "action_cable"
rescue LoadError # rubocop:disable Lint/SuppressedException
end
require "rails/version"
require "rspec/rails/feature_check"
Then /^the example(s)? should( all)? pass$/ do |_, _|
step 'the output should contain "0 failures"'
step 'the exit status should be 0'
end
Then /^the example(s)? should( all)? fail/ do |_, _|
step 'the output should not contain "0 failures"'
step 'the exit status should not be 0'
end
Given /active job is available/ do
unless RSpec::Rails::FeatureCheck.has_active_job?
pending "ActiveJob is not available"
end
end
Given /action cable testing is available/ do
unless RSpec::Rails::FeatureCheck.has_action_cable_testing?
pending "Action Cable testing is not available"
end
end
Then "the exit status should be 0 (ignoring CI failure)" do
begin
step "the exit status should be 0"
rescue Exception => e # rubocop:disable Lint/RescueException
raise e unles ENV['CI']
end
end