Skip to content

Commit

Permalink
additional tests for different context hooks scenarios
Browse files Browse the repository at this point in the history
  • Loading branch information
anmarchenko committed Dec 4, 2024
1 parent 1d61ee5 commit 1d9c804
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions spec/datadog/ci/contrib/rspec/instrumentation_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -818,6 +818,20 @@ def rspec_skipped_session_run
expect(before_context_spy).not_to have_received(:call)
end

it "runs top-level hook when there is a test not skipped by datadog, but it skips hooks for the context where all tests are skipped" do
rspec_session_run(with_failed_test: true, with_test_outside_context: true)

expect(before_all_spy).to have_received(:call)
expect(before_context_spy).not_to have_received(:call)
end

it "runs context hook if any test is marked unskippable" do
rspec_session_run(with_failed_test: true, unskippable: {test: true})

expect(before_all_spy).to have_received(:call)
expect(before_context_spy).to have_received(:call)
end

context "but some tests are unskippable" do
context "when a test is unskippable" do
it "runs the test and adds forced run tag" do
Expand Down

0 comments on commit 1d9c804

Please sign in to comment.