Class: MarkdownExec::TestLinkHistory

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

Instance Method Summary collapse

Instance Method Details

#setupObject



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_emptyObject



105
106
107
# File 'lib/link_history.rb', line 105

def test_peek_empty
  assert_equal LinkState.empty, @link_history.peek
end

#test_popObject



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_emptyObject



109
110
111
# File 'lib/link_history.rb', line 109

def test_pop_empty
  assert_equal LinkState.empty, @link_history.pop
end

#test_pushObject



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