Sha256: 8ebad69c3f3d77942bf3206f95ff762bcbe089ec39b6c15d88d90bcc99362401

Contents?: true

Size: 999 Bytes

Versions: 24

Compression:

Stored size: 999 Bytes

Contents

require 'helper'

class TestPlatform < Test::Unit::TestCase
  
  include CSD
  
  context "A Gem::Platform object for this machine" do
  
    setup do
      Options.clear
    end
  
    should "try to get kernel information if this is linux even in reveal mode" do
      if Gem::Platform.local.os == 'linux'
        Options.reveal = true
        assert Gem::Platform.local.kernel_release
        assert Gem::Platform.local.kernel_version
      end
    end
    
    should "know whether it's debian or not" do
      assert !Gem::Platform.local.debian? if Gem::Platform.local.os == 'darwin'
      # TODO: This is not the best way to determine debian or red hat
      assert Gem::Platform.local.debian? if Gem::Platform.local.os == 'linux' and Cmd.run('which dpkg', :internal => true, :die_on_failure => false).success?
      assert !Gem::Platform.local.debian? if Gem::Platform.local.os == 'linux' and Cmd.run('which rpm', :internal => true, :die_on_failure => false).success?
    end
    
  end

end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
csd-0.4.3 test/unit/test_platform.rb
csd-0.4.2 test/unit/test_platform.rb
csd-0.4.1 test/unit/test_platform.rb
csd-0.4.0 test/unit/test_platform.rb
csd-0.3.7 test/unit/test_platform.rb
csd-0.3.6 test/unit/test_platform.rb
csd-0.3.5 test/unit/test_platform.rb
csd-0.3.4 test/unit/test_platform.rb
csd-0.3.3 test/unit/test_platform.rb
csd-0.3.2 test/unit/test_platform.rb
csd-0.3.1 test/unit/test_platform.rb
csd-0.3.0 test/unit/test_platform.rb
csd-0.2.2 test/unit/test_platform.rb
csd-0.2.1 test/unit/test_platform.rb
csd-0.2.0 test/unit/test_platform.rb
csd-0.1.18 test/unit/test_platform.rb
csd-0.1.17 test/unit/test_platform.rb
csd-0.1.16 test/unit/test_platform.rb
csd-0.1.15 test/unit/test_platform.rb
csd-0.1.14 test/unit/test_platform.rb