rspec-ndjson-formatter 1.0.0 → 1.1.0
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/CHANGELOG.md +17 -0
- data/Gemfile.lock +1 -1
- data/lib/ndjson_formatter.rb +28 -1
- data/lib/ndjson_formatter/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7269ff4c33900964a86b89c80ebe31172af591ac
|
4
|
+
data.tar.gz: 417678e47ae2876b8b7b60fbad68cec0277de1be
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e5566b91fe020f4017cfb6e77deb1325faf6cfa2c342b7207d2f6bcd19617215e8457059e8a04baa6c165c849e85291ccad27f1a2fb73e773921c1476c86d4f1
|
7
|
+
data.tar.gz: 044bf91c84e9fe3bc859142c7cd7fbffa054a7e94525c99306f0a7cdad7d5a10a1a414436e81f42fff6065b2eab82af00bb1600e0f3242be9a437bb1e4c261f2
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
# Changelog
|
2
|
+
All notable changes to this project will be documented in this file.
|
3
|
+
|
4
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
5
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
6
|
+
|
7
|
+
## [1.1.0] - 2019-01-20
|
8
|
+
|
9
|
+
### Added
|
10
|
+
|
11
|
+
- output test result status and failure/pending messages
|
12
|
+
|
13
|
+
## [1.0.0] - 2019-01-19
|
14
|
+
|
15
|
+
### Added
|
16
|
+
|
17
|
+
- output information about tests without result status, suitable for use with `rspec --dry-run`
|
data/Gemfile.lock
CHANGED
data/lib/ndjson_formatter.rb
CHANGED
@@ -2,7 +2,13 @@ require "ndjson_formatter/version"
|
|
2
2
|
require "json"
|
3
3
|
|
4
4
|
class NdjsonFormatter
|
5
|
-
RSpec::Core::Formatters.register self,
|
5
|
+
RSpec::Core::Formatters.register self,
|
6
|
+
:stop,
|
7
|
+
:example_started,
|
8
|
+
:example_passed,
|
9
|
+
:example_failed,
|
10
|
+
:example_pending,
|
11
|
+
:example_group_started
|
6
12
|
|
7
13
|
def initialize(io)
|
8
14
|
@io = io
|
@@ -34,6 +40,23 @@ class NdjsonFormatter
|
|
34
40
|
})
|
35
41
|
end
|
36
42
|
|
43
|
+
def example_passed(example_notification)
|
44
|
+
update_testable(example_notification.example, status: "passed")
|
45
|
+
end
|
46
|
+
|
47
|
+
def example_failed(failed_example_notification)
|
48
|
+
update_testable(failed_example_notification.example,
|
49
|
+
status: "failed",
|
50
|
+
message: failed_example_notification.message_lines,
|
51
|
+
backtrace: failed_example_notification.formatted_backtrace)
|
52
|
+
end
|
53
|
+
|
54
|
+
def example_pending(example_notification)
|
55
|
+
update_testable(example_notification.example,
|
56
|
+
status: "pending",
|
57
|
+
message: Array(example_notification.example.execution_result.pending_message))
|
58
|
+
end
|
59
|
+
|
37
60
|
def stop(_arg)
|
38
61
|
dump
|
39
62
|
end
|
@@ -64,6 +87,10 @@ class NdjsonFormatter
|
|
64
87
|
@testables[parentless_testable[:id]] = parentless_testable
|
65
88
|
end
|
66
89
|
|
90
|
+
def update_testable(testable, attributes)
|
91
|
+
@testables[testable.id].merge!(attributes)
|
92
|
+
end
|
93
|
+
|
67
94
|
def format_id(metadata)
|
68
95
|
return unless metadata
|
69
96
|
"#{metadata.fetch(:file_path)}[#{metadata.fetch(:scoped_id)}]"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-ndjson-formatter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Scott Payne
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-01-
|
11
|
+
date: 2019-01-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -63,6 +63,7 @@ files:
|
|
63
63
|
- ".gitignore"
|
64
64
|
- ".rspec"
|
65
65
|
- ".travis.yml"
|
66
|
+
- CHANGELOG.md
|
66
67
|
- Gemfile
|
67
68
|
- Gemfile.lock
|
68
69
|
- LICENSE.txt
|