This repository was archived by the owner on Nov 30, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +34
-4
lines changed Expand file tree Collapse file tree 3 files changed +34
-4
lines changed Original file line number Diff line number Diff line change @@ -231,8 +231,13 @@ def example_group
231
231
@example_group_class
232
232
end
233
233
234
- alias_method :pending? , :pending
235
- alias_method :skipped? , :skip
234
+ def pending?
235
+ !!pending
236
+ end
237
+
238
+ def skipped?
239
+ !!skip
240
+ end
236
241
237
242
# @api private
238
243
# instance_execs the block passed to the constructor in the context of
@@ -577,7 +582,9 @@ class ExecutionResult
577
582
# this indicates whether or not it now passes.
578
583
attr_accessor :pending_fixed
579
584
580
- alias pending_fixed? pending_fixed
585
+ def pending_fixed?
586
+ !!pending_fixed
587
+ end
581
588
582
589
# @return [Boolean] Indicates if the example was completely skipped
583
590
# (typically done via `:skip` metadata or the `skip` method). Skipped examples
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ class Example
22
22
23
23
it 'provides a `pending_fixed?` predicate' do
24
24
er = ExecutionResult . new
25
- expect { er . pending_fixed = true } . to change ( er , :pending_fixed? ) . to ( true )
25
+ expect { er . pending_fixed = true } . to change ( er , :pending_fixed? ) . from ( false ) . to ( true )
26
26
end
27
27
28
28
describe "backwards compatibility" do
Original file line number Diff line number Diff line change @@ -778,7 +778,18 @@ def expect_pending_result(example)
778
778
expect_pending_result ( group . examples . last )
779
779
end
780
780
end
781
+ end
782
+
783
+ describe "#pending?" do
784
+ it "only returns true / false values" do
785
+ group = describe_successfully do
786
+ example ( "" , :pending => "a message thats ignored" ) { fail }
787
+ example { }
788
+ end
781
789
790
+ expect ( group . examples [ 0 ] . pending? ) . to eq true
791
+ expect ( group . examples [ 1 ] . pending? ) . to eq false
792
+ end
782
793
end
783
794
784
795
describe "#skip" do
@@ -847,6 +858,18 @@ def expect_pending_result(example)
847
858
end
848
859
end
849
860
861
+ describe "#skipped?" do
862
+ it "only returns true / false values" do
863
+ group = describe_successfully do
864
+ example ( "" , :skip => "a message thats ignored" ) { fail }
865
+ example { }
866
+ end
867
+
868
+ expect ( group . examples [ 0 ] . skipped? ) . to eq true
869
+ expect ( group . examples [ 1 ] . skipped? ) . to eq false
870
+ end
871
+ end
872
+
850
873
describe "timing" do
851
874
it "uses RSpec::Core::Time as to not be affected by changes to time in examples" do
852
875
reporter = double ( :reporter ) . as_null_object
You can’t perform that action at this time.
0 commit comments