timecop 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/timecop.rb +2 -1
- data/lib/timecop/time_stack_item.rb +1 -2
- data/lib/timecop/version.rb +3 -0
- data/test/time_stack_item_test.rb +6 -0
- metadata +28 -43
- data/VERSION.yml +0 -4
data/lib/timecop.rb
CHANGED
@@ -1 +1,2 @@
|
|
1
|
-
require 'timecop/timecop'
|
1
|
+
require 'timecop/timecop'
|
2
|
+
require 'timecop/version'
|
@@ -84,8 +84,7 @@ class Timecop
|
|
84
84
|
end
|
85
85
|
|
86
86
|
def parse_time(*args)
|
87
|
-
time_klass = Time
|
88
|
-
time_klass = Time.zone if Time.respond_to? :zone
|
87
|
+
time_klass = Time.respond_to?(:zone) && Time.zone ? Time.zone : Time
|
89
88
|
arg = args.shift
|
90
89
|
if arg.is_a?(Time)
|
91
90
|
if Timecop.active_support != false && arg.respond_to?(:in_time_zone)
|
@@ -201,4 +201,10 @@ class TestTimeStackItem < Test::Unit::TestCase
|
|
201
201
|
Time.any_instance.expects(:in_time_zone).never
|
202
202
|
Timecop::TimeStackItem.new(:freeze, Time.now)
|
203
203
|
end
|
204
|
+
|
205
|
+
def test_parse_date
|
206
|
+
assert_nothing_raised do
|
207
|
+
Timecop.freeze(Date.new(2012, 6, 9))
|
208
|
+
end
|
209
|
+
end
|
204
210
|
end
|
metadata
CHANGED
@@ -1,43 +1,35 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: timecop
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.5.1
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 5
|
9
|
-
- 0
|
10
|
-
version: 0.5.0
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Travis Jeffery
|
14
9
|
- John Trupiano
|
15
10
|
autorequire:
|
16
11
|
bindir: bin
|
17
12
|
cert_chain: []
|
18
|
-
|
19
|
-
date: 2012-09-05 00:00:00 -05:00
|
20
|
-
default_executable:
|
13
|
+
date: 2012-09-05 00:00:00.000000000 Z
|
21
14
|
dependencies: []
|
22
|
-
|
23
|
-
|
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.
|
24
18
|
email: travisjeffery@gmail.com
|
25
19
|
executables: []
|
26
|
-
|
27
20
|
extensions: []
|
28
|
-
|
29
|
-
extra_rdoc_files:
|
21
|
+
extra_rdoc_files:
|
30
22
|
- LICENSE
|
31
23
|
- README.markdown
|
32
|
-
files:
|
24
|
+
files:
|
33
25
|
- History.rdoc
|
34
26
|
- LICENSE
|
35
27
|
- README.markdown
|
36
28
|
- Rakefile
|
37
|
-
- VERSION.yml
|
38
29
|
- lib/timecop.rb
|
39
30
|
- lib/timecop/time_extensions.rb
|
40
31
|
- lib/timecop/time_stack_item.rb
|
32
|
+
- lib/timecop/version.rb
|
41
33
|
- lib/timecop/timecop.rb
|
42
34
|
- test/run_tests.sh
|
43
35
|
- test/test_helper.rb
|
@@ -45,41 +37,34 @@ files:
|
|
45
37
|
- test/timecop_test.rb
|
46
38
|
- test/timecop_without_date_test.rb
|
47
39
|
- test/timecop_without_date_but_with_time_test.rb
|
48
|
-
has_rdoc: true
|
49
40
|
homepage: http://github.com/jtrupiano/timecop
|
50
41
|
licenses: []
|
51
|
-
|
52
42
|
post_install_message:
|
53
|
-
rdoc_options:
|
43
|
+
rdoc_options:
|
54
44
|
- --charset=UTF-8
|
55
|
-
require_paths:
|
45
|
+
require_paths:
|
56
46
|
- lib
|
57
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
47
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
58
48
|
none: false
|
59
|
-
requirements:
|
60
|
-
- -
|
61
|
-
- !ruby/object:Gem::Version
|
62
|
-
|
63
|
-
|
64
|
-
- 0
|
65
|
-
version: "0"
|
66
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
49
|
+
requirements:
|
50
|
+
- - ! '>='
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: '0'
|
53
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
67
54
|
none: false
|
68
|
-
requirements:
|
69
|
-
- -
|
70
|
-
- !ruby/object:Gem::Version
|
71
|
-
|
72
|
-
segments:
|
73
|
-
- 0
|
74
|
-
version: "0"
|
55
|
+
requirements:
|
56
|
+
- - ! '>='
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
version: '0'
|
75
59
|
requirements: []
|
76
|
-
|
77
60
|
rubyforge_project: johntrupiano
|
78
|
-
rubygems_version: 1.
|
61
|
+
rubygems_version: 1.8.10
|
79
62
|
signing_key:
|
80
63
|
specification_version: 3
|
81
|
-
summary: A gem providing "time travel" and "time freezing" capabilities, making it
|
82
|
-
|
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.
|
67
|
+
test_files:
|
83
68
|
- test/test_helper.rb
|
84
69
|
- test/time_stack_item_test.rb
|
85
70
|
- test/timecop_test.rb
|
data/VERSION.yml
DELETED