Class: MarkdownExec::TestHashDelegator::TestHashDelegatorMenuChromeColoredOption

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

Instance Method Summary collapse

Instance Method Details

#setupObject



2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
# File 'lib/hash_delegator.rb', line 2995

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

#test_menu_chrome_colored_option_with_colorObject



3007
3008
3009
3010
# File 'lib/hash_delegator.rb', line 3007

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

#test_menu_chrome_colored_option_without_colorObject



3012
3013
3014
3015
3016
3017
# File 'lib/hash_delegator.rb', line 3012

def test_menu_chrome_colored_option_without_color
  @hd.instance_variable_set(:@delegate_object,
                            { menu_option_back_name: 'Back' })
  assert_equal '-- Back --',
               @hd.menu_chrome_colored_option(:menu_option_back_name)
end