Module: Spec::Expectations
- Defined in:
- lib/interpose/lib/spec/expectations.rb
Class Method Summary collapse
- .b2s_fail_with ⇒ Object
- .clear_errors ⇒ Object
- .fail_with(message, expected = nil, target = nil) ⇒ Object
- .first_error ⇒ Object
Class Method Details
.b2s_fail_with ⇒ Object
18 |
# File 'lib/interpose/lib/spec/expectations.rb', line 18 alias b2s_fail_with fail_with |
.clear_errors ⇒ Object
9 10 11 |
# File 'lib/interpose/lib/spec/expectations.rb', line 9 def clear_errors @errors.clear end |
.fail_with(message, expected = nil, target = nil) ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/interpose/lib/spec/expectations.rb', line 19 def fail_with(, expected=nil, target=nil) begin b2s_fail_with(, expected, target) rescue Spec::Expectations::ExpectationNotMetError => seenme @errors << seenme end end |
.first_error ⇒ Object
13 14 15 16 |
# File 'lib/interpose/lib/spec/expectations.rb', line 13 def first_error return if @errors.empty? raise @errors.first end |