summaryrefslogtreecommitdiff
path: root/test/blocks_test.rb
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2021-04-21 23:47:55 -0600
committerDan Allen <dan.j.allen@gmail.com>2021-04-22 00:48:05 -0600
commite51b045a0e0c7a5b885ec4e3ec283b8063c38fa7 (patch)
tree1561a97511f0319a2544d25eecf7aba7685ce8dc /test/blocks_test.rb
parent3fa8ec76f1f7d9d7905a387bbcbcbe5ecbffe920 (diff)
add negative test to verify that the parser assigns a nil value to an attribute mapped to an empty positional attribute
Diffstat (limited to 'test/blocks_test.rb')
-rw-r--r--test/blocks_test.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/blocks_test.rb b/test/blocks_test.rb
index 7674d918..a75718a6 100644
--- a/test/blocks_test.rb
+++ b/test/blocks_test.rb
@@ -2590,6 +2590,13 @@ context 'Blocks' do
assert_xpath '/*[@class="imageblock"]//img[@src="images/tiger.png"][@alt="Tiger"][@width="200"][@height="300"]', output, 1
end
+ # FIXME this is a negative test that should be updated when the problem is fixed
+ test 'should output empty width attribute if positional width attribute is empty' do
+ input = 'image::images/tiger.png[Tiger,]'
+ output = convert_string_to_embedded input
+ assert_xpath '/*[@class="imageblock"]//img[@src="images/tiger.png"][@width=""]', output, 1
+ end
+
test "can convert block image with link" do
input = <<~'EOS'
image::images/tiger.png[Tiger, link='http://en.wikipedia.org/wiki/Tiger']