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
43
44
45
46
47
48
49
50
51
52
53
|
# File 'lib/rspec-interactive/runner.rb', line 11
def run()
begin
@options.configure(::RSpec.configuration)
return if ::RSpec.world.wants_to_quit
::RSpec.configuration.load_spec_files
ensure
::RSpec.world.announce_filters
end
return ::RSpec.configuration.reporter.exit_early(::RSpec.configuration.failure_exit_code) if ::RSpec.world.wants_to_quit
example_groups = ::RSpec.world.ordered_example_groups
examples_count = ::RSpec.world.example_count(example_groups)
exit_code = ::RSpec.configuration.reporter.report(examples_count) do |reporter|
::RSpec.configuration.with_suite_hooks do
if examples_count == 0 && ::RSpec.configuration.fail_if_no_examples
return ::RSpec.configuration.failure_exit_code
end
group_results = example_groups.map do |example_group|
example_group.run(reporter)
end
success = group_results.all?
exit_code = success ? 0 : 1
if ::RSpec.world.non_example_failure
success = false
exit_code = ::RSpec.configuration.failure_exit_code
end
persist_example_statuses
exit_code
end
end
if exit_code != 0 && ::RSpec.configuration.example_status_persistence_file_path
::RSpec.configuration.output_stream.puts "Rerun failures by executing the previous command with --only-failures or --next-failure."
::RSpec.configuration.output_stream.puts
end
exit_code
end
|