Class: MarkdownExec::TestLinkHistory

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

Instance Method Summary collapse

Instance Method Details

#setupObject



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_emptyObject



152
153
154
# File 'lib/link_history.rb', line 152

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

#test_popObject



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_emptyObject



156
157
158
# File 'lib/link_history.rb', line 156

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

#test_pushObject



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