summaryrefslogtreecommitdiff
path: root/spec/cli_spec.rb
diff options
context:
space:
mode:
authorMarat Radchenko <marat@slonopotamus.org>2020-03-01 16:21:27 +0300
committerGitHub <noreply@github.com>2020-03-01 16:21:27 +0300
commit62b0405ecbf2ae01eeba2bc69f093bc17b152f7a (patch)
tree8bc9ac1824e03e05f666285bdea7f42ad8e01b73 /spec/cli_spec.rb
parenta377be4ddcb25849bf363133e8f013e971585570 (diff)
Add support for heredoc documents in test suite (PR #313)
Diffstat (limited to 'spec/cli_spec.rb')
-rw-r--r--spec/cli_spec.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/spec/cli_spec.rb b/spec/cli_spec.rb
index f3b39a2..e8980e3 100644
--- a/spec/cli_spec.rb
+++ b/spec/cli_spec.rb
@@ -10,7 +10,7 @@ describe 'asciidoctor-epub3' do
end
it 'exits with 1 when given nonexistent path' do
- _, err, res = to_epub '/nonexistent'
+ _, err, res = to_epub Pathname.new('/nonexistent')
expect(res.exitstatus).to eq(1)
expect(err).to match(/input file \/nonexistent( is)? missing/)
end
@@ -21,8 +21,8 @@ describe 'asciidoctor-epub3' do
_, err, res = run_command asciidoctor_epub3_bin,
'--failure-level=ERROR',
'-a', 'ebook-validate',
- fixture_file('invalid.adoc'),
- '-o', temp_file('invalid.epub')
+ fixture_file('invalid.adoc').to_s,
+ '-o', temp_file('invalid.epub').to_s
expect(res.exitstatus).to eq(1)
# Error from epubcheck
expect(err).to include 'ERROR(RSC-012)'
@@ -66,13 +66,13 @@ describe 'asciidoctor-epub3' do
end
def to_mobi in_file, out_file
- skip_if_darwin
- run_command asciidoctor_epub3_bin, '-a', 'ebook-format=mobi', in_file, '-o', out_file
+ skip_unless_has_kindlegen
+ run_command asciidoctor_epub3_bin, '-a', 'ebook-format=mobi', in_file.to_s, '-o', out_file.to_s
end
def to_epub in_file, out_file = nil
- argv = asciidoctor_epub3_bin + ['-a', 'ebook-validate', in_file]
- argv += ['-o', out_file] unless out_file.nil?
+ argv = asciidoctor_epub3_bin + ['-a', 'ebook-validate', in_file.to_s]
+ argv += ['-o', out_file.to_s] unless out_file.nil?
run_command argv
end
end