Class: MarkdownExec::TestHashDelegator::TestHashDelegatorAppendDivider
- Inherits:
-
Minitest::Test
- Object
- Minitest::Test
- MarkdownExec::TestHashDelegator::TestHashDelegatorAppendDivider
- Defined in:
- lib/hash_delegator.rb
Instance Method Summary collapse
- #setup ⇒ Object
- #test_append_divider_final ⇒ Object
- #test_append_divider_initial ⇒ Object
- #test_append_divider_without_format ⇒ Object
Instance Method Details
#setup ⇒ Object
2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 |
# File 'lib/hash_delegator.rb', line 2571 def setup @hd = HashDelegator.new @hd.instance_variable_set(:@delegate_object, { menu_divider_format: 'Format', menu_initial_divider: 'Initial Divider', menu_final_divider: 'Final Divider', menu_divider_color: :color }) @hd.stubs(:string_send_color).returns('Formatted Divider') HashDelegator.stubs(:safeval).returns('Safe Value') end |
#test_append_divider_final ⇒ Object
2591 2592 2593 2594 2595 2596 2597 |
# File 'lib/hash_delegator.rb', line 2591 def test_append_divider_final = [] @hd.append_divider(menu_blocks: , position: :final) assert_equal 1, .size assert_equal 'Formatted Divider', .last.dname end |
#test_append_divider_initial ⇒ Object
2583 2584 2585 2586 2587 2588 2589 |
# File 'lib/hash_delegator.rb', line 2583 def test_append_divider_initial = [] @hd.append_divider(menu_blocks: , position: :initial) assert_equal 1, .size assert_equal 'Formatted Divider', .first.dname end |
#test_append_divider_without_format ⇒ Object
2599 2600 2601 2602 2603 2604 2605 |
# File 'lib/hash_delegator.rb', line 2599 def test_append_divider_without_format @hd.instance_variable_set(:@delegate_object, {}) = [] @hd.append_divider(menu_blocks: , position: :initial) assert_empty end |