summaryrefslogtreecommitdiff
path: root/spec/optimizer_spec.rb
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2020-11-12 03:32:15 -0700
committerGitHub <noreply@github.com>2020-11-12 03:32:15 -0700
commitd2c3d246ed554e2409b573223e5f3679aeb9bf92 (patch)
tree201283ca01c0ca3d705bec42eb0c92632cec5406 /spec/optimizer_spec.rb
parent729cf4dbfe586575b5c07b23727906ddd3a54d19 (diff)
use rspec conditionals to filter tests instead of a postfix conditional on the test or context (PR #1820)
- use if and unless options provided by rspec to filter tests - delegate windows? to Gem.win_platform? to get a consistent result - add jruby? helper - add gem_available? helper to check if gem is available (delegating to Gem.loaded_specs.key?) - use Gem::Version to compare versions
Diffstat (limited to 'spec/optimizer_spec.rb')
-rw-r--r--spec/optimizer_spec.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/spec/optimizer_spec.rb b/spec/optimizer_spec.rb
index 4882720a..e953b4b3 100644
--- a/spec/optimizer_spec.rb
+++ b/spec/optimizer_spec.rb
@@ -2,7 +2,7 @@
require_relative 'spec_helper'
-describe 'Asciidoctor::PDF::Optimizer' do
+describe 'Asciidoctor::PDF::Optimizer', if: (gem_available? 'rghost'), &(proc do
it 'should optimize output file if optimize attribute is set' do
input_file = Pathname.new example_file 'basic-example.adoc'
to_file = to_pdf_file input_file, 'optimizer-not-optimized.pdf'
@@ -125,4 +125,4 @@ describe 'Asciidoctor::PDF::Optimizer' do
pdf_info = (PDF::Reader.new to_file).info
(expect pdf_info[:Producer]).to include 'Ghostscript'
end
-end if ENV['RGHOST_VERSION']
+end)