Sha256: c39a2718dbc374ed2499657d978269645d688e844e11c271c73c6be3c4c96077
Contents?: true
Size: 1.21 KB
Versions: 9
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 "Fixnum 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
9 entries across 9 versions & 2 rubygems