We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4e8f4ee commit 98f72feCopy full SHA for 98f72fe
spec/rspec/core/suite_hooks_spec.rb
@@ -41,10 +41,17 @@ module RSpec::Core
41
end
42
43
it 'allows access to rspec-expectation methods within the hook' do
44
- RSpec.configuration.__send__(registration_method, :suite) { expect(true).to be false }
45
- expect {
+ notified_failure = nil
+
46
+ RSpec::Support.with_failure_notifier(lambda { |e, _opts| notified_failure = e }) do
47
+ RSpec.configuration.__send__(registration_method, :suite) do
48
+ expect(true).to be false
49
+ end
50
51
RSpec.configuration.with_suite_hooks { }
- }.to raise_error RSpec::Expectations::ExpectationNotMetError
52
53
54
+ expect(notified_failure).to be_a(RSpec::Expectations::ExpectationNotMetError)
55
56
57
context "registered on an example group" do
0 commit comments