Class: MarkdownExec::TestHashDelegatorDetermineBlockState

Inherits:
Minitest::Test
  • Object
show all
Defined in:
lib/hash_delegator.rb

Instance Method Summary collapse

Instance Method Details

#setupObject



6550
6551
6552
6553
# File 'lib/hash_delegator.rb', line 6550

def setup
  @hd = HashDelegator.new
  @hd.stubs(:menu_chrome_formatted_option).returns('Formatted Option')
end

#test_determine_block_state_backObject



6566
6567
6568
6569
6570
6571
6572
6573
6574
# File 'lib/hash_delegator.rb', line 6566

def test_determine_block_state_back
  selected_option = FCB.new(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_continueObject



6576
6577
6578
6579
6580
6581
6582
6583
# File 'lib/hash_delegator.rb', line 6576

def test_determine_block_state_continue
  selected_option = FCB.new(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_exitObject



6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
# File 'lib/hash_delegator.rb', line 6555

def test_determine_block_state_exit
  selected_option = FCB.new(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