Class: MarkdownExec::TestHashDelegatorMenuChromeColoredOption

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

Instance Method Summary collapse

Instance Method Details

#setupObject



4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
# File 'lib/hash_delegator.rb', line 4968

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(AnsiString.new('-- Back --').red)
end

#test_menu_chrome_colored_option_with_colorObject



4982
4983
4984
4985
# File 'lib/hash_delegator.rb', line 4982

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



4987
4988
4989
4990
4991
4992
# File 'lib/hash_delegator.rb', line 4987

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