test_suite_time_machine 1.0.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -2
- data/README.md +3 -3
- data/lib/test_suite_time_machine/version.rb +1 -1
- data/lib/test_suite_time_machine.rb +10 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f7d8bffa154b7ea1816f762a58085d24a30fddca8634d8ea9c836545ab0f40e4
|
4
|
+
data.tar.gz: b7bea13ebf504f57756f014fd2f09d8a9a32fda3abf5e9155fe8d154386362da
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bce971229b016bd62013e8e50ad393b86ba3cdd1d2f47822e1aae18d3bf16cdc3e804b9b2519e695641ed492e77a6af6f3ec51a2ca697cf9038e8e63c4c4ed75
|
7
|
+
data.tar.gz: a4f21ee8883e3ac3f69a505fb5b2dc2357bd5fb157d56f5137beae340f86c45badebca854577aef2661b744d62e8c4302e87b8f71cab5c522dce3500eaeb7ee9
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
-
## [
|
1
|
+
## [2.0.0] - 2024-04-29
|
2
2
|
|
3
|
-
-
|
3
|
+
- Fix README typo
|
4
|
+
- Automatically set up the baseline time for each test if not already set
|
5
|
+
- Automatically reset to the baseline time before and after each test
|
6
|
+
|
7
|
+
## [1.0.0] - 2023-07-20
|
8
|
+
|
9
|
+
- Extract the code from the original application into its initial release
|
data/README.md
CHANGED
@@ -10,11 +10,11 @@ pretend to run the entire suite on New Year's Day 2038.
|
|
10
10
|
|
11
11
|
Install the gem and add to the application's Gemfile by executing:
|
12
12
|
|
13
|
-
$ bundle add
|
13
|
+
$ bundle add test_suite_time_machine
|
14
14
|
|
15
15
|
If bundler is not being used to manage dependencies, install the gem by executing:
|
16
16
|
|
17
|
-
$ gem install
|
17
|
+
$ gem install test_suite_time_machine
|
18
18
|
|
19
19
|
## Usage
|
20
20
|
|
@@ -76,7 +76,7 @@ This provides the following functionality:
|
|
76
76
|
- adds `travel_temporarily_to(datetime)` as an alias for `TestSuiteTimeMachine.travel_temporarily_to(datetime)`
|
77
77
|
|
78
78
|
It also adds the RSpec tag `time` which is a succinct way of invoking
|
79
|
-
`
|
79
|
+
`travel_permanently_to` for a given test.
|
80
80
|
|
81
81
|
```ruby
|
82
82
|
RSpec.describe "Santa's schedule" do
|
@@ -139,6 +139,16 @@ module TestSuiteTimeMachine
|
|
139
139
|
end
|
140
140
|
|
141
141
|
def self.included(config)
|
142
|
+
RSpec.configuration.before(:suite) do
|
143
|
+
TestSuiteTimeMachine.pretend_it_is("real_world") if TestSuiteTimeMachine.baseline.nil?
|
144
|
+
end
|
145
|
+
|
146
|
+
config.around do |example|
|
147
|
+
TestSuiteTimeMachine.reset
|
148
|
+
example.run
|
149
|
+
TestSuiteTimeMachine.reset
|
150
|
+
end
|
151
|
+
|
142
152
|
config.before(:each, :time) do |example|
|
143
153
|
set_time(example.metadata[:time])
|
144
154
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: test_suite_time_machine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Elliot Crosby-McCullough
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-04-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: timecop
|
@@ -65,7 +65,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
65
65
|
- !ruby/object:Gem::Version
|
66
66
|
version: '0'
|
67
67
|
requirements: []
|
68
|
-
rubygems_version: 3.
|
68
|
+
rubygems_version: 3.5.9
|
69
69
|
signing_key:
|
70
70
|
specification_version: 4
|
71
71
|
summary: A small utility to help manage the current date and time in your test suite.
|