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
stack[R]
Public Class Methods
new()
click to toggle source
# File lib/flexmock/partial_mock.rb, line 40 def initialize @stack = [Element.new] end
Public Instance Methods
container()
click to toggle source
Tests whether the given container is the one on which the current proxy acts
# File lib/flexmock/partial_mock.rb, line 46 def container stack.last.container end
empty?()
click to toggle source
# File lib/flexmock/partial_mock.rb, line 64 def empty? stack.size == 1 end
pop()
click to toggle source
# File lib/flexmock/partial_mock.rb, line 58 def pop if !stack.empty? stack.pop end end
proxy()
click to toggle source
# File lib/flexmock/partial_mock.rb, line 50 def proxy stack.last.proxy end
push(proxy, container)
click to toggle source
# File lib/flexmock/partial_mock.rb, line 54 def push(proxy, container) stack.push(Element.new(proxy, container)) end