Fix tests for above.
Set does not have a 'last' method.
This commit is contained in:
parent
14592f57f9
commit
47996ea1d3
|
@ -100,12 +100,14 @@ module ChunkMatch
|
||||||
|
|
||||||
# Test if requested parts are correct.
|
# Test if requested parts are correct.
|
||||||
expected_chunk_state.each_pair do |a_method, expected_value|
|
expected_chunk_state.each_pair do |a_method, expected_value|
|
||||||
assert content.chunks.last.kind_of?(chunk_type)
|
content.chunks.each do |c|
|
||||||
assert_respond_to(content.chunks.last, a_method)
|
assert c.kind_of?(chunk_type)
|
||||||
assert_equal(expected_value, content.chunks.last.send(a_method.to_sym),
|
assert_respond_to(c, a_method)
|
||||||
|
assert_equal(expected_value, c.send(a_method.to_sym),
|
||||||
"Wrong #{a_method} value")
|
"Wrong #{a_method} value")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
# Asserts that test_text doesn't match the chunk_type
|
# Asserts that test_text doesn't match the chunk_type
|
||||||
def no_match(chunk_type, test_text)
|
def no_match(chunk_type, test_text)
|
||||||
|
|
|
@ -130,11 +130,12 @@ class WikiTest < Test::Unit::TestCase
|
||||||
def assert_link_parsed_as(expected_page_name, expected_link_text, expected_link_type, link)
|
def assert_link_parsed_as(expected_page_name, expected_link_text, expected_link_type, link)
|
||||||
link_to_file = ContentStub.new(link)
|
link_to_file = ContentStub.new(link)
|
||||||
WikiChunk::Link.apply_to(link_to_file)
|
WikiChunk::Link.apply_to(link_to_file)
|
||||||
chunk = link_to_file.chunks.last
|
link_to_file.chunks.each do |chunk|
|
||||||
assert chunk
|
assert chunk
|
||||||
assert_equal expected_page_name, chunk.page_name
|
assert_equal expected_page_name, chunk.page_name
|
||||||
assert_equal expected_link_text, chunk.link_text
|
assert_equal expected_link_text, chunk.link_text
|
||||||
assert_equal expected_link_type, chunk.link_type
|
assert_equal expected_link_type, chunk.link_type
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue