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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e7327c01503b11ebf46af35ebc39484b6b2d39be94326279e7de5aab88716336
4
- data.tar.gz: 8f8c2e0aaaebd345003f17db241fdb51f42efb7d08bc6ffcaebbe295e50fa167
3
+ metadata.gz: f7d8bffa154b7ea1816f762a58085d24a30fddca8634d8ea9c836545ab0f40e4
4
+ data.tar.gz: b7bea13ebf504f57756f014fd2f09d8a9a32fda3abf5e9155fe8d154386362da
5
5
  SHA512:
6
- metadata.gz: f50eabb434c67a34cacaab07453f08357f0c7509e3f2dc34b7b97e38bae2033d98d3f31119625b3ea14ea2e5546b7c84b40e61d5ec10ddff5cbb4ae41c2026d5
7
- data.tar.gz: 2295cb61a6fc4ab7a8dd77c76680e5a59988123e22f3bbbe76d8f813364ee43c02b67546b6685e1f2c4fdeb44948804e667777c81de7339ef681db2dc4d34f6c
6
+ metadata.gz: bce971229b016bd62013e8e50ad393b86ba3cdd1d2f47822e1aae18d3bf16cdc3e804b9b2519e695641ed492e77a6af6f3ec51a2ca697cf9038e8e63c4c4ed75
7
+ data.tar.gz: a4f21ee8883e3ac3f69a505fb5b2dc2357bd5fb157d56f5137beae340f86c45badebca854577aef2661b744d62e8c4302e87b8f71cab5c522dce3500eaeb7ee9
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
- ## [Unreleased]
1
+ ## [2.0.0] - 2024-04-29
2
2
 
3
- - Initial release
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 UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_RELEASE_TO_RUBYGEMS_ORG
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 UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_RELEASE_TO_RUBYGEMS_ORG
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
- `travel_temporarily_to` for a given test.
79
+ `travel_permanently_to` for a given test.
80
80
 
81
81
  ```ruby
82
82
  RSpec.describe "Santa's schedule" do
@@ -1,3 +1,3 @@
1
1
  module TestSuiteTimeMachine
2
- VERSION = "1.0.0".freeze
2
+ VERSION = "2.0.0".freeze
3
3
  end
@@ -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: 1.0.0
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: 2023-07-20 00:00:00.000000000 Z
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.4.17
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.