Class: Statement
- Inherits:
-
Mocha::Mock
- Object
- Mocha::Mock
- Statement
- Defined in:
- test/mocks.rb
Instance Attribute Summary collapse
-
#handle ⇒ Object
readonly
Returns the value of attribute handle.
-
#last_result ⇒ Object
readonly
Returns the value of attribute last_result.
-
#sql ⇒ Object
readonly
Returns the value of attribute sql.
Instance Method Summary collapse
-
#initialize(handle, sql) ⇒ Statement
constructor
A new instance of Statement.
Constructor Details
#initialize(handle, sql) ⇒ Statement
Returns a new instance of Statement.
37 38 39 40 41 42 43 44 |
# File 'test/mocks.rb', line 37 def initialize( handle, sql ) super() @handle = handle @sql = sql stubs( :close ).returns(0) stubs( :remainder ).returns('') stubs( :execute ).returns(MockResultSet.new) end |
Instance Attribute Details
#handle ⇒ Object (readonly)
Returns the value of attribute handle.
33 34 35 |
# File 'test/mocks.rb', line 33 def handle @handle end |
#last_result ⇒ Object (readonly)
Returns the value of attribute last_result.
35 36 37 |
# File 'test/mocks.rb', line 35 def last_result @last_result end |
#sql ⇒ Object (readonly)
Returns the value of attribute sql.
34 35 36 |
# File 'test/mocks.rb', line 34 def sql @sql end |