Skip to content

Instantly share code, notes, and snippets.

@knowtheory
Created June 10, 2009 14:19
Show Gist options
  • Save knowtheory/127237 to your computer and use it in GitHub Desktop.
Save knowtheory/127237 to your computer and use it in GitHub Desktop.
here = File.dirname(__FILE__)
require File.join(here, 'spec_helper')
class IntegerProperty
include DataMapper::Resource
property :id, Serial
property :number, Integer
end
describe "stuff" do
before do
DataMapper.auto_migrate!
end
it "should coerce floats to integer" do
i = IntegerProperty.new(:number => 5.3)
i.number.should_not be_nil
i.number.should == 5
i.save
i = IntegerProperty.first
i.number.should_not be_nil
i.number.should == 5
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment