Sha256: 7e8c7e5485f6ad4d54c68f5ae0f94b20443cdad34b1bbe50559408297909bd4e

Contents?: true

Size: 1.21 KB

Versions: 28

Compression:

Stored size: 1.21 KB

Contents

require 'spec_helper'
require 'amalgalite/type_maps/storage_map'

describe Amalgalite::TypeMaps::StorageMap do
  before(:each) do
    @map = Amalgalite::TypeMaps::StorageMap.new
  end

  describe "#bind_type_of" do

    it "Float is bound to DataType::FLOAT" do
      @map.bind_type_of( 3.14 ).should == ::Amalgalite::SQLite3::Constants::DataType::FLOAT
    end

    it "Integer is bound to DataType::INTGER" do
      @map.bind_type_of( 42 ).should == ::Amalgalite::SQLite3::Constants::DataType::INTEGER
    end

    it "nil is bound to DataType::NULL" do
      @map.bind_type_of( nil ).should == ::Amalgalite::SQLite3::Constants::DataType::NULL
    end

    it "::Amalgalite::Blob is bound to DataType::BLOB" do
      @map.bind_type_of( ::Amalgalite::Blob.new( :string => "testing mapping", :column => true )  ).should == ::Amalgalite::SQLite3::Constants::DataType::BLOB
    end

    it "everything else is bound to DataType::TEXT" do
      @map.bind_type_of( "everything else" ).should == ::Amalgalite::SQLite3::Constants::DataType::TEXT
    end

  end

  describe "#result_value_of" do
    it "returns the original object for everything passed in" do
      @map.result_value_of( "doesn't matter", 42 ).should == 42
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
amalgalite-1.9.4-x64-mingw-ucrt spec/storage_map_spec.rb
amalgalite-1.9.4-x86-mingw32 spec/storage_map_spec.rb
amalgalite-1.9.4-x64-mingw32 spec/storage_map_spec.rb
amalgalite-1.9.4 spec/storage_map_spec.rb
amalgalite-1.9.1-x86-mingw32 spec/storage_map_spec.rb
amalgalite-1.9.1-x64-mingw32 spec/storage_map_spec.rb
amalgalite-1.9.1-x64-mingw-ucrt spec/storage_map_spec.rb
amalgalite-1.9.1 spec/storage_map_spec.rb
amalgalite-1.9.0-x64-mingw-ucrt spec/storage_map_spec.rb
amalgalite-1.9.0-x86-mingw32 spec/storage_map_spec.rb
amalgalite-1.9.0-x64-mingw32 spec/storage_map_spec.rb
amalgalite-1.9.0 spec/storage_map_spec.rb
amalgalite-1.8.0-x64-mingw-ucrt spec/storage_map_spec.rb
amalgalite-1.8.0-x64-mingw32 spec/storage_map_spec.rb
amalgalite-1.8.0-x86-mingw32 spec/storage_map_spec.rb
amalgalite-1.8.0 spec/storage_map_spec.rb
amalgalite-1.7.0-x86-mingw32 spec/storage_map_spec.rb
amalgalite-1.7.0-x64-mingw32 spec/storage_map_spec.rb
amalgalite-1.7.0 spec/storage_map_spec.rb
amalgalite-1.6.3-x86-mingw32 spec/storage_map_spec.rb