class FlexMock::PartialMockProxy::ProxyBox
Boxing of the flexmock proxy
It is managed as a stack in order to allow to setup containers recursively (as e.g. FlexMock.use
( … ) checks)
Constants
- Element
Attributes
Public Class Methods
Source
# File lib/flexmock/partial_mock.rb, line 39 def initialize @stack = [Element.new] end
Public Instance Methods
Source
# File lib/flexmock/partial_mock.rb, line 45 def container stack.last.container end
Tests whether the given container is the one on which the current proxy acts
Source
# File lib/flexmock/partial_mock.rb, line 57 def pop if !stack.empty? stack.pop end end
Source
# File lib/flexmock/partial_mock.rb, line 53 def push(proxy, container) stack.push(Element.new(proxy, container)) end