Class: Transpec::Syntax::ShouldReceive::StubRecord
- Defined in:
- lib/transpec/syntax/should_receive.rb
Instance Method Summary collapse
- #converted_syntax ⇒ Object
-
#initialize(should_receive) ⇒ StubRecord
constructor
A new instance of StubRecord.
- #original_syntax ⇒ Object
Methods inherited from Record
Constructor Details
#initialize(should_receive) ⇒ StubRecord
Returns a new instance of StubRecord.
213 214 215 |
# File 'lib/transpec/syntax/should_receive.rb', line 213 def initialize(should_receive, *) @should_receive = should_receive end |
Instance Method Details
#converted_syntax ⇒ Object
224 225 226 |
# File 'lib/transpec/syntax/should_receive.rb', line 224 def converted_syntax 'obj.stub(:message)' end |
#original_syntax ⇒ Object
217 218 219 220 221 222 |
# File 'lib/transpec/syntax/should_receive.rb', line 217 def original_syntax syntax = "obj.#{@should_receive.method_name}(:message)" syntax << '.any_number_of_times' if @should_receive.any_number_of_times? syntax << '.at_least(0)' if @should_receive.at_least_zero? syntax end |