Class: MarkdownExec::TestHashDelegator::TestHashDelegatorHandleBlockState
- Inherits:
-
Minitest::Test
- Object
- Minitest::Test
- MarkdownExec::TestHashDelegator::TestHashDelegatorHandleBlockState
- Defined in:
- lib/hash_delegator.rb
Instance Method Summary collapse
- #setup ⇒ Object
- #test_handle_back_or_continue_with_back ⇒ Object
- #test_handle_back_or_continue_with_continue ⇒ Object
- #test_handle_back_or_continue_with_other ⇒ Object
Instance Method Details
#setup ⇒ Object
3063 3064 3065 3066 |
# File 'lib/hash_delegator.rb', line 3063 def setup @hd = HashDelegator.new @mock_block_state = mock('block_state') end |
#test_handle_back_or_continue_with_back ⇒ Object
3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 |
# File 'lib/hash_delegator.rb', line 3068 def test_handle_back_or_continue_with_back @mock_block_state.stubs(:state).returns(MenuState::BACK) @mock_block_state.stubs(:block).returns({ oname: 'sample_block' }) @hd.handle_back_or_continue(@mock_block_state) assert_equal 'sample_block', @hd.instance_variable_get(:@delegate_object)[:block_name] assert @hd.instance_variable_get(:@menu_user_clicked_back_link) end |
#test_handle_back_or_continue_with_continue ⇒ Object
3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 |
# File 'lib/hash_delegator.rb', line 3079 def test_handle_back_or_continue_with_continue @mock_block_state.stubs(:state).returns(MenuState::CONTINUE) @mock_block_state.stubs(:block).returns({ oname: 'another_block' }) @hd.handle_back_or_continue(@mock_block_state) assert_equal 'another_block', @hd.instance_variable_get(:@delegate_object)[:block_name] refute @hd.instance_variable_get(:@menu_user_clicked_back_link) end |
#test_handle_back_or_continue_with_other ⇒ Object
3090 3091 3092 3093 3094 3095 3096 3097 3098 |
# File 'lib/hash_delegator.rb', line 3090 def test_handle_back_or_continue_with_other @mock_block_state.stubs(:state).returns(nil) # MenuState::OTHER @mock_block_state.stubs(:block).returns({ oname: 'other_block' }) @hd.handle_back_or_continue(@mock_block_state) assert_nil @hd.instance_variable_get(:@delegate_object)[:block_name] assert_nil @hd.instance_variable_get(:@menu_user_clicked_back_link) end |