Skip to content

Commit

Permalink
Update changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
durran committed Nov 24, 2012
1 parent b9aee40 commit ab11595
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Expand Up @@ -7,6 +7,9 @@ For instructions on upgrading to newer versions, visit

### Resolved Issues

* \#2575 Prevent end of month times from rounding up since floats are not
precise enough to handle usec. (Steve Valaitis)

* \#2573 Don't use i18n for inspection messages.

* \#2571 Remove blank error message from locales. (Jordan Elver)
Expand Down
22 changes: 20 additions & 2 deletions spec/mongoid/extensions/time_spec.rb
Expand Up @@ -262,10 +262,19 @@
Time.mongoize(time).to_f.round(3).should eq(time.to_f.round(3))
end

it "doesn't round up at end of month" do
it "doesn't round up the hour at end of month" do
eom_time_mongoized.hour.should eq(eom_time.utc.hour)
end

it "doesn't round up the minute" do
eom_time_mongoized.min.should eq(eom_time.utc.min)
end

it "doesn't round up the seconds" do
eom_time_mongoized.sec.should eq(eom_time.utc.sec)
end

it "does not alter seconds" do
(eom_time_mongoized.strftime("%11N").to_i / 100.0).round(0).should eq(999999999)
end

Expand All @@ -292,10 +301,19 @@
)
end

it "doesn't round up at end of month" do
it "doesn't round up the hour" do
eom_time_mongoized.hour.should eq(eom_time.utc.hour)
end

it "doesn't round up the minutes" do
eom_time_mongoized.min.should eq(eom_time.utc.min)
end

it "doesn't round up the seconds" do
eom_time_mongoized.sec.should eq(eom_time.utc.sec)
end

it "does not alter the seconds" do
(eom_time_mongoized.strftime("%11N").to_i / 100.0).round(0).should eq(999999999)
end
end
Expand Down

0 comments on commit ab11595

Please sign in to comment.