Class: MarkdownExec::TestHashDelegator::TestHashDelegatorMenuChromeColoredOption

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

Instance Method Summary collapse

Instance Method Details

#setupObject



3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
# File 'lib/hash_delegator.rb', line 3207

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



3219
3220
3221
3222
# File 'lib/hash_delegator.rb', line 3219

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



3224
3225
3226
3227
3228
3229
# File 'lib/hash_delegator.rb', line 3224

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