Sha256: e29e4878c7bbc8d7da40e2f341b5409d7b1dc56f44d1c9f340d189278ca89986

Contents?: true

Size: 869 Bytes

Versions: 4

Compression:

Stored size: 869 Bytes

Contents

require File.expand_path('../gir_ffi_test_helper.rb', File.dirname(__FILE__))

require 'ffi-gobject'

describe GObject::Value do
  describe "::wrap_ruby_value class" do
    it "wraps a boolean false" do
      gv = GObject::Value.wrap_ruby_value false
      assert_instance_of GObject::Value, gv
      assert_equal false, gv.get_boolean
    end

    it "wraps a boolean true" do
      gv = GObject::Value.wrap_ruby_value true
      assert_instance_of GObject::Value, gv
      assert_equal true, gv.get_boolean
    end
  end

  describe "#ruby_value" do
    it "unwraps a boolean false" do
      gv = GObject::Value.wrap_ruby_value false
      result = gv.ruby_value
      assert_equal false, result
    end

    it "unwraps a boolean true" do
      gv = GObject::Value.wrap_ruby_value true
      result = gv.ruby_value
      assert_equal true, result
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
gir_ffi-0.2.2 test/ffi-gobject/value_test.rb
gir_ffi-0.2.1 test/ffi-gobject/value_test.rb
gir_ffi-0.2.0 test/ffi-gobject/value_test.rb
gir_ffi-0.1.0 test/ffi-gobject/value_test.rb