mongoid 0.7.2 → 0.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/lib/mongoid.rb +1 -0
- data/lib/mongoid/extensions/time/conversions.rb +1 -1
- data/mongoid.gemspec +1 -1
- data/spec/unit/mongoid/extensions/time/conversions_spec.rb +23 -5
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.7.
|
1
|
+
0.7.3
|
data/lib/mongoid.rb
CHANGED
data/mongoid.gemspec
CHANGED
@@ -3,22 +3,40 @@ require File.expand_path(File.join(File.dirname(__FILE__), "/../../../../spec_he
|
|
3
3
|
describe Mongoid::Extensions::Time::Conversions do
|
4
4
|
|
5
5
|
before do
|
6
|
-
|
6
|
+
Time.zone = "Eastern Time (US & Canada)"
|
7
|
+
@time = Time.local(1976, 11, 19)
|
8
|
+
end
|
9
|
+
|
10
|
+
after do
|
11
|
+
Time.zone = nil
|
7
12
|
end
|
8
13
|
|
9
14
|
describe "#set" do
|
15
|
+
|
10
16
|
context "when value is a string" do
|
11
|
-
|
12
|
-
|
17
|
+
|
18
|
+
it "converts to a utc time" do
|
19
|
+
Time.set(@time.to_s).utc_offset.should == 0
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
23
|
+
|
24
|
+
context "when value is a time" do
|
25
|
+
|
26
|
+
it "converts to a utc time" do
|
27
|
+
Time.set(@time).utc_offset.should == 0
|
13
28
|
end
|
29
|
+
|
14
30
|
end
|
15
31
|
|
16
32
|
end
|
17
33
|
|
18
34
|
describe "#get" do
|
19
|
-
|
20
|
-
|
35
|
+
|
36
|
+
it "returns the local time" do
|
37
|
+
Time.get(@time.dup.utc).utc_offset.should == @time.utc_offset
|
21
38
|
end
|
39
|
+
|
22
40
|
end
|
23
41
|
|
24
42
|
end
|