summaryrefslogtreecommitdiff
path: root/spec/cli_spec.rb
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2022-10-25 01:54:05 -0600
committerDan Allen <dan.j.allen@gmail.com>2022-10-25 02:29:18 -0600
commit0036e6cf8e4e5f8356c2efef49f56b8dde09da21 (patch)
tree5bd741102b33d9c1b594854d7b35880815fb5924 /spec/cli_spec.rb
parentcb5efe784716d0819e0729253d367c9734ed0429 (diff)
only test example files in CLI tests if rouge is available
Diffstat (limited to 'spec/cli_spec.rb')
-rw-r--r--spec/cli_spec.rb9
1 files changed, 5 insertions, 4 deletions
diff --git a/spec/cli_spec.rb b/spec/cli_spec.rb
index fe661ccb..c1277f1d 100644
--- a/spec/cli_spec.rb
+++ b/spec/cli_spec.rb
@@ -90,22 +90,23 @@ describe 'asciidoctor-pdf' do
end
context 'Examples' do
- it 'should convert the basic example', cli: true, visual: true do
+ it 'should convert the basic example', cli: true, visual: true, if: (gem_available? 'rouge'), &(proc do
out, err, res = run_command asciidoctor_pdf_bin, '-D', output_dir, (example_file 'basic-example.adoc')
(expect res.exitstatus).to be 0
(expect out).to be_empty
(expect err).to be_empty
reference_file = File.absolute_path example_file 'basic-example.pdf'
(expect output_file 'basic-example.pdf').to visually_match reference_file
- end
+ end)
- it 'should convert the chronicles example', cli: true, visual: true, unless: Gem.loaded_specs['rouge'].version < (Gem::Version.new '2.1.0'), &(proc do
+ it 'should convert the chronicles example', cli: true, visual: true, if: (gem_available? 'rouge'), &(proc do
out, err, res = run_command asciidoctor_pdf_bin, '-D', output_dir, (example_file 'chronicles-example.adoc')
(expect res.exitstatus).to be 0
(expect out).to be_empty
(expect err).to be_empty
+ skip_pages = [10, 11, 14] if Gem.loaded_specs['rouge'].version < (Gem::Version.new '2.1.0')
reference_file = File.absolute_path example_file 'chronicles-example.pdf'
- (expect output_file 'chronicles-example.pdf').to visually_match reference_file
+ (expect output_file 'chronicles-example.pdf').to visually_match reference_file, skip_pages: skip_pages
end)
end