Permalink
Browse files

Updated specs to ensure the usec is persisted for SQLite3 and PostgreSQL

  • Loading branch information...
1 parent 97dcebf commit f706acb952d9c72cfcb0c5438f92134bd7bd8bd9 Dan Kubb committed Mar 29, 2009
Showing with 7 additions and 3 deletions.
  1. +7 −3 spec/integration/auto_migrations_spec.rb
@@ -116,7 +116,7 @@ class ShortStoryCollection < StoryCollection
}
types.each do |name,(klass,type,nullable,default,key)|
- describe "a #{klass} property" do
+ describe "a #{klass} property (#{name})" do
it "should be created as a #{type}" do
@table_set[name.to_s].type.should == type
end
@@ -133,6 +133,8 @@ class ShortStoryCollection < StoryCollection
it 'should properly typecast value' do
if DateTime == klass
@book.send(name).to_s.should == expected_value.to_s
+ elsif Time == klass
+ @book.send(name).strftime("%a %b %d %H:%M:%S %Z %Y #{@book.send(name).usec}").should == expected_value.strftime("%a %b %d %H:%M:%S %Z %Y #{expected_value.usec}")
else
@book.send(name).should == expected_value
end
@@ -228,7 +230,7 @@ class ShortStoryCollection < StoryCollection
}
types.each do |name,(klass,type,nullable,default,key)|
- describe "a #{klass} property" do
+ describe "a #{klass} property (#{name})" do
it "should be created as a #{type}" do
@table_set[name.to_s].type.should == type
end
@@ -372,7 +374,7 @@ class ShortStoryCollection < StoryCollection
}
types.each do |name,(klass,type,nullable,default,key)|
- describe "a #{Extlib::Inflection.classify(name.to_s)} property" do
+ describe "a #{klass} property (#{name})" do
it "should be created as a #{type}" do
@table_set[name.to_s].type.should == type
end
@@ -389,6 +391,8 @@ class ShortStoryCollection < StoryCollection
it 'should properly typecast value' do
if DateTime == klass
@book.send(name).to_s.should == expected_value.to_s
+ elsif Time == klass
+ @book.send(name).strftime("%a %b %d %H:%M:%S %Z %Y #{@book.send(name).usec}").should == expected_value.strftime("%a %b %d %H:%M:%S %Z %Y #{expected_value.usec}")
else
@book.send(name).should == expected_value
end

0 comments on commit f706acb

Please sign in to comment.