flatware-rspec 2.0.0.rc1 → 2.0.0.rc2

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
  SHA256:
3
- metadata.gz: e6a0aaa1271e9e220195b1198be4374e2a3e0a40fbe0dbdb61fad0c4735ab4e0
4
- data.tar.gz: 2e16cb3d10ac6a990a393b84e0a3ae04ea4ccccfdbb9de3d1b264d4729a2d32f
3
+ metadata.gz: b0c080b0bb6d068e3d65c19230aacd62d811e0e151358ffebec9f83b0e1ab0ba
4
+ data.tar.gz: '079c5ecaea4b3aa461bd7ffa6c6ee7e6ed1e592d990e4d76af5f0dcf3fa4863f'
5
5
  SHA512:
6
- metadata.gz: 2b133ea289d7abe6828bf0c7188bb389c113126ea8e79866aed5b973d4213b473f79e219c4f3d151f6c1bbf175fd48790140c531c6ce4eeb488837c4bd1ed618
7
- data.tar.gz: 26d0a1a2a322ee2ad2cb4ac9b5d33c42aefdbe15a80d1c108d8e7d8b11a4f50e8bfb36e8003496c3215c939c74c3797f1eca7dad0c11843d96d1e9e1f3f85c3c
6
+ metadata.gz: '0692ddafa90238adf85ffb8648b9b64d5971a0a4047e932063226e88391344953f847fc90093c65a37d8e233426f3f53e6f1f53fc0bb056dc2705de1704283bd'
7
+ data.tar.gz: 4ccd74df9c6954319baa3c79da326d55dcb816ef0661439cf7be3a5c4bffa1fe29c9c51c3ffbe613aabd336e0c1a22fe4bcc1ca3463f8c8111c7a4d74e4eabaf
@@ -25,7 +25,7 @@ module Flatware
25
25
 
26
26
  EVENTS.each do |event|
27
27
  define_method(event) do |notification|
28
- events[event] = Marshalable.for_event(event).from_notification(notification)
28
+ events[event] = Marshalable.for_event(event).from_rspec(notification)
29
29
  end
30
30
  end
31
31
 
@@ -1,6 +1,8 @@
1
1
  module Flatware
2
2
  module RSpec
3
3
  module Marshalable
4
+ require 'flatware/rspec/marshalable/shared_group_inclusion_backtrace'
5
+
4
6
  ##
5
7
  # a subset of the rspec example interface that can traverse drb
6
8
  Example = Struct.new(
@@ -16,10 +18,21 @@ module Flatware
16
18
  rspec_example.public_send(attribute)
17
19
  end)
18
20
 
19
- @metadata = rspec_example.metadata.slice(:extra_failure_lines, :shared_group_inclusion_backtrace)
21
+ @metadata = marshalable_metadata(rspec_example.metadata)
20
22
  end
21
23
 
22
24
  attr_reader :metadata
25
+
26
+ private
27
+
28
+ def marshalable_metadata(rspec_metadata)
29
+ rspec_metadata.slice(:extra_failure_lines).tap do |metadata|
30
+ if (backtraces = rspec_metadata[:shared_group_inclusion_backtrace])
31
+ metadata[:shared_group_inclusion_backtrace] =
32
+ backtraces.map(&SharedGroupInclusionBacktrace.method(:from_rspec))
33
+ end
34
+ end
35
+ end
23
36
  end
24
37
  end
25
38
  end
@@ -17,7 +17,7 @@ module Flatware
17
17
 
18
18
  attr_reader :reporter
19
19
 
20
- def self.from_notification(rspec_notification)
20
+ def self.from_rspec(rspec_notification)
21
21
  new Reporter.from_rspec(rspec_notification.instance_variable_get(:@reporter))
22
22
  end
23
23
 
@@ -16,7 +16,7 @@ module Flatware
16
16
  )
17
17
  end
18
18
 
19
- def self.from_notification(rspec_notification)
19
+ def self.from_rspec(rspec_notification)
20
20
  new(
21
21
  rspec_notification.duration,
22
22
  rspec_notification.examples.map(&Example.method(:new)),
@@ -0,0 +1,11 @@
1
+ module Flatware
2
+ module RSpec
3
+ module Marshalable
4
+ class SharedGroupInclusionBacktrace < ::RSpec::Core::SharedExampleGroupInclusionStackFrame
5
+ def self.from_rspec(backtrace)
6
+ new(backtrace.shared_group_name.to_s, backtrace.inclusion_location)
7
+ end
8
+ end
9
+ end
10
+ end
11
+ end
@@ -13,7 +13,7 @@ module Flatware
13
13
  [failure_count, errors_outside_of_examples_count].any?(&:positive?)
14
14
  end
15
15
 
16
- def self.from_notification(summary)
16
+ def self.from_rspec(summary)
17
17
  serialized_examples = [
18
18
  summary.examples,
19
19
  summary.failed_examples,
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flatware-rspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.rc1
4
+ version: 2.0.0.rc2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Dunn
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 2.0.0.rc1
19
+ version: 2.0.0.rc2
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 2.0.0.rc1
26
+ version: 2.0.0.rc2
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rspec
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -60,6 +60,7 @@ files:
60
60
  - lib/flatware/rspec/marshalable/example_group.rb
61
61
  - lib/flatware/rspec/marshalable/examples_notification.rb
62
62
  - lib/flatware/rspec/marshalable/profile_notification.rb
63
+ - lib/flatware/rspec/marshalable/shared_group_inclusion_backtrace.rb
63
64
  - lib/flatware/rspec/marshalable/summary_notification.rb
64
65
  homepage: http://github.com/briandunn/flatware
65
66
  licenses: