Sha256: f7a5a991a7a07b90bfd7e69fca4a8e35e15d042d7ae6f2a8de84494b843aaae5

Contents?: true

Size: 745 Bytes

Versions: 1

Compression:

Stored size: 745 Bytes

Contents

require 'test_helper'

context "Extension with constructors out the whazoo" do

  specify "should make constructors available" do
    Extension.new "constructors" do |e|
      e.sources full_dir("headers/constructors.h")
      node = e.namespace "constructors"


      node.classes("DoubleStringHolder").use_constructor(
        node.classes("DoubleStringHolder").constructors.find(:arguments => [nil, nil])
      )
    end

    require 'constructors'

    should.not.raise NameError do
      # Test complex constructors
      d = DoubleStringHolder.new("one", "two")
      one = d.get_one
      d.get_one.should == "one"
      d.get_two.should == "two"
    end
    
    should.raise TypeError do
      PrivateConstructor.new
    end
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rbplusplus-0.9.1 test/constructors_test.rb