Sha256: 9212e8df78351ddf6b2e779056295bc5e7fecaad30804ff285cbcb53b65664ea

Contents?: true

Size: 1.15 KB

Versions: 16

Compression:

Stored size: 1.15 KB

Contents

require File.expand_path("../../../test_helper", __FILE__)

class COMFFIInterfaceBaseTest < Test::Unit::TestCase
  setup do
    @klass = VirtualBox::COM::FFIInterface
  end

  context "class methods" do
    context "setting up" do
      should "set the ffi lib to the given path then attach function" do
        lib = :foo

        setup_seq = sequence('setup_seq')
        @klass.expects(:ffi_lib).with(lib).in_sequence(setup_seq)
        @klass.expects(:attach_function).with(:VBoxGetXPCOMCFunctions, anything, anything).in_sequence(setup_seq)
        @klass.setup(lib)
      end
    end

    context "creating" do
      should "setup the initialize" do
        lib = :foo
        result = mock("result")
        create_seq = sequence("create_seq")
        @klass.expects(:setup).with(lib).in_sequence(create_seq)
        @klass.expects(:new).returns(result).in_sequence(create_seq)
        assert_equal result, @klass.create(lib)
      end
    end
  end

  context "initialization" do
    should "initialize com interface" do
      @klass.any_instance.expects(:initialize_com).once
      @klass.new
    end
  end

  context "initializing com interface" do
    # TODO
  end
end

Version data entries

16 entries across 16 versions & 3 rubygems

Version Path
virtualbox-0.9.2 test/virtualbox/com/ffi_interface_test.rb
virtualbox-0.9.1 test/virtualbox/com/ffi_interface_test.rb
virtualbox-0.9.0 test/virtualbox/com/ffi_interface_test.rb
virtualbox-0.8.6 test/virtualbox/com/ffi_interface_test.rb
virtualbox-0.8.5 test/virtualbox/com/ffi_interface_test.rb
virtualbox-0.8.4 test/virtualbox/com/ffi_interface_test.rb
velir_virtualbox-0.8.4 test/virtualbox/com/ffi_interface_test.rb
virtualbox-0.8.3 test/virtualbox/com/ffi_interface_test.rb
virtualbox-0.8.2 test/virtualbox/com/ffi_interface_test.rb
virtualbox-0.8.1 test/virtualbox/com/ffi_interface_test.rb
virtualbox-0.8.0 test/virtualbox/com/ffi_interface_test.rb
virtualbox-0.7.9 test/virtualbox/com/ffi_interface_test.rb
virtualbox-0.7.8 test/virtualbox/com/ffi_interface_test.rb
virtualbox-0.7.7 test/virtualbox/com/ffi_interface_test.rb
virtualbox-0.7.6 test/virtualbox/com/ffi_interface_test.rb
bbrowning-virtualbox-0.7.6.dev test/virtualbox/com/ffi_interface_test.rb