Sha256: 3d6f7bbe1c09d66cb008ea1bcdf26b76dbe1590059ca208a229f98475d467f26

Contents?: true

Size: 864 Bytes

Versions: 2

Compression:

Stored size: 864 Bytes

Contents

require File.join(File.dirname(__FILE__), %w[.. spec_helper])
include FFI

describe Generator::Constant do
  it_should_behave_like 'All specs'
  before :all do
    @node = generate_xml_wrap_from('constants')
  end
  it 'should return a ruby constant assignment' do
    Generator::Constant.new(:node => (@node / 'constant')[0]).to_s.should == "CONST_1 = 0x10"
  end
  it 'should ignore constant qualifiers' do
    Generator::Constant.new(:node => (@node / 'constant')[1]).to_s.should == "CONST_2 = 1234"
    Generator::Constant.new(:node => (@node / 'constant')[2]).to_s.should == "CONST_3 = 1234"
    Generator::Constant.new(:node => (@node / 'constant')[3]).to_s.should == "CONST_4 = 1234"
  end
  it 'should handle strings' do
    pending do
      Generator::Constant.new(:node => (@node / 'constant')[4]).to_s.should == "CONST_5 = \"string\""
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ffi-swig-generator-0.3.2 spec/generator/constant_spec.rb
ffi-swig-generator-0.3.1 spec/generator/constant_spec.rb