Class: MarkdownExec::TestHashDelegatorMenuChromeOption

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

Instance Method Summary collapse

Instance Method Details

#setupObject



4996
4997
4998
4999
5000
5001
5002
5003
# File 'lib/hash_delegator.rb', line 4996

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

#test_menu_chrome_formatted_option_with_formatObject



5005
5006
5007
5008
# File 'lib/hash_delegator.rb', line 5005

def test_menu_chrome_formatted_option_with_format
  assert_equal '-- Back --',
               @hd.menu_chrome_formatted_option(:menu_option_back_name)
end

#test_menu_chrome_formatted_option_without_formatObject



5010
5011
5012
5013
5014
5015
# File 'lib/hash_delegator.rb', line 5010

def test_menu_chrome_formatted_option_without_format
  @hd.instance_variable_set(:@delegate_object,
                            { menu_option_back_name: "'Back'" })
  assert_equal 'Back',
               @hd.menu_chrome_formatted_option(:menu_option_back_name)
end