Class: Expectations::Recorder

Inherits:
BlankSlate show all
Defined in:
lib/expectations/recorder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from BlankSlate

find_hidden_method, hide, reveal

Constructor Details

#initialize(subject) ⇒ Recorder

Returns a new instance of Recorder.



4
5
6
# File 'lib/expectations/recorder.rb', line 4

def initialize(subject)
  @subject = subject
end

Instance Attribute Details

#subjectObject (readonly)

Returns the value of attribute subject.



3
4
5
# File 'lib/expectations/recorder.rb', line 3

def subject
  @subject
end

Instance Method Details

#beObject



20
21
22
23
24
# File 'lib/expectations/recorder.rb', line 20

def be
  extend Expectations::StateBasedRecorder
  message_parts << "to be"
  self
end

#delegate(method) ⇒ Object



26
27
28
29
30
# File 'lib/expectations/recorder.rb', line 26

def delegate(method)
  extend Expectations::DelegateRecorder
  delegate!(method)
  self
end

#haveObject



14
15
16
17
18
# File 'lib/expectations/recorder.rb', line 14

def have
  extend Expectations::StateBasedRecorder
  message_parts << "to have"
  self
end

#not!Object



36
37
38
# File 'lib/expectations/recorder.rb', line 36

def not!
  extend Expectations::ReverseResult
end

#receive(meth) ⇒ Object



8
9
10
11
12
# File 'lib/expectations/recorder.rb', line 8

def receive(meth)
  extend Expectations::MockRecorder
  receive!(meth)
  self
end

#subject!Object



32
33
34
# File 'lib/expectations/recorder.rb', line 32

def subject!
  subject
end

#verify!Object



40
41
42
# File 'lib/expectations/recorder.rb', line 40

def verify!
  verify
end