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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: edf3fd6e37833e11bb2130bb3425b288dd7f9d74
4
- data.tar.gz: e3a160005e7fb269ebb96bf5543cd1d665194394
3
+ metadata.gz: 556909ba920bed3959d51bb5864c7862a843a97b
4
+ data.tar.gz: 27886b9e5a8acee2764e6dda6b8fdf00d8ae7e45
5
5
  SHA512:
6
- metadata.gz: 621b31e70132c91cef2858ce37669d366d22795d9d19b6634badf45e3952f9815347fa29f1436ab4092098f738a2dd7b611316220c1e08a58b10649cd9495291
7
- data.tar.gz: a98d2d496ce45cd6b69f197c9f8f6184ffc59ec2dcb390fb700fdb69759aa215dd515282dd2e617486b67233b5bff43939ab22f0d9c313630928620207961a1b
6
+ metadata.gz: 12fdfec4e7e921b057a9287706de4860dd6ed99e932a479e9c96883dbe88150dfb99dad7a8e513b6a0971cecb8861b28bc16b5801bb415e50852acb279be3af4
7
+ data.tar.gz: 3bf010421a1e75c4100f342657c84fd593d20d35617859112b8fd0122b9fe13a6f5c43ae0cde8d3284b64c018ca66ff6d53aee208c355d16c9535e1d49a33de7
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # RspecTimer
2
2
 
3
+ [![Gem Version](https://badge.fury.io/rb/rspec_timer.svg)](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 to a 'rspec-metrics.yml' file in your current folder)
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
@@ -1,3 +1,3 @@
1
1
  class RspecTimer
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
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.5
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-05-30 00:00:00.000000000 Z
11
+ date: 2015-06-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: method_source