Sha256: 322c3d23e7316db4439828aa9f55e55d448bf2b6ef8982e5325ea98202a2e615

Contents?: true

Size: 1.49 KB

Versions: 8

Compression:

Stored size: 1.49 KB

Contents

require File.join(File.dirname(__FILE__), '..', '..', 'test_helper')
require 'virtualbox/ext/platform'

class PlatformTest < Test::Unit::TestCase
  context "mac" do
    should "return true if it contains darwin" do
      success = ["i386-darwin", "i686-darwin10", "imadarwin"]
      success.each do |item|
        VirtualBox::Platform.stubs(:platform).returns(item)
        assert VirtualBox::Platform.mac?
      end
    end
  end

  context "windows" do
    should "return true if it contains mswin" do
      success = ["i386-mswin32", "i686-mswin64", "imswin"]
      success.each do |item|
        VirtualBox::Platform.stubs(:platform).returns(item)
        assert VirtualBox::Platform.windows?
      end
    end

    should "return true if it contains mingw" do
      success = ["i386-mingw32", "i686-mingw64", "mingw"]
      success.each do |item|
        VirtualBox::Platform.stubs(:platform).returns(item)
        assert VirtualBox::Platform.windows?
      end
    end

    should "return true if it contains cygwin" do
      success = ["i386-cygwin", "i686-cygwin64", "cygwin"]
      success.each do |item|
        VirtualBox::Platform.stubs(:platform).returns(item)
        assert VirtualBox::Platform.windows?
      end
    end
  end

  context "linux" do
    should "return true if it contains linux" do
      success = ["i386-linux", "i686-linux241", "linux"]
      success.each do |item|
        VirtualBox::Platform.stubs(:platform).returns(item)
        assert VirtualBox::Platform.linux?
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
virtualbox-0.7.5 test/virtualbox/ext/platform_test.rb
virtualbox-0.7.4 test/virtualbox/ext/platform_test.rb
virtualbox-0.7.3 test/virtualbox/ext/platform_test.rb
virtualbox-0.7.2 test/virtualbox/ext/platform_test.rb
virtualbox-0.7.1 test/virtualbox/ext/platform_test.rb
virtualbox-0.7.0 test/virtualbox/ext/platform_test.rb
virtualbox-0.6.1 test/virtualbox/ext/platform_test.rb
virtualbox-0.6.0 test/virtualbox/ext/platform_test.rb