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 +4 -4
- data/README.md +3 -3
- data/lib/report_factory/rspec/formatter.rb +6 -1
- data/lib/report_factory/rspec/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8c943137ff358723dcc006d8250bb5089fe4006e
|
4
|
+
data.tar.gz: 20859a0d62631560dab34cceed539827b96861e8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
36
|
+
require 'report_factory/rspec'
|
37
37
|
```
|
38
38
|
|
39
39
|
and configure:
|
40
40
|
|
41
41
|
```ruby
|
42
|
-
ReportFactory::
|
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::
|
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,
|
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.
|
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-
|
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.
|
105
|
+
summary: report_factory-rspec_0.2.1
|
106
106
|
test_files: []
|