Class: Mocha::Central
Instance Attribute Summary collapse
-
#stubba_methods ⇒ Object
Returns the value of attribute stubba_methods.
Instance Method Summary collapse
-
#initialize ⇒ Central
constructor
A new instance of Central.
- #stub(method) ⇒ Object
- #unstub_all ⇒ Object
Constructor Details
#initialize ⇒ Central
Returns a new instance of Central.
7 8 9 |
# File 'lib/mocha/central.rb', line 7 def initialize self.stubba_methods = [] end |
Instance Attribute Details
#stubba_methods ⇒ Object
Returns the value of attribute stubba_methods.
5 6 7 |
# File 'lib/mocha/central.rb', line 5 def stubba_methods @stubba_methods end |
Instance Method Details
#stub(method) ⇒ Object
11 12 13 14 15 16 |
# File 'lib/mocha/central.rb', line 11 def stub(method) unless stubba_methods.include?(method) method.stub stubba_methods.push(method) end end |
#unstub_all ⇒ Object
18 19 20 21 22 23 |
# File 'lib/mocha/central.rb', line 18 def unstub_all while stubba_methods.length > 0 method = stubba_methods.pop method.unstub end end |