norad_spec_runner 0.4.6 → 0.5.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1c0e7328d612f030ac84055b3cf57c38227cd3be
4
- data.tar.gz: 4af321c7bf75c0e9de24c73172be16356152b29f
3
+ metadata.gz: 20511339572d61c23efaa3af9eff2fbc7bacc711
4
+ data.tar.gz: 471bcbfbd63fbf0bcca5bcabbce3cf056599c078
5
5
  SHA512:
6
- metadata.gz: 96c76b112a44ca6bd7bd571b73f1faf199e28575c638ccceb987a71d5415bdf1e28bb58743b665ed11f8c5b9f372be9408936065efd49d4bd741b52de981d036
7
- data.tar.gz: 73232747a27ae344e0ee45f84022a87cdb4ed75e0d4e0181c25880b4355f02be035e667b4889cd8273cafadf5a2784c826ce251bbc25b4a2f542fe59895fed8f
6
+ metadata.gz: b1a787243c09c70ee963d3cd31b6bda8a132f1461c4dbe600c84d7b53b52b3f7af27c43d0774ebe558d4ef258cb063680170296fb41906c05ea0f6fc841f96a2
7
+ data.tar.gz: 6857d1077996e9018f29dd0decfbf883693d112e1bd4fd4e2af2e033b43a7bb7be6e8a2d3d0114037cdcdd24cd6acd3d8d60c1b24b3329f3572e95c4d05a82f8
@@ -0,0 +1,9 @@
1
+ RSpec::Support.require_rspec_core 'example'
2
+
3
+ module RSpec
4
+ module Core
5
+ class Example
6
+ attr_accessor :norad_nid, :norad_description, :norad_output
7
+ end
8
+ end
9
+ end
@@ -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 json', "-o #{@results_file}"]
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
@@ -1,3 +1,3 @@
1
1
  module NoradSpecRunner
2
- VERSION = "0.4.6"
2
+ VERSION = "0.5.0"
3
3
  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.6
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-10-18 00:00:00.000000000 Z
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