diff options
| author | Dan Allen <dallen@redhat.com> | 2013-04-20 18:48:51 -0600 |
|---|---|---|
| committer | Dan Allen <dallen@redhat.com> | 2013-04-20 18:48:51 -0600 |
| commit | afe1638da8696b0abeae50bbcecda2d4c51b8a0f (patch) | |
| tree | 4a0b3091111f180005033741dc53258b1c008806 /test | |
| parent | 98133fbb6b4981a7b07ff71bdb7b943c1ff435b9 (diff) | |
resolves #260 use code element instead of tt
- perform macro sustitution on email in document header
Diffstat (limited to 'test')
| -rw-r--r-- | test/attributes_test.rb | 2 | ||||
| -rw-r--r-- | test/document_test.rb | 2 | ||||
| -rw-r--r-- | test/lists_test.rb | 2 | ||||
| -rw-r--r-- | test/substitutions_test.rb | 10 | ||||
| -rw-r--r-- | test/tables_test.rb | 6 | ||||
| -rw-r--r-- | test/text_test.rb | 10 |
6 files changed, 16 insertions, 16 deletions
diff --git a/test/attributes_test.rb b/test/attributes_test.rb index fb13fe27..c2152d44 100644 --- a/test/attributes_test.rb +++ b/test/attributes_test.rb @@ -227,7 +227,7 @@ preamble To use {gem_name}, the first thing to do is to import it in your Ruby source file. EOS output = render_embedded_string input - assert_xpath '//*[@class="title"]/tt[text()="asciidoctor"]', output, 1 + assert_xpath '//*[@class="title"]/code[text()="asciidoctor"]', output, 1 end test 'renders attribute until it is deleted' do diff --git a/test/document_test.rb b/test/document_test.rb index c8234eac..6c932a7f 100644 --- a/test/document_test.rb +++ b/test/document_test.rb @@ -434,7 +434,7 @@ more info... EOS output = render_string input assert_xpath '//*[@id="header"]/span[@id="author"][text() = "Stuart Rackham"]', output, 1 - assert_xpath '//*[@id="header"]/span[@id="email"][contains(text(), "founder@asciidoc.org")]', output, 1 + assert_xpath '//*[@id="header"]/span[@id="email"]/a[@href="mailto:founder@asciidoc.org"][text() = "founder@asciidoc.org"]', output, 1 assert_xpath '//*[@id="header"]/span[@id="revnumber"][text() = "version 8.6.8,"]', output, 1 assert_xpath '//*[@id="header"]/span[@id="revdate"][text() = "2012-07-12"]', output, 1 assert_xpath '//*[@id="header"]/span[@id="revremark"][text() = "See changelog."]', output, 1 diff --git a/test/lists_test.rb b/test/lists_test.rb index 3ca002b3..11e7e855 100644 --- a/test/lists_test.rb +++ b/test/lists_test.rb @@ -472,7 +472,7 @@ List assert_xpath '//ul/li', output, 3 assert_xpath '(//ul/li)[1]//strong', output, 1 assert_xpath '(//ul/li)[2]//em', output, 1 - assert_xpath '(//ul/li)[3]//tt', output, 1 + assert_xpath '(//ul/li)[3]//code', output, 1 end test "attribute substitutions" do diff --git a/test/substitutions_test.rb b/test/substitutions_test.rb index 7b5c28fb..4db8146f 100644 --- a/test/substitutions_test.rb +++ b/test/substitutions_test.rb @@ -158,7 +158,7 @@ context 'Substitutions' do test 'single-line constrained monospaced string' do para = block_from_string(%q{`a few <\{monospaced\}> words`}) # NOTE must use apply_normal_subs because constrained monospaced is handled as a passthrough - assert_equal '<tt>a few <{monospaced}> words</tt>', para.apply_normal_subs(para.buffer) + assert_equal '<code>a few <{monospaced}> words</code>', para.apply_normal_subs(para.buffer) end test 'escaped single-line constrained monospaced string' do @@ -170,7 +170,7 @@ context 'Substitutions' do test 'multi-line constrained monospaced string' do para = block_from_string(%Q{`a few\n<\{monospaced\}> words`}) # NOTE must use apply_normal_subs because constrained monospaced is handled as a passthrough - assert_equal "<tt>a few\n<{monospaced}> words</tt>", para.apply_normal_subs(para.buffer) + assert_equal "<code>a few\n<{monospaced}> words</code>", para.apply_normal_subs(para.buffer) end test 'single-line unconstrained strong chars' do @@ -231,17 +231,17 @@ context 'Substitutions' do test 'single-line unconstrained monospaced chars' do para = block_from_string(%q{Git++Hub++}) - assert_equal 'Git<tt>Hub</tt>', para.sub_quotes(para.buffer.join) + assert_equal 'Git<code>Hub</code>', para.sub_quotes(para.buffer.join) end test 'escaped single-line unconstrained monospaced chars' do para = block_from_string(%q{Git\++Hub++}) - assert_equal 'Git+<tt>Hub</tt>+', para.sub_quotes(para.buffer.join) + assert_equal 'Git+<code>Hub</code>+', para.sub_quotes(para.buffer.join) end test 'multi-line unconstrained monospaced chars' do para = block_from_string(%Q{Git++\nH\nu\nb++}) - assert_equal "Git<tt>\nH\nu\nb</tt>", para.sub_quotes(para.buffer.join) + assert_equal "Git<code>\nH\nu\nb</code>", para.sub_quotes(para.buffer.join) end test 'single-line superscript chars' do diff --git a/test/tables_test.rb b/test/tables_test.rb index 5ccb92e2..b8e15783 100644 --- a/test/tables_test.rb +++ b/test/tables_test.rb @@ -279,14 +279,14 @@ d|9 2+>|10 assert_css 'table tr:nth-child(1) > td:nth-child(4).halign-right.valign-top p strong', output, 1 assert_css 'table tr:nth-child(2) > td:nth-child(1).halign-center.valign-top p em', output, 1 - assert_css 'table tr:nth-child(2) > td:nth-child(2).halign-center.valign-middle[colspan="2"][rowspan="2"] p tt', output, 1 - assert_css 'table tr:nth-child(2) > td:nth-child(3).halign-left.valign-bottom[rowspan="3"] p tt', output, 1 + assert_css 'table tr:nth-child(2) > td:nth-child(2).halign-center.valign-middle[colspan="2"][rowspan="2"] p code', output, 1 + assert_css 'table tr:nth-child(2) > td:nth-child(3).halign-left.valign-bottom[rowspan="3"] p code', output, 1 assert_css 'table tr:nth-child(3) > td:nth-child(1).halign-center.valign-top p em', output, 1 assert_css 'table tr:nth-child(4) > td:nth-child(1).halign-left.valign-top p', output, 1 assert_css 'table tr:nth-child(4) > td:nth-child(1).halign-left.valign-top p em', output, 0 - assert_css 'table tr:nth-child(4) > td:nth-child(2).halign-right.valign-top[colspan="2"] p tt', output, 1 + assert_css 'table tr:nth-child(4) > td:nth-child(2).halign-right.valign-top[colspan="2"] p code', output, 1 end test 'supports repeating cells' do diff --git a/test/text_test.rb b/test/text_test.rb index daa87ea9..9f4cc8b3 100644 --- a/test/text_test.rb +++ b/test/text_test.rb @@ -89,7 +89,7 @@ context "Text" do end test "backtick-escaped text followed by single-quoted text" do - assert_match(/<tt>foo<\/tt>/, render_string(%Q(run `foo` 'dog'))) + assert_match(/<code>foo<\/code>/, render_string(%Q(run `foo` 'dog'))) end context "basic styling" do @@ -106,7 +106,7 @@ context "Text" do end test "monospaced" do - assert_xpath "//tt", @rendered + assert_xpath "//code", @rendered end test "superscript" do @@ -118,21 +118,21 @@ context "Text" do end test "backticks" do - assert_xpath "//tt", render_string("This is `totally cool`.") + assert_xpath "//code", render_string("This is `totally cool`.") end test "nested styles" do rendered = render_string("Winning *big _time_* in the +city *boyeeee*+.") assert_xpath "//strong/em", rendered - assert_xpath "//tt/strong", rendered + assert_xpath "//code/strong", rendered end test "unconstrained quotes" do rendered_chars = render_string("**B**__I__++M++") assert_xpath "//strong", rendered_chars assert_xpath "//em", rendered_chars - assert_xpath "//tt", rendered_chars + assert_xpath "//code", rendered_chars end end end |
