Sha256: ae8bf3593320bf470fab06c7315291723b62914ac2c4d994078c69bd830afb5e

Contents?: true

Size: 777 Bytes

Versions: 5

Compression:

Stored size: 777 Bytes

Contents

require "test_helper"

describe "Querying for variables" do

  before(:all) do
    @variables_source ||= RbGCCXML.parse(full_dir("headers/classes.h")).namespaces("classes")
  end

  specify "find global variables and constants" do
    @variables_source.variables.length.should == 2
  end

  specify "find class variables" do
    test1 = @variables_source.classes("Test1")
    test1.variables.length.should == 4
    test1.variables.find(:access => :public).length.should == 2
    test1.variables("publicVariable").should_not be_nil
    test1.variables("publicVariable2").should_not be_nil
  end

  specify "can also find constants" do
    test1 = @variables_source.classes("Test1")
    test1.constants.length.should == 1
    test1.constants("CONST").should_not be_nil
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rbgccxml-1.0.4 spec/variables_test.rb
rbgccxml-1.0.3 spec/variables_test.rb
rbgccxml-1.0.2 spec/variables_test.rb
rbgccxml-1.0.1 spec/variables_test.rb
rbgccxml-1.0 test/variables_test.rb