Class: Lookout::Expectations
Direct Known Subclasses
Line
Defined Under Namespace
Classes: Behavior, Line, State
Instance Method Summary
collapse
Constructor Details
#initialize(results = Lookout::Results.new) ⇒ Expectations
Returns a new instance of Expectations.
8
9
10
|
# File 'lib/lookout/expectations.rb', line 8
def initialize(results = Lookout::Results.new)
@results = results
end
|
Instance Method Details
#expect(expected, &block) ⇒ Object
40
41
42
43
|
# File 'lib/lookout/expectations.rb', line 40
def expect(expected, &block)
@results << Lookout::Expectation.on(expected, *Lookout.location(caller.first), &block).evaluate
self
end
|
TODO: It would be great if this method wasn’t necessary.
46
47
48
|
# File 'lib/lookout/expectations.rb', line 46
def flush
self
end
|
12
13
14
|
# File 'lib/lookout/expectations.rb', line 12
def mock
Lookout::Mock::Object.new
end
|
#output(string) ⇒ Object
28
29
30
|
# File 'lib/lookout/expectations.rb', line 28
def output(string)
Lookout::Output.new(string)
end
|
24
25
26
|
# File 'lib/lookout/expectations.rb', line 24
def stub
Lookout::Stub::Object.new
end
|
#warning(string) ⇒ Object
32
33
34
|
# File 'lib/lookout/expectations.rb', line 32
def warning(string)
Lookout::Warning.new(string)
end
|
#xml(string) ⇒ Object
36
37
38
|
# File 'lib/lookout/expectations.rb', line 36
def xml(string)
Lookout::XML.new(string)
end
|