Class: MarkdownExec::TestHashDelegatorMenuChromeColoredOption

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

Instance Method Summary collapse

Instance Method Details

#setupObject



6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
# File 'lib/hash_delegator.rb', line 6905

def setup
  @hd = HashDelegator.new(
    menu_chrome_color: :red,
    menu_chrome_format: '-- %s --',
    menu_option_back_name: 'Back'
  )
  @hd.stubs(:menu_chrome_formatted_option)
     .with(:menu_option_back_name).returns('-- Back --')
  @hd.stubs(:string_send_color)
     .with('-- Back --', :menu_chrome_color)
     .returns(AnsiString.new('-- Back --').red)
end

#test_menu_chrome_colored_option_with_colorObject



6918
6919
6920
6921
# File 'lib/hash_delegator.rb', line 6918

def test_menu_chrome_colored_option_with_color
  assert_equal AnsiString.new('-- Back --').red,
               @hd.menu_chrome_colored_option(:menu_option_back_name)
end

#test_menu_chrome_colored_option_without_colorObject



6923
6924
6925
6926
6927
6928
6929
# File 'lib/hash_delegator.rb', line 6923

def test_menu_chrome_colored_option_without_color
  @hd = HashDelegator.new(menu_option_back_name: 'Back')
  @hd.stubs(:menu_chrome_formatted_option)
     .with(:menu_option_back_name).returns('-- Back --')
  assert_equal '-- Back --',
               @hd.menu_chrome_colored_option(:menu_option_back_name)
end