norad_spec_runner 0.4.6 → 0.5.0
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 20511339572d61c23efaa3af9eff2fbc7bacc711
|
4
|
+
data.tar.gz: 471bcbfbd63fbf0bcca5bcabbce3cf056599c078
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b1a787243c09c70ee963d3cd31b6bda8a132f1461c4dbe600c84d7b53b52b3f7af27c43d0774ebe558d4ef258cb063680170296fb41906c05ea0f6fc841f96a2
|
7
|
+
data.tar.gz: 6857d1077996e9018f29dd0decfbf883693d112e1bd4fd4e2af2e033b43a7bb7be6e8a2d3d0114037cdcdd24cd6acd3d8d60c1b24b3329f3572e95c4d05a82f8
|
@@ -0,0 +1,27 @@
|
|
1
|
+
RSpec::Support.require_rspec_core "formatters/json_formatter"
|
2
|
+
|
3
|
+
module NoradSpecRunner
|
4
|
+
|
5
|
+
class CustomJsonFormatter < RSpec::Core::Formatters::JsonFormatter
|
6
|
+
RSpec::Core::Formatters.register self, :message, :dump_summary, :dump_profile, :stop, :close
|
7
|
+
|
8
|
+
def stop(notification)
|
9
|
+
@output_hash[:examples] = notification.examples.map do |example|
|
10
|
+
format_example(example).tap do |hash|
|
11
|
+
# Add custom fields to output json hash.
|
12
|
+
hash[:norad_nid] = example.norad_nid
|
13
|
+
hash[:norad_description] = example.norad_description
|
14
|
+
hash[:norad_output] = example.norad_output
|
15
|
+
if (ex=example.exception)
|
16
|
+
hash[:exception] = {
|
17
|
+
:class => ex.class.name,
|
18
|
+
:message => ex.message,
|
19
|
+
:backtrace => ex.backtrace,
|
20
|
+
}
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
@@ -142,7 +142,7 @@ module NoradSpecRunner
|
|
142
142
|
|
143
143
|
def build_rspec_opts(options)
|
144
144
|
sub_tests = options.fetch(:sub_tests)
|
145
|
-
rspec_opts = [ '--format
|
145
|
+
rspec_opts = [ '--format NoradSpecRunner::CustomJsonFormatter', "-r #{__dir__}/formatter.rb", "-o #{@results_file}"]
|
146
146
|
options.fetch(:tags).split(',').each do |tag|
|
147
147
|
rspec_opts << "--tag=#{tag}"
|
148
148
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: norad_spec_runner
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Manifold
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2017-
|
13
|
+
date: 2017-11-13 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: serverspec
|
@@ -160,6 +160,8 @@ files:
|
|
160
160
|
- bin/norad_spec_runner
|
161
161
|
- lib/norad_spec_runner.rb
|
162
162
|
- lib/norad_spec_runner/cli.rb
|
163
|
+
- lib/norad_spec_runner/example.rb
|
164
|
+
- lib/norad_spec_runner/formatter.rb
|
163
165
|
- lib/norad_spec_runner/linux_sec_test.rb
|
164
166
|
- lib/norad_spec_runner/remote_task.rb
|
165
167
|
- lib/norad_spec_runner/sec_test.rb
|