alphasights-integrity 0.1.9.7 → 0.1.9.8
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/integrity.gemspec +1 -1
- data/lib/integrity/commit.rb +2 -2
- data/test/unit/commit_test.rb +5 -9
- metadata +1 -1
data/integrity.gemspec
CHANGED
data/lib/integrity/commit.rb
CHANGED
@@ -59,10 +59,10 @@ module Integrity
|
|
59
59
|
end
|
60
60
|
|
61
61
|
def committed_at=(time_with_timezone)
|
62
|
-
unless time_with_timezone.respond_to?(:
|
62
|
+
unless time_with_timezone.respond_to?(:getlocal)
|
63
63
|
time_with_timezone = Time.parse(time_with_timezone)
|
64
64
|
end
|
65
|
-
attribute_set(:committed_at, time_with_timezone.
|
65
|
+
attribute_set(:committed_at, time_with_timezone.getlocal)
|
66
66
|
end
|
67
67
|
end
|
68
68
|
end
|
data/test/unit/commit_test.rb
CHANGED
@@ -46,18 +46,14 @@ class CommitTest < Test::Unit::TestCase
|
|
46
46
|
|
47
47
|
Commit.gen(:message => nil).message.should =~ /not loaded/
|
48
48
|
end
|
49
|
-
|
50
|
-
it "has a commit date" do
|
51
|
-
commit = Commit.gen(:committed_at => Time.utc(2008, 10, 12, 14, 18, 20))
|
52
|
-
commit.committed_at.to_s.should == "2008-10-12T14:18:20+00:00"
|
53
|
-
end
|
54
49
|
|
55
|
-
it "normalizes the commit date time to
|
56
|
-
|
50
|
+
it "normalizes the commit date time to the local timezone" do
|
51
|
+
ENV['TZ'] = 'US/Eastern' # -04:00
|
52
|
+
time = Time.parse("2009-04-16T02:24:51-07:00")
|
57
53
|
commit = Commit.gen(:committed_at => time)
|
58
|
-
commit.committed_at.to_s.should == "2009-04-
|
54
|
+
commit.committed_at.to_s.should == "2009-04-16T05:24:51-04:00"
|
59
55
|
end
|
60
|
-
|
56
|
+
|
61
57
|
it "has a human readable status" do
|
62
58
|
commit = Commit.gen(:successful, :identifier => "658ba96cb0235e82ee720510c049883955200fa9")
|
63
59
|
commit.human_readable_status.should be("Built 658ba96 successfully")
|