Module: Spec::Expectations

Defined in:
lib/interpose/lib/spec/expectations.rb

Class Method Summary collapse

Class Method Details

.b2s_fail_withObject



18
# File 'lib/interpose/lib/spec/expectations.rb', line 18

alias b2s_fail_with fail_with

.clear_errorsObject



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(message, expected=nil, target=nil)
  begin
    b2s_fail_with(message, expected, target)
  rescue Spec::Expectations::ExpectationNotMetError => seenme
    @errors << seenme
  end
end

.first_errorObject



13
14
15
16
# File 'lib/interpose/lib/spec/expectations.rb', line 13

def first_error
  return if @errors.empty?
  raise @errors.first
end