Sha256: fe028443504faaf54560525c6e52d678ebf0fcccb7eff43c614b9f4bd0f6eb1e

Contents?: true

Size: 631 Bytes

Versions: 4

Compression:

Stored size: 631 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')


include Piglet::Field


describe Literal do

  describe '#type' do
    it 'knows that the type of a string is chararray' do
      Literal.new("hello world").type.should eql(:chararray)
    end

    it 'knows that the type of an integer is int' do
      Literal.new(3).type.should eql(:int)
    end

    it 'knows that the type of a float is double' do
      Literal.new(3.14).type.should eql(:double)
    end
    
    it 'uses the specified type instead of the inferred' do
      Literal.new(3.14, :type => :float).type.should eql(:float)
    end
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
piglet-0.2.4 spec/piglet/field/literal_spec.rb
piglet-0.2.3 spec/piglet/field/literal_spec.rb
piglet-0.2.2 spec/piglet/field/literal_spec.rb
piglet-0.2.0 spec/piglet/field/literal_spec.rb