summaryrefslogtreecommitdiff
path: root/spec/pass_spec.rb
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2020-02-10 01:47:36 -0700
committerDan Allen <dan.j.allen@gmail.com>2020-02-10 01:49:53 -0700
commit74a5ebb28d6cac5bbf5f1f42e1b448448dc5bd50 (patch)
tree923d596dacd550b25ba6aef061ea2294fda54e69 /spec/pass_spec.rb
parent9d24a34fe82fa218d6a68289bba677872c3c2a41 (diff)
render pass block as listing block, using raw source as contents
Diffstat (limited to 'spec/pass_spec.rb')
-rw-r--r--spec/pass_spec.rb30
1 files changed, 30 insertions, 0 deletions
diff --git a/spec/pass_spec.rb b/spec/pass_spec.rb
new file mode 100644
index 00000000..d1b5e975
--- /dev/null
+++ b/spec/pass_spec.rb
@@ -0,0 +1,30 @@
+# frozen_string_literal: true
+
+require_relative 'spec_helper'
+
+describe 'Asciidoctor::PDF::Converter - Pass' do
+ it 'should render pass as literal block' do
+ pdf = to_pdf <<~'EOS', analyze: true
+ ++++
+ <p>This is a pass block.</p>
+ ++++
+ EOS
+
+ (expect pdf.text).to have_size 1
+ text = pdf.text[0]
+ (expect text[:string]).to eql '<p>This is a pass block.</p>'
+ (expect text[:font_name]).to eql 'mplus1mn-regular'
+ end
+
+ it 'should render stem as literal block if stem extension not present' do
+ pdf = to_pdf <<~'EOS', analyze: true
+ [stem]
+ ++++
+ sig = enc(H(D), s)
+ ++++
+ EOS
+
+ equation_text = (pdf.find_text 'sig = enc(H(D), s)')[0]
+ (expect equation_text[:font_name]).to eql 'mplus1mn-regular'
+ end
+end