rspec_timer 0.0.5 → 0.0.6
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.
- checksums.yaml +4 -4
- data/README.md +5 -2
- data/lib/rspec_timer.rb +1 -2
- data/lib/rspec_timer/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 556909ba920bed3959d51bb5864c7862a843a97b
|
4
|
+
data.tar.gz: 27886b9e5a8acee2764e6dda6b8fdf00d8ae7e45
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 12fdfec4e7e921b057a9287706de4860dd6ed99e932a479e9c96883dbe88150dfb99dad7a8e513b6a0971cecb8861b28bc16b5801bb415e50852acb279be3af4
|
7
|
+
data.tar.gz: 3bf010421a1e75c4100f342657c84fd593d20d35617859112b8fd0122b9fe13a6f5c43ae0cde8d3284b64c018ca66ff6d53aee208c355d16c9535e1d49a33de7
|
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# RspecTimer
|
2
2
|
|
3
|
+
[](http://badge.fury.io/rb/rspec_timer)
|
4
|
+
|
3
5
|
RSpecTimer will track the amount of time each of your tests take to complete,
|
4
6
|
and when it's done, can save the data to a YAML file.
|
5
7
|
|
@@ -28,7 +30,8 @@ In your spec_helper.rb file, set up your "around" and "after" hooks like so:
|
|
28
30
|
RSpec.configure do |config|
|
29
31
|
|
30
32
|
config.before(:suite) do
|
31
|
-
# Set the log file's path (optional - if not set, defaults
|
33
|
+
# Set the log file's path (optional - if not set, defaults
|
34
|
+
# to a 'rspec-metrics.yml' file in your current folder)
|
32
35
|
RspecTimer.log_file_path = 'rspec_metrics.yml'
|
33
36
|
|
34
37
|
# Completely wipes any metrics from the log (optional)
|
@@ -41,7 +44,7 @@ RSpec.configure do |config|
|
|
41
44
|
|
42
45
|
config.after(:suite) do
|
43
46
|
# Output metrics after running the test suite
|
44
|
-
puts 'Metrics:
|
47
|
+
puts 'Metrics:'
|
45
48
|
puts RspecTimer.metrics.to_yaml.to_s
|
46
49
|
|
47
50
|
# Stores any metrics from this test run into the YAML log file
|
data/lib/rspec_timer.rb
CHANGED
@@ -47,9 +47,8 @@ class RspecTimer
|
|
47
47
|
end
|
48
48
|
|
49
49
|
def save_metrics
|
50
|
-
updated_metrics = {}
|
51
50
|
# Load any existing metrics
|
52
|
-
updated_metrics = YAML.load_file(log_file_path) if File.exists? (log_file_path)
|
51
|
+
updated_metrics = (YAML.load_file(log_file_path) if File.exists? (log_file_path)) || {}
|
53
52
|
# Merge in the new metrics, updating any existing ones
|
54
53
|
@metrics.keys.each { |key| updated_metrics[key] = @metrics[key] }
|
55
54
|
# Save metrics to the YAML log file
|
data/lib/rspec_timer/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec_timer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tom Chapin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-06-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: method_source
|