report_factory-rspec 0.2.0 → 0.2.1

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
  SHA1:
3
- metadata.gz: f27f2b44c67c675e1c63e0e629123214504c709f
4
- data.tar.gz: '0494a00db5b0cf6a21a4e8dbdcec315c7d80c566'
3
+ metadata.gz: 8c943137ff358723dcc006d8250bb5089fe4006e
4
+ data.tar.gz: 20859a0d62631560dab34cceed539827b96861e8
5
5
  SHA512:
6
- metadata.gz: 663392713af137dddba93c8ceacf4fbc2b98e8aff88552f3d8b5d8303e799bfcd402c85c973e84f111799246896e53b0e5bb10a46d6c69daa2dc67803f36d62d
7
- data.tar.gz: 5a448e8b1b6970e0ac76351564c9b7194f35df18d61ee29d3209c49dc368be396edfeb69be93d72f993d9ac64087688c20ff66abbaa9671e043aba313dbaf913
6
+ metadata.gz: d6da11a7fbfb3b61edeb8ac55a64146b01047f08cee0d9c9a3719dab2e31cb13d7d7d0f351955a618738479b307f698e88f26c06cb0d26d9a795cb65960fe8a6
7
+ data.tar.gz: 3e2a0b2d5b641930daa5a6320000d6a027240752fb362a1f296077e381151dd1707b54bccf1ad173f44500cc0695bbd2ba93bfa01d27361646c5394fb7f95ea0
data/README.md CHANGED
@@ -33,13 +33,13 @@ Before you start using this formatter, make sure you have the [ReportFactory](ht
33
33
  To setup this formatter to work with your RSpec tests, add this to your `spec_helper.rb` file:
34
34
 
35
35
  ```ruby
36
- require 'report_factory-rspec'
36
+ require 'report_factory/rspec'
37
37
  ```
38
38
 
39
39
  and configure:
40
40
 
41
41
  ```ruby
42
- ReportFactory::RSpec.configure do |config|
42
+ ReportFactory::Rspec.configure do |config|
43
43
  config.url = "The url of the ReportFactory server. It's 'http://0.0.0.0:3000' if you're running locally"
44
44
  config.project_name = "The name of the project that you are testing. Needs to be previously created in ReportFactory"
45
45
  config.tags = ['Tags', 'to', 'help', 'you', 'group', 'your', 'reports']
@@ -47,7 +47,7 @@ ReportFactory::RSpec.configure do |config|
47
47
  end
48
48
  ```
49
49
 
50
- Then you can just simply run rspec with `--format ReportFactory::RSpec::Formatter` and your reports will be available on the server after each test run.
50
+ Then you can just simply run rspec with `--format ReportFactory::Rspec::Formatter` and your reports will be available on the server after each test run.
51
51
  You can add that line to your `.rspec` file if you want it to be the default behavior.
52
52
 
53
53
  ## Development
@@ -11,6 +11,7 @@ module ReportFactory
11
11
  class Formatter < RSpec::Core::Formatters::BaseFormatter
12
12
  RSpec::Core::Formatters.register self, :message, :dump_summary,
13
13
  :dump_profile, :stop, :seed, :close
14
+ SUMMARY = %i[duration example_count failure_count pending_count].freeze
14
15
 
15
16
  attr_reader :output_hash
16
17
 
@@ -51,7 +52,7 @@ module ReportFactory
51
52
  end
52
53
 
53
54
  def close(_notification)
54
- return if @output_hash[:examples].empty?
55
+ return if @output_hash[:examples].empty? || !summary_is_valid?
55
56
  print_result(ReportFactory::Rspec::API.send_report(@output_hash))
56
57
  end
57
58
 
@@ -91,6 +92,10 @@ module ReportFactory
91
92
  " to ReportFactory. #{response.code}: #{response.msg}\n"
92
93
  end
93
94
 
95
+ def summary_is_valid?
96
+ SUMMARY.all? { |param| @output_hash.dig(:summary, param) }
97
+ end
98
+
94
99
  def format_example(example)
95
100
  {
96
101
  id: example.id,
@@ -2,6 +2,6 @@
2
2
 
3
3
  module ReportFactory
4
4
  module Rspec
5
- VERSION = '0.2.0'
5
+ VERSION = '0.2.1'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: report_factory-rspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Igor Starostenko
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-03-05 00:00:00.000000000 Z
11
+ date: 2018-03-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -102,5 +102,5 @@ rubyforge_project:
102
102
  rubygems_version: 2.6.12
103
103
  signing_key:
104
104
  specification_version: 4
105
- summary: report_factory-rspec_0.2.0
105
+ summary: report_factory-rspec_0.2.1
106
106
  test_files: []