Class: MarkdownExec::TestHashDelegatorMenuChromeColoredOption
- Inherits:
-
Minitest::Test
- Object
- Minitest::Test
- MarkdownExec::TestHashDelegatorMenuChromeColoredOption
- Defined in:
- lib/hash_delegator.rb
Instance Method Summary collapse
- #setup ⇒ Object
- #test_menu_chrome_colored_option_with_color ⇒ Object
- #test_menu_chrome_colored_option_without_color ⇒ Object
Instance Method Details
#setup ⇒ Object
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_color ⇒ Object
4982 4983 4984 4985 |
# File 'lib/hash_delegator.rb', line 4982 def assert_equal AnsiString.new('-- Back --').red, @hd.(:menu_option_back_name) end |
#test_menu_chrome_colored_option_without_color ⇒ Object
4987 4988 4989 4990 4991 4992 |
# File 'lib/hash_delegator.rb', line 4987 def @hd.instance_variable_set(:@delegate_object, { menu_option_back_name: 'Back' }) assert_equal '-- Back --', @hd.(:menu_option_back_name) end |