Class: MarkdownExec::TestHashDelegatorDetermineBlockState

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

Instance Method Summary collapse

Instance Method Details

#setupObject



4606
4607
4608
4609
# File 'lib/hash_delegator.rb', line 4606

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

#test_determine_block_state_backObject



4622
4623
4624
4625
4626
4627
4628
4629
4630
# File 'lib/hash_delegator.rb', line 4622

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



4632
4633
4634
4635
4636
4637
4638
4639
# File 'lib/hash_delegator.rb', line 4632

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



4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
# File 'lib/hash_delegator.rb', line 4611

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