File tree Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change 29
29
end
30
30
31
31
it 'ensures a consistent `testRunStartedId` across the entire test run' do
32
- # Step 1) Grab testRunStarted[:id]
33
- test_run_message = parsed_generated . detect { |msg | message_type ( msg ) == :test_run_started }
34
- id = test_run_message . test_run_started . id
35
-
36
- # Step 2) Validate every testCase has a [:testRunStartedId] equal to the above
37
- # Step 3) Validate the single testRunFinished [:testRunStartedId] equal to the above
38
- messages_types_containing_test_run_started_id = %i[ test_case test_run_finished ]
39
- messages_containing_test_run_started_id = parsed_generated . select { |msg | messages_types_containing_test_run_started_id . include? ( message_type ( msg ) ) }
32
+ test_run_started_id = parsed_generated . detect { |msg | message_type ( msg ) == :test_run_started } . test_run_started . id
33
+ messages_containing_test_run_started_id = parsed_generated . select do |msg |
34
+ # These two types of message are the only ones containing the testRunStartedId attribute
35
+ %i[ test_case test_run_finished ] . include? ( message_type ( msg ) )
36
+ end
40
37
ids = messages_containing_test_run_started_id . map { |msg | msg . send ( message_type ( msg ) ) . test_run_started_id }
41
38
42
- expect ( ids ) . to all eq ( id )
39
+ expect ( ids ) . to all eq ( test_run_started_id )
43
40
end
44
41
end
You can’t perform that action at this time.
0 commit comments