Adding support to :cast_as => 'Date'.

This commit is contained in:
Tapajós 2009-09-02 23:54:25 -03:00
parent 273a174aae
commit bc6df2f5ca
3 changed files with 10 additions and 1 deletions

View file

@ -122,7 +122,7 @@ describe "ExtendedDocument properties" do
describe "casting" do
describe "cast keys to any type" do
before(:all) do
event_doc = { :subject => "Some event", :occurs_at => Time.now }
event_doc = { :subject => "Some event", :occurs_at => Time.now, :end_date => Date.today }
e = Event.database.save_doc event_doc
@event = Event.get e['id']
@ -130,6 +130,9 @@ describe "ExtendedDocument properties" do
it "should cast occurs_at to Time" do
@event['occurs_at'].should be_an_instance_of(Time)
end
it "should cast end_date to Date" do
@event['end_date'].should be_an_instance_of(Date)
end
end
end