quantum_leap 0.5.0 → 0.6.0
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/README.md +12 -16
- data/lib/quantum_leap/version.rb +1 -1
- data/lib/quantum_leap.rb +3 -1
- data/spec/quantum_spec.rb +9 -8
- metadata +7 -17
data/README.md
CHANGED
@@ -20,25 +20,21 @@ Or install it yourself as:
|
|
20
20
|
|
21
21
|
## Usage
|
22
22
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
23
|
+
```ruby
|
24
|
+
Quantum.leap(Time.new(1956, 9, 13))
|
25
|
+
sam.must_be_kind_of(Pilot)
|
26
|
+
sam.must_win_baseball_game
|
27
|
+
Quantum.leap_back
|
28
|
+
```
|
27
29
|
|
28
30
|
Or with a block:
|
29
31
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
Time.now
|
38
|
-
=> 2012-05-31 21:25:34 -0400
|
39
|
-
Quantum.leap
|
40
|
-
Time.now
|
41
|
-
=> 2012-05-31 21:25:36 -0400
|
32
|
+
```ruby
|
33
|
+
Quantum.leap(Time.new(1974, 10, 24)) do
|
34
|
+
sam.must_be_kind_of(Boxer)
|
35
|
+
sam.must_win_the_championship
|
36
|
+
end
|
37
|
+
```
|
42
38
|
|
43
39
|
## Contributing
|
44
40
|
|
data/lib/quantum_leap/version.rb
CHANGED
data/lib/quantum_leap.rb
CHANGED
data/spec/quantum_spec.rb
CHANGED
@@ -52,16 +52,16 @@ describe Quantum do
|
|
52
52
|
|
53
53
|
describe 'with no argument' do
|
54
54
|
describe 'without a block' do
|
55
|
-
|
55
|
+
the_past = Time.new(1956, 9, 13, 15, 00)
|
56
56
|
|
57
57
|
it 'defaults to the current time' do
|
58
58
|
Quantum.leap
|
59
|
-
Time.now.must_be_within_delta(
|
59
|
+
Time.now.must_be_within_delta(the_past, 1)
|
60
60
|
end
|
61
61
|
|
62
62
|
it 'defaults to the current date' do
|
63
63
|
Quantum.leap
|
64
|
-
Date.today.must_equal(
|
64
|
+
Date.today.must_equal(the_past.to_date)
|
65
65
|
end
|
66
66
|
|
67
67
|
it 'returns the time' do
|
@@ -70,18 +70,19 @@ describe Quantum do
|
|
70
70
|
end
|
71
71
|
|
72
72
|
describe 'with a block' do
|
73
|
-
the_present = Time.
|
73
|
+
the_present = Time.now
|
74
|
+
the_past = Time.new(1956, 9, 13, 15, 00)
|
74
75
|
|
75
|
-
it '
|
76
|
+
it 'only changes time within the block' do
|
76
77
|
Quantum.leap do
|
77
|
-
Time.now.must_be_within_delta(
|
78
|
+
Time.now.must_be_within_delta(the_past, 1)
|
78
79
|
end
|
79
80
|
Time.now.must_be_within_delta(the_present, 1)
|
80
81
|
end
|
81
82
|
|
82
|
-
it '
|
83
|
+
it 'only changes date within the block' do
|
83
84
|
Quantum.leap do
|
84
|
-
Date.today.must_equal(
|
85
|
+
Date.today.must_equal(the_past.to_date)
|
85
86
|
end
|
86
87
|
Date.today.must_equal(the_present.to_date)
|
87
88
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: quantum_leap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-07-31 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
16
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirement: &70356085914680 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,15 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements:
|
25
|
-
none: false
|
26
|
-
requirements:
|
27
|
-
- - ! '>='
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
version: '0'
|
24
|
+
version_requirements: *70356085914680
|
30
25
|
- !ruby/object:Gem::Dependency
|
31
26
|
name: minitest-colorize
|
32
|
-
requirement: !ruby/object:Gem::Requirement
|
27
|
+
requirement: &70356085913680 !ruby/object:Gem::Requirement
|
33
28
|
none: false
|
34
29
|
requirements:
|
35
30
|
- - ! '>='
|
@@ -37,12 +32,7 @@ dependencies:
|
|
37
32
|
version: '0'
|
38
33
|
type: :development
|
39
34
|
prerelease: false
|
40
|
-
version_requirements:
|
41
|
-
none: false
|
42
|
-
requirements:
|
43
|
-
- - ! '>='
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
version: '0'
|
35
|
+
version_requirements: *70356085913680
|
46
36
|
description: Righting wrongs in your test suite with time travel!
|
47
37
|
email:
|
48
38
|
- mattonrails@shortmail.com
|
@@ -82,7 +72,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
82
72
|
version: '0'
|
83
73
|
requirements: []
|
84
74
|
rubyforge_project:
|
85
|
-
rubygems_version: 1.8.
|
75
|
+
rubygems_version: 1.8.16
|
86
76
|
signing_key:
|
87
77
|
specification_version: 3
|
88
78
|
summary: Lets you change the current time in your tests
|