Class: MarkdownExec::TestHashDelegatorMenuChromeColoredOption

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

Instance Method Summary collapse

Instance Method Details

#setupObject



7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
# File 'lib/hash_delegator.rb', line 7040

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



7053
7054
7055
7056
# File 'lib/hash_delegator.rb', line 7053

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



7058
7059
7060
7061
7062
7063
7064
# File 'lib/hash_delegator.rb', line 7058

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