Module Expectations::StateBasedRecorder
In: lib/expectations/state_based_recorder.rb

Methods

Public Instance methods

[Source]

   # File lib/expectations/state_based_recorder.rb, line 7
7:   def failure_message
8:     "expected #{subject} #{@message_parts.join(" ")}"
9:   end

[Source]

    # File lib/expectations/state_based_recorder.rb, line 15
15:   def message_parts
16:     @message_parts ||= self.is_a?(Expectations::ReverseResult) ? [:not] : []
17:   end

[Source]

    # File lib/expectations/state_based_recorder.rb, line 19
19:   def method_missing(sym, *args)
20:     @message_parts ||= []
21:     @message_parts << "#{sym}"
22:     args.each { |arg| @message_parts << arg.inspect }
23:     method_stack << [sym, args]
24:     self
25:   end

[Source]

    # File lib/expectations/state_based_recorder.rb, line 11
11:   def method_stack
12:     @method_stack ||= []
13:   end

[Source]

   # File lib/expectations/state_based_recorder.rb, line 3
3:   def verify
4:     method_stack.inject(subject) { |result, element| result.send element.first, *element.last }
5:   end

[Validate]