Sha256: 317d7f9dfe756a59687959842dfb95da690a28c9fd0a3c66905a2ab611a8cf36

Contents?: true

Size: 1.67 KB

Versions: 62

Compression:

Stored size: 1.67 KB

Contents

$LOAD_PATH.unshift File.expand_path('../lib', File.dirname(__FILE__))
require 'test/unit'
require 'autoproj'
require 'flexmock/test_unit'

class TC_OSDependencies_AptDpkgManager < Test::Unit::TestCase
    def test_status_file_parsing
        file = File.expand_path("apt-dpkg-status", File.dirname(__FILE__))
        mng = Autoproj::PackageManagers::AptDpkgManager.new(file)
        assert mng.installed?('installed-package')
        assert !mng.installed?('noninstalled-package')
    end

    def test_status_file_parsing_is_robust_to_invalid_utf8
        Tempfile.open 'osdeps_aptdpkg' do |io|
            io.puts "Package: \x80\nStatus: installed ok install\n\nPackage: installed\nStatus: installed ok install"
            io.flush
            mng = Autoproj::PackageManagers::AptDpkgManager.new(io.path)
            mng.installed?('installed')
        end
    end

    def test_status_file_parsing_last_entry_installed
        file = File.expand_path("apt-dpkg-status.installed-last", File.dirname(__FILE__))
        mng = Autoproj::PackageManagers::AptDpkgManager.new(file)
        assert mng.installed?('installed-package')
    end

    def test_status_file_parsing_last_entry_not_installed
        file = File.expand_path("apt-dpkg-status.noninstalled-last", File.dirname(__FILE__))
        mng = Autoproj::PackageManagers::AptDpkgManager.new(file)
        assert !mng.installed?('noninstalled-package')
    end

    def test_status_file_parsing_not_there_means_not_installed
        file = File.expand_path("apt-dpkg-status.noninstalled-last", File.dirname(__FILE__))
        mng = Autoproj::PackageManagers::AptDpkgManager.new(file)
        assert !mng.installed?('non-existent-package')
    end
end

Version data entries

62 entries across 62 versions & 1 rubygems

Version Path
autoproj-1.13.7 test/package_managers/test_apt_dpkg_manager.rb
autoproj-1.13.6 test/package_managers/test_apt_dpkg_manager.rb
autoproj-1.13.5 test/package_managers/test_apt_dpkg_manager.rb
autoproj-1.13.5.rc1 test/package_managers/test_apt_dpkg_manager.rb
autoproj-1.13.4 test/package_managers/test_apt_dpkg_manager.rb
autoproj-1.13.3 test/package_managers/test_apt_dpkg_manager.rb
autoproj-1.13.3.b2 test/package_managers/test_apt_dpkg_manager.rb
autoproj-1.13.3.b1 test/package_managers/test_apt_dpkg_manager.rb
autoproj-1.13.2.b4 test/package_managers/test_apt_dpkg_manager.rb
autoproj-1.13.2.b3 test/package_managers/test_apt_dpkg_manager.rb
autoproj-1.13.2.b2 test/package_managers/test_apt_dpkg_manager.rb
autoproj-1.13.2.b1 test/package_managers/test_apt_dpkg_manager.rb
autoproj-2.0.0.b7 test/package_managers/test_apt_dpkg_manager.rb
autoproj-2.0.0.b6 test/package_managers/test_apt_dpkg_manager.rb
autoproj-2.0.0.b5 test/package_managers/test_apt_dpkg_manager.rb
autoproj-2.0.0.b4 test/package_managers/test_apt_dpkg_manager.rb
autoproj-2.0.0.b3 test/package_managers/test_apt_dpkg_manager.rb
autoproj-2.0.0.b2 test/package_managers/test_apt_dpkg_manager.rb
autoproj-2.0.0.b1 test/package_managers/test_apt_dpkg_manager.rb
autoproj-1.13.2 test/package_managers/test_apt_dpkg_manager.rb