timecop 0.5.7 → 0.5.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/lib/timecop/time_stack_item.rb +6 -7
- data/lib/timecop/version.rb +1 -1
- data/test/time_stack_item_test.rb +1 -1
- metadata +18 -20
@@ -51,15 +51,14 @@ class Timecop
|
|
51
51
|
end
|
52
52
|
|
53
53
|
def time(time_klass = Time) #:nodoc:
|
54
|
-
|
55
|
-
|
54
|
+
begin
|
55
|
+
time = time_klass.at(@time)
|
56
|
+
rescue
|
57
|
+
time = time_klass.at(@time.to_f)
|
58
|
+
end
|
56
59
|
|
57
60
|
if travel_offset.nil?
|
58
|
-
|
59
|
-
actual_time
|
60
|
-
else
|
61
|
-
calculated_time
|
62
|
-
end
|
61
|
+
time
|
63
62
|
elsif scaling_factor.nil?
|
64
63
|
time_klass.at(Time.now_without_mock_time + travel_offset)
|
65
64
|
else
|
data/lib/timecop/version.rb
CHANGED
metadata
CHANGED
@@ -1,20 +1,18 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: timecop
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
|
4
|
+
prerelease:
|
5
|
+
version: 0.5.8
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Travis Jeffery
|
9
9
|
- John Trupiano
|
10
|
-
autorequire:
|
10
|
+
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2013-01-08 00:00:00.000000000 Z
|
14
14
|
dependencies: []
|
15
|
-
description: A gem providing "time travel" and "time freezing" capabilities, making
|
16
|
-
it dead simple to test time-dependent code. It provides a unified method to mock
|
17
|
-
Time.now, Date.today, and DateTime.now in a single call.
|
15
|
+
description: A gem providing "time travel" and "time freezing" capabilities, making it dead simple to test time-dependent code. It provides a unified method to mock Time.now, Date.today, and DateTime.now in a single call.
|
18
16
|
email: travisjeffery@gmail.com
|
19
17
|
executables: []
|
20
18
|
extensions: []
|
@@ -39,31 +37,31 @@ files:
|
|
39
37
|
- test/timecop_without_date_but_with_time_test.rb
|
40
38
|
homepage: https://github.com/travisjeffery/timecop
|
41
39
|
licenses: []
|
42
|
-
post_install_message:
|
40
|
+
post_install_message:
|
43
41
|
rdoc_options:
|
44
|
-
- --charset=UTF-8
|
42
|
+
- "--charset=UTF-8"
|
45
43
|
require_paths:
|
46
44
|
- lib
|
47
45
|
required_ruby_version: !ruby/object:Gem::Requirement
|
48
|
-
none: false
|
49
46
|
requirements:
|
50
|
-
- -
|
47
|
+
- - ">="
|
51
48
|
- !ruby/object:Gem::Version
|
52
|
-
version:
|
53
|
-
|
49
|
+
version: !binary |-
|
50
|
+
MA==
|
54
51
|
none: false
|
52
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
55
53
|
requirements:
|
56
|
-
- -
|
54
|
+
- - ">="
|
57
55
|
- !ruby/object:Gem::Version
|
58
|
-
version:
|
56
|
+
version: !binary |-
|
57
|
+
MA==
|
58
|
+
none: false
|
59
59
|
requirements: []
|
60
60
|
rubyforge_project: timecop
|
61
|
-
rubygems_version: 1.8.
|
62
|
-
signing_key:
|
61
|
+
rubygems_version: 1.8.24
|
62
|
+
signing_key:
|
63
63
|
specification_version: 3
|
64
|
-
summary: A gem providing "time travel" and "time freezing" capabilities, making it
|
65
|
-
dead simple to test time-dependent code. It provides a unified method to mock Time.now,
|
66
|
-
Date.today, and DateTime.now in a single call.
|
64
|
+
summary: A gem providing "time travel" and "time freezing" capabilities, making it dead simple to test time-dependent code. It provides a unified method to mock Time.now, Date.today, and DateTime.now in a single call.
|
67
65
|
test_files:
|
68
66
|
- test/test_helper.rb
|
69
67
|
- test/time_stack_item_test.rb
|