class StateContextProxyTest
Public Instance Methods
setup()
click to toggle source
# File test/unit/state_context_test.rb, line 140 def setup @klass = Class.new(Validateable) machine = StateMachine::Machine.new(@klass, :initial => :parked) state = machine.state :parked @state_context = StateMachine::StateContext.new(state) end
test_should_call_class_with_same_arguments()
click to toggle source
# File test/unit/state_context_test.rb, line 148 def test_should_call_class_with_same_arguments options = {} validation = @state_context.validate(:name, options) assert_equal [:name, options], validation end
test_should_pass_block_through_to_class()
click to toggle source
# File test/unit/state_context_test.rb, line 155 def test_should_pass_block_through_to_class options = {} proxy_block = lambda {} validation = @state_context.validate(:name, options, &proxy_block) assert_equal [:name, options, proxy_block], validation end