Sha256: e63a01099da667532475e0689f9ba5ba2363cb1d65172d0113b79d878a3f5ee7

Contents?: true

Size: 1.18 KB

Versions: 2

Compression:

Stored size: 1.18 KB

Contents

#! /usr/bin/env ruby
require File.dirname(__FILE__) + '/test_helper.rb'
require '_external_tools'
require '_test-util'

class AptTest < Test::Unit::TestCase
  def _test_apt_get_temporary_directory(aptget)
    assert(File.directory?(aptget.temporary_directory))
    aptget.clean
    assert_equal(false, File.directory?(aptget.temporary_directory))
  end

  def test_apt_get
    return unless Gonzui::AptGet.available?
    apt_type = Gonzui::AptGet.get_apt_type
    assert((apt_type == :rpm or apt_type == :deb))
    config = Gonzui::Config.new
    aptget = Gonzui::AptGet.new(config, "portmap")

    directory = aptget.extract
    assert(File.directory?(directory))

    _test_apt_get_temporary_directory(aptget)
  end

  def test_apt_get_nonexisting
    return unless Gonzui::AptGet.available?
    apt_type = Gonzui::AptGet.get_apt_type
    assert((apt_type == :rpm or apt_type == :deb))
    config = Gonzui::Config.new
    aptget = Gonzui::AptGet.new(config, "qpewrguiniquegnoqwiu")
    begin
      aptget.extract
      assert(false)
    rescue Gonzui::AptGetError => e
      assert(true)
    end

    _test_apt_get_temporary_directory(aptget)
  end
end if (APT_)

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
gonzui-1.2-x86-mswin32-60 test/test_apt.rb
gonzui-1.2 test/test_apt.rb