Class: MarkdownExec::TestLinkHistory
- Defined in:
- lib/link_history.rb
Instance Method Summary collapse
- #setup ⇒ Object
- #test_peek_empty ⇒ Object
- #test_pop ⇒ Object
- #test_pop_empty ⇒ Object
- #test_push ⇒ Object
Instance Method Details
#setup ⇒ Object
85 86 87 88 89 90 91 |
# File 'lib/link_history.rb', line 85 def setup @link_history = LinkHistory.new @link_state1 = LinkState.new(block_name: 'block1', document_filename: 'document1.txt', inherited_lines: ['code1.rb']) @link_state2 = LinkState.new(block_name: 'block2', document_filename: 'document2.txt', inherited_lines: ['code2.rb']) end |
#test_peek_empty ⇒ Object
105 106 107 |
# File 'lib/link_history.rb', line 105 def test_peek_empty assert_equal LinkState.empty, @link_history.peek end |
#test_pop ⇒ Object
98 99 100 101 102 103 |
# File 'lib/link_history.rb', line 98 def test_pop @link_history.push(@link_state1) @link_history.push(@link_state2) assert_equal @link_state2, @link_history.pop assert_equal @link_state1, @link_history.peek end |
#test_pop_empty ⇒ Object
109 110 111 |
# File 'lib/link_history.rb', line 109 def test_pop_empty assert_equal LinkState.empty, @link_history.pop end |
#test_push ⇒ Object
93 94 95 96 |
# File 'lib/link_history.rb', line 93 def test_push @link_history.push(@link_state1) assert_equal @link_state1, @link_history.peek end |