Class: MarkdownExec::TestHashDelegator::TestHashDelegatorDetermineBlockState
- Inherits:
-
Minitest::Test
- Object
- Minitest::Test
- MarkdownExec::TestHashDelegator::TestHashDelegatorDetermineBlockState
- Defined in:
- lib/hash_delegator.rb
Instance Method Summary collapse
- #setup ⇒ Object
- #test_determine_block_state_back ⇒ Object
- #test_determine_block_state_continue ⇒ Object
- #test_determine_block_state_exit ⇒ Object
Instance Method Details
#setup ⇒ Object
2896 2897 2898 2899 |
# File 'lib/hash_delegator.rb', line 2896 def setup @hd = HashDelegator.new @hd.stubs(:menu_chrome_formatted_option).returns('Formatted Option') end |
#test_determine_block_state_back ⇒ Object
2911 2912 2913 2914 2915 2916 2917 2918 |
# File 'lib/hash_delegator.rb', line 2911 def test_determine_block_state_back selected_option = { oname: 'Formatted Back Option' } @hd.stubs(:menu_chrome_formatted_option).with(:menu_option_back_name).returns('Formatted Back Option') result = @hd.determine_block_state(selected_option) assert_equal MenuState::BACK, result.state assert_equal selected_option, result.block end |
#test_determine_block_state_continue ⇒ Object
2920 2921 2922 2923 2924 2925 2926 2927 |
# File 'lib/hash_delegator.rb', line 2920 def test_determine_block_state_continue selected_option = { oname: 'Other Option' } result = @hd.determine_block_state(selected_option) assert_equal MenuState::CONTINUE, result.state assert_equal selected_option, result.block end |
#test_determine_block_state_exit ⇒ Object
2901 2902 2903 2904 2905 2906 2907 2908 2909 |
# File 'lib/hash_delegator.rb', line 2901 def test_determine_block_state_exit selected_option = { oname: 'Formatted Option' } @hd.stubs(:menu_chrome_formatted_option).with(:menu_option_exit_name).returns('Formatted Option') result = @hd.determine_block_state(selected_option) assert_equal MenuState::EXIT, result.state assert_nil result.block end |