Permalink
Browse files

Adding tests for FreeBSD support

  • Loading branch information...
1 parent d3a37b5 commit 497b09c13d8f0662b54fe93eef1cc8a49ce3d6b8 @kmwhite kmwhite committed Sep 30, 2011
Showing with 14 additions and 0 deletions.
  1. +14 −0 test/virtualbox/lib_test.rb
@@ -15,6 +15,7 @@ class LibTest < Test::Unit::TestCase
should "return Mac-path if on mac" do
result = ["/Applications/VirtualBox.app/Contents/MacOS/VBoxXPCOMC.dylib"]
VirtualBox::Platform.stubs(:mac?).returns(true)
+ VirtualBox::Platform.stubs(:freebsd?).returns(false)
assert_equal result, VirtualBox::Lib.lib_path
end
@@ -24,6 +25,7 @@ class LibTest < Test::Unit::TestCase
VirtualBox::Platform.stubs(:mac?).returns(false)
VirtualBox::Platform.stubs(:linux?).returns(false)
VirtualBox::Platform.stubs(:windows?).returns(true)
+ VirtualBox::Platform.stubs(:freebsd?).returns(false)
assert_equal result, VirtualBox::Lib.lib_path
end
@@ -33,6 +35,17 @@ class LibTest < Test::Unit::TestCase
VirtualBox::Platform.stubs(:mac?).returns(false)
VirtualBox::Platform.stubs(:windows?).returns(false)
VirtualBox::Platform.stubs(:linux?).returns(true)
+ VirtualBox::Platform.stubs(:freebsd?).returns(false)
+
+ assert_equal result, VirtualBox::Lib.lib_path
+ end
+
+ should "return FreeBSD-path if on freebsd" do
+ result = ["/usr/local/lib/virtualbox/VBoxXPCOMC.so"]
+ VirtualBox::Platform.stubs(:mac?).returns(false)
+ VirtualBox::Platform.stubs(:windows?).returns(false)
+ VirtualBox::Platform.stubs(:linux?).returns(false)
+ VirtualBox::Platform.stubs(:freebsd?).returns(true)
assert_equal result, VirtualBox::Lib.lib_path
end
@@ -42,6 +55,7 @@ class LibTest < Test::Unit::TestCase
VirtualBox::Platform.stubs(:mac?).returns(false)
VirtualBox::Platform.stubs(:windows?).returns(false)
VirtualBox::Platform.stubs(:linux?).returns(false)
+ VirtualBox::Platform.stubs(:freebsd?).returns(false)
assert_equal result, VirtualBox::Lib.lib_path
end

0 comments on commit 497b09c

Please sign in to comment.