Sha256: 9e56ef0aca02b63219d821b07406abad101d40ddbf12cee6d7d4584004bdebe7

Contents?: true

Size: 1.05 KB

Versions: 7

Compression:

Stored size: 1.05 KB

Contents

class WkhtmltopdfLocationTest < ActiveSupport::TestCase
  setup do
    @saved_config = WickedPdf.config
    WickedPdf.config = {}
  end

  teardown do
    WickedPdf.config = @saved_config
  end

  test 'should correctly locate wkhtmltopdf without bundler' do
    bundler_module = Bundler
    Object.send(:remove_const, :Bundler)

    assert_nothing_raised do
      WickedPdf.new
    end

    Object.const_set(:Bundler, bundler_module)
  end

  test 'should correctly locate wkhtmltopdf with bundler' do
    assert_nothing_raised do
      WickedPdf.new
    end
  end

  class LocationNonWritableTest < ActiveSupport::TestCase
    setup do
      @saved_config = WickedPdf.config
      WickedPdf.config = {}

      @old_home = ENV['HOME']
      ENV['HOME'] = '/not/a/writable/directory'
    end

    teardown do
      WickedPdf.config = @saved_config
      ENV['HOME'] = @old_home
    end

    test 'should correctly locate wkhtmltopdf with bundler while HOME is set to a non-writable directory' do
      assert_nothing_raised do
        WickedPdf.new
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
wicked_pdf-2.8.2 test/unit/wkhtmltopdf_location_test.rb
wicked_pdf-2.8.1 test/unit/wkhtmltopdf_location_test.rb
wicked_pdf-2.8.0 test/unit/wkhtmltopdf_location_test.rb
wicked_pdf-2.7.0 test/unit/wkhtmltopdf_location_test.rb
wicked_pdf-2.6.3 test/unit/wkhtmltopdf_location_test.rb
wicked_pdf-2.6.2 test/unit/wkhtmltopdf_location_test.rb
wicked_pdf-2.6.0 test/unit/wkhtmltopdf_location_test.rb