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
132 133 134 135 136 137 138 |
# File 'lib/link_history.rb', line 132 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
152 153 154 |
# File 'lib/link_history.rb', line 152 def test_peek_empty assert_equal LinkState.empty, @link_history.peek end |
#test_pop ⇒ Object
145 146 147 148 149 150 |
# File 'lib/link_history.rb', line 145 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
156 157 158 |
# File 'lib/link_history.rb', line 156 def test_pop_empty assert_equal LinkState.empty, @link_history.pop end |
#test_push ⇒ Object
140 141 142 143 |
# File 'lib/link_history.rb', line 140 def test_push @link_history.push(@link_state1) assert_equal @link_state1, @link_history.peek end |