Class: MarkdownExec::TestHashDelegator::TestHashDelegatorMenuChromeFormattedOptionWithoutFormat

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

Instance Method Summary collapse

Instance Method Details

#setupObject



3119
3120
3121
3122
3123
3124
3125
3126
# File 'lib/hash_delegator.rb', line 3119

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



3128
3129
3130
3131
# File 'lib/hash_delegator.rb', line 3128

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



3133
3134
3135
3136
3137
3138
# File 'lib/hash_delegator.rb', line 3133

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