Include seed to the reproduction command of failed examples

This will make life easier for the developers.
This commit is contained in:
John Fragoulis 2021-03-19 14:52:03 +02:00
parent 7168495afa
commit 0a8ea674fe
2 changed files with 3 additions and 3 deletions

View File

@ -44,7 +44,7 @@ module RSpecQ
msg = presenter.fully_formatted(nil, @colorizer)
msg << "\n"
msg << @colorizer.wrap(
"bin/rspec #{example.location_rerun_argument}",
"bin/rspec --seed #{RSpec.configuration.seed} #{example.location_rerun_argument}",
RSpec.configuration.failure_color
)

View File

@ -16,11 +16,11 @@ class TestReporter < RSpecQTest
def test_failing_suite
build_id = rand_id
exec_build("failing_suite", "", build_id: build_id)
exec_build("failing_suite", "--seed 1234", build_id: build_id)
output = exec_reporter(build_id: build_id)
assert_match "Failed examples", output
assert_match "bin/rspec ./spec/fail_1_spec.rb:3", output
assert_match "bin/rspec --seed 1234 ./spec/fail_1_spec.rb:3", output
refute_match "Flaky", output
end