File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed
spec/rspec/rails/matchers Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -320,6 +320,10 @@ def does_not_match?(proc)
320
320
321
321
!matches? ( proc )
322
322
end
323
+
324
+ def supports_block_expectations?
325
+ false
326
+ end
323
327
end
324
328
325
329
# @private
@@ -352,6 +356,10 @@ def matches?(job)
352
356
@job = job
353
357
check ( queue_adapter . performed_jobs )
354
358
end
359
+
360
+ def supports_block_expectations?
361
+ false
362
+ end
355
363
end
356
364
end
357
365
Original file line number Diff line number Diff line change @@ -541,6 +541,12 @@ def perform; raise StandardError; end
541
541
describe "have_been_enqueued" do
542
542
before { ActiveJob ::Base . queue_adapter . enqueued_jobs . clear }
543
543
544
+ it "raises RSpec::Expectations::ExpectationNotMetError when Proc passed to expect" do
545
+ expect {
546
+ expect { heavy_lifting_job } . to have_been_enqueued
547
+ } . to raise_error ( RSpec ::Expectations ::ExpectationNotMetError )
548
+ end
549
+
544
550
it "passes with default jobs count (exactly one)" do
545
551
heavy_lifting_job . perform_later
546
552
expect ( heavy_lifting_job ) . to have_been_enqueued
@@ -861,6 +867,12 @@ def perform; raise StandardError; end
861
867
stub_const ( 'HeavyLiftingJob' , heavy_lifting_job )
862
868
end
863
869
870
+ it "raises RSpec::Expectations::ExpectationNotMetError when Proc passed to expect" do
871
+ expect {
872
+ expect { heavy_lifting_job } . to have_been_performed
873
+ } . to raise_error ( RSpec ::Expectations ::ExpectationNotMetError )
874
+ end
875
+
864
876
it "passes with default jobs count (exactly one)" do
865
877
heavy_lifting_job . perform_later
866
878
expect ( heavy_lifting_job ) . to have_been_performed
You can’t perform that action at this time.
0 commit comments