Sha256: 21cb350cfd2e946356c9fa223126df36dab2366d6f8b9056e621925dc7c04b0f

Contents?: true

Size: 1016 Bytes

Versions: 7

Compression:

Stored size: 1016 Bytes

Contents

# encoding: utf-8

require 'test_helper'
require 'tmpdir'
require 'fileutils'
require 'yaml'
require 'rbconfig'

REVIEW_PDFMAKER = File.expand_path('../bin/review-pdfmaker-peg', File.dirname(__FILE__))

class PDFMakerCmdTest < Test::Unit::TestCase
  def setup
    @tmpdir1 = Dir.mktmpdir
    @tmpdir2 = Dir.mktmpdir

    @old_rubylib = ENV['RUBYLIB']
    ENV['RUBYLIB'] = File.expand_path('../lib', File.dirname(__FILE__))
  end

  def teardown
    FileUtils.rm_rf @tmpdir1
    FileUtils.rm_rf @tmpdir2
    ENV['RUBYLIB'] = @old_rubylib
  end

  def test_pdfmaker_cmd
    if RUBY_VERSION !~ /^1.8/
      config = prepare_samplebook(@tmpdir1)
      builddir = @tmpdir1 + "/" + config['bookname'] + '-pdf'
      assert ! File.exist?(builddir)

      ruby_cmd = File.join(RbConfig::CONFIG['bindir'], RbConfig::CONFIG['ruby_install_name'])
      Dir.chdir(@tmpdir1) do
        system("#{ruby_cmd} -S #{REVIEW_PDFMAKER} config.yml 1>/dev/null 2>/dev/null")
      end

      assert File.exist?(builddir)
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
review-peg-0.2.2 test/test_pdfmaker_cmd.rb
review-peg-0.2.1 test/test_pdfmaker_cmd.rb
review-peg-0.2.0 test/test_pdfmaker_cmd.rb
review-peg-0.1.3 test/test_pdfmaker_cmd.rb
review-peg-0.1.2 test/test_pdfmaker_cmd.rb
review-peg-0.1.1 test/test_pdfmaker_cmd.rb
review-peg-0.1.0 test/test_pdfmaker_cmd.rb