I would have expected when_first_matching_example_defined to not execute when running with --dry-run. It feels in the spirit of:
Use the --dry-run option to have RSpec print your suite's formatter output
without running any examples or hooks.
Your environment
rspec-core version: 3.11.0
Steps to reproduce
RSpec.configure do |config|
config.when_first_matching_example_defined(type: :model) do
puts "This should not print"
end
end
RSpec.describe MyModel do
it "foobar" do
fail
end
end
Closing this because according to this, the when_first_matching_example_defined hook executes when an example is detected on load of the test suite, not when the first example matching the filter is run.
Subject of the issue
I would have expected
when_first_matching_example_defined
to not execute when running with--dry-run
. It feels in the spirit of:Your environment
Steps to reproduce
Expected behavior
I should not see "This should not print"
Actual behavior
I see "This should not print"