flatware-cucumber 1.2.0 → 2.0.0.rc1

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: 265407eeff8748e873d84126d35f1341bfd0c82e153370adc64206be66400f77
4
- data.tar.gz: d7838a350284cfeb715530d4ca07f60c134d0afcb4aa4b75f7138341dc7d308e
3
+ metadata.gz: ca4704cbed2b88a90d866db8ba7b74b3ba32214e27ab1c543a802f6fd90f11a6
4
+ data.tar.gz: 38d82c0121d3c9a3c67e3b129ae75f1fdbefa31c1dd6486b48c17b3793651094
5
5
  SHA512:
6
- metadata.gz: 94f4cd09f4186b373d95215544decc76825afc51cbc7395be759ac19128f93c819f18d7e0726d15b8592a36e83d9a50223da1cd59d7323d38f336ee84b4ff317
7
- data.tar.gz: ebed813f6ae2f7c9726cd764b53ac42bc11e39b4c18c3f36a82809e88d51bb25e373378286b2b573adf40d4b75643a7c98481d13c67ac088f290d04424f0c272
6
+ metadata.gz: 5a8b8f51c2c83933398e7b8f3d19ec55db65d58dfc944966a094e97fc176893af18f79b486cf101159a07d4588ff86bc75d800d032c4809e1f120c9c03ce2cba
7
+ data.tar.gz: 3262a5428592bd11866750ce8a019a5433471296b7b7e2f00f4316cbbfdc51536ad08c1a6c11525f1343e5ce15053648a9320b7c6cfbe058c6653b81895752b2
data/README.md CHANGED
@@ -7,39 +7,6 @@
7
7
 
8
8
  Flatware parallelizes your test suite to significantly reduce test time.
9
9
 
10
- ## Requirements
11
-
12
- * ZeroMQ > 4.0
13
-
14
- ## Installation
15
-
16
- ### ZeroMQ
17
-
18
- #### Linux Ubuntu
19
-
20
- ```sh
21
- sudo apt-get install -qq libzmq3-dev
22
- ```
23
-
24
- (Never you mind the 3. This package contains ZMQ version 4.)
25
-
26
- #### Mac OSX
27
-
28
-
29
- If you're on macOS 10.12, use the custom hashrocket ZMQ homebrew formula.
30
-
31
- ```sh
32
- brew tap hashrocket/formulas
33
- brew install hashrocket/formulas/zeromq
34
- ```
35
-
36
- The stock homebrew version will likely work on older versions of macOS.
37
-
38
-
39
- ```sh
40
- brew install zeromq
41
- ```
42
-
43
10
  ### Flatware
44
11
 
45
12
  Add the runners you need to your Gemfile:
@@ -81,8 +48,9 @@ For this to work the configuration option must be loaded before any specs are ru
81
48
 
82
49
  --require spec_helper
83
50
 
84
- But beware, if you're using ActiveRecord in your suite you'll need to avoid doing things that cause it to establish a database connection in `spec_helper.rb`. If ActiveRecord connects before flatware forks off workers, each will die messily. All of this will just work if you're following [the recomended pattern of splitting your helpers into `spec_helper` and `rails_helper`](https://github.com/rspec/rspec-rails/blob/v3.8.2/lib/generators/rspec/install/templates/spec/rails_helper.rb).
85
-
51
+ But beware, if you're using ActiveRecord in your suite you'll need to avoid doing things that cause it to establish a database connection in `spec_helper.rb`. If ActiveRecord connects before flatware forks off workers, each will die messily. All of this will just work if you're following [the recomended pattern of splitting your helpers into `spec_helper` and `rails_helper`](https://github.com/rspec/rspec-rails/blob/v3.8.2/lib/generators/rspec/install/templates/spec/rails_helper.rb). Another option is to use [the configurable hooks](
52
+ #faster-startup-with-activerecord
53
+ ).
86
54
 
87
55
  ### Options
88
56
 
@@ -134,9 +102,31 @@ Now you are ready to rock:
134
102
  $ flatware rspec && flatware cucumber
135
103
  ```
136
104
 
137
- ## Planned Features
105
+ ### Faster Startup With ActiveRecord
106
+
107
+ Flatware has a couple lifecycle callbacks that you can use to avoid booting your app
108
+ over again on every core. One way to take advantage of this via a `spec/flatware_helper.rb` file like so:
138
109
 
139
- * Use heuristics to run your slowest tests first
110
+ ```ruby
111
+ Flatware.configure do |conf|
112
+ conf.before_fork do
113
+ require 'rails_helper'
114
+
115
+ ActiveRecord::Base.connection.disconnect!
116
+ end
117
+
118
+ conf.after_fork do |test_env_number|
119
+ config = ActiveRecord::Base.connection_config
120
+
121
+ ActiveRecord::Base.establish_connection(
122
+ config.merge(
123
+ database: config.fetch(:database) + test_env_number.to_s
124
+ )
125
+ )
126
+ end
127
+ end
128
+ ```
129
+ Now when I run `bundle exec flatware rspec -r ./spec/flatware_helper` My app only boots once, rather than once per core.
140
130
 
141
131
  ## Design Goals
142
132
 
@@ -167,20 +157,10 @@ directory. CD there and `flatware` will be in your path so you can tinker away.
167
157
 
168
158
  ## How it works
169
159
 
170
- Flatware relies on a message passing system to enable concurrency.
171
- The main process declares a worker for each cpu in the computer. Each
172
- worker forks from the main process and is then assigned a portion of the
173
- test suite. As the worker runs the test suite it sends progress
174
- messages to the main process. These messages are collected and when
175
- the last worker is finished the main process provides a report on the
176
- collected progress messages.
160
+ Flatware relies on a message passing system to enable concurrency. The main process forks a worker for each cpu in the computer. These workers are each given a chunk of the tests to run. The workers report back to the main process about their progress. The main process prints those progress messages. When the last worker is finished the main process prints the results.
177
161
 
178
162
  ## Resources
179
163
 
180
- To learn more about the messaging system that Flatware uses, take a look at the
181
- [excellent ZeroMQ guide][z].
182
-
183
- [z]: http://zguide.zeromq.org/page:all
184
164
  [a]: https://github.com/cucumber/aruba
185
165
 
186
166
  ## Contributing to Flatware
@@ -1,7 +1,6 @@
1
1
  require 'cucumber'
2
2
  require 'flatware/cucumber/formatter'
3
3
  require 'flatware/cucumber/result'
4
- require 'flatware/cucumber/scenario_result'
5
4
  require 'flatware/cucumber/step_result'
6
5
  require 'flatware/cucumber/formatters/console'
7
6
  require 'flatware/cucumber/cli'
@@ -10,8 +9,10 @@ module Flatware
10
9
  module Cucumber
11
10
  class Config
12
11
  attr_reader :config, :args
12
+
13
13
  def initialize(cucumber_config, args)
14
- @config, @args = cucumber_config, args
14
+ @config = cucumber_config
15
+ @args = args
15
16
  end
16
17
 
17
18
  def feature_dir
@@ -29,9 +30,9 @@ module Flatware
29
30
  end
30
31
  end
31
32
 
32
- extend self
33
+ module_function
33
34
 
34
- def configure(args, out_stream=$stdout, error_stream=$stderr)
35
+ def configure(args, out_stream = $stdout, error_stream = $stderr)
35
36
  raw_args = args.dup
36
37
  cli_config = ::Cucumber::Cli::Configuration.new(out_stream, error_stream)
37
38
  cli_config.parse! args + %w[--format Flatware::Cucumber::Formatter]
@@ -1,22 +1,46 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'flatware/cli'
2
4
 
3
5
  module Flatware
6
+ # cucumber thor command
4
7
  class CLI
5
8
  worker_option
6
- method_option 'dispatch-endpoint', type: :string, default: 'ipc://dispatch'
7
- method_option 'sink-endpoint', type: :string, default: 'ipc://task'
8
- desc "cucumber [FLATWARE_OPTS] [CUCUMBER_ARGS]", "parallelizes cucumber with custom arguments"
9
+ method_option(
10
+ 'sink-endpoint',
11
+ type: :string,
12
+ default: 'drbunix:sink'
13
+ )
14
+ desc(
15
+ 'cucumber [FLATWARE_OPTS] [CUCUMBER_ARGS]',
16
+ 'parallelizes cucumber with custom arguments'
17
+ )
9
18
  def cucumber(*args)
10
19
  config = Cucumber.configure args
11
20
 
12
- unless config.jobs.any?
13
- puts "Please create some feature files in the #{config.feature_dir} directory."
14
- exit 1
15
- end
21
+ ensure_jobs(config)
16
22
 
17
23
  Flatware.verbose = options[:log]
18
- Worker.spawn count: workers, runner: Cucumber, dispatch: options['dispatch-endpoint'], sink: options['sink-endpoint']
19
- start_sink jobs: config.jobs, workers: workers, formatter: Flatware::Cucumber::Formatters::Console.new($stdout, $stderr)
24
+ sink = options['sink-endpoint']
25
+ Worker.spawn(count: workers, runner: Cucumber, sink: sink)
26
+ start_sink(
27
+ jobs: config.jobs,
28
+ workers: workers,
29
+ formatter: Flatware::Cucumber::Formatters::Console.new($stdout, $stderr)
30
+ )
31
+ end
32
+
33
+ private
34
+
35
+ def ensure_jobs(config)
36
+ return if config.jobs.any?
37
+
38
+ abort(
39
+ format(
40
+ 'Please create some feature files in the %<dir>s directory.',
41
+ dir: config.feature_dir
42
+ )
43
+ )
20
44
  end
21
45
  end
22
46
  end
@@ -6,7 +6,7 @@ module Flatware
6
6
  class Formatter
7
7
  Checkpoint = Struct.new :steps, :scenarios do
8
8
  def failures?
9
- scenarios.any? &:failed?
9
+ scenarios.any?(&:failed?)
10
10
  end
11
11
  end
12
12
 
@@ -21,6 +21,7 @@ module Flatware
21
21
  end
22
22
 
23
23
  def initialize(config)
24
+ # FIXME: can we sneak the sink in through the config?
24
25
  config.on_event :test_case_finished, &method(:on_test_case_finished)
25
26
  config.on_event :test_step_finished, &method(:on_test_step_finished)
26
27
  config.on_event :test_run_finished, &method(:on_test_run_finished)
@@ -39,7 +40,11 @@ module Flatware
39
40
  attr_reader :steps, :scenarios, :matched_steps
40
41
 
41
42
  def on_test_case_finished(event)
42
- scenarios << Scenario.new(event.test_case.name, event.test_case.location.to_s, event.result.to_sym)
43
+ scenarios << Scenario.new(
44
+ event.test_case.name,
45
+ event.test_case.location.to_s,
46
+ event.result.to_sym
47
+ )
43
48
  end
44
49
 
45
50
  def on_step_activated(event)
@@ -47,14 +52,18 @@ module Flatware
47
52
  end
48
53
 
49
54
  def on_test_step_finished(event)
50
- if really_a_step?(event.test_step) or event.result.undefined?
51
- steps << StepResult.new(event.result.to_sym, event.result.failed? && event.result.exception)
52
- Sink::client.progress Result.new event.result.to_sym
53
- end
55
+ result = event.result
56
+ return unless really_a_step?(event.test_step) || result.undefined?
57
+
58
+ steps << StepResult.new(
59
+ result.to_sym,
60
+ result.failed? && result.exception
61
+ )
62
+ Sink.client.progress Result.new result.to_sym
54
63
  end
55
64
 
56
65
  def on_test_run_finished(*)
57
- Sink::client.checkpoint Checkpoint.new steps, scenarios
66
+ Sink.client.checkpoint Checkpoint.new steps, scenarios
58
67
  reset
59
68
  end
60
69
 
@@ -1,48 +1,56 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'flatware/cucumber/formatters/console/summary'
2
4
  require 'cucumber/formatter/console'
3
5
 
4
- module Flatware::Cucumber::Formatters
5
- class Console
6
- #for format_string
7
- include ::Cucumber::Formatter::Console
8
-
9
- FORMATS = {
10
- passed: '.',
11
- failed: 'F',
12
- undefined: 'U',
13
- pending: 'P',
14
- skipped: '-'
15
- }
16
-
17
- STATUSES = FORMATS.keys
18
-
19
- attr_reader :out, :err
20
-
21
- def initialize(stdout, stderr)
22
- @out, @err = stdout, stderr
23
- end
24
-
25
- def progress(result)
26
- out.print format result.progress
27
- end
28
-
29
- def summarize(checkpoints)
30
- steps = checkpoints.flat_map(&:steps)
31
- scenarios = checkpoints.flat_map(&:scenarios)
32
- Summary.new(steps, scenarios, out).summarize
33
- end
34
-
35
- def summarize_remaining(remaining_jobs)
36
- out.puts
37
- out.puts "The following features have not been run:"
38
- for job in remaining_jobs
39
- out.puts job.id
6
+ module Flatware
7
+ module Cucumber
8
+ module Formatters
9
+ class Console
10
+ # for format_string
11
+ include ::Cucumber::Formatter::Console
12
+
13
+ FORMATS = {
14
+ passed: '.',
15
+ failed: 'F',
16
+ undefined: 'U',
17
+ pending: 'P',
18
+ skipped: '-'
19
+ }.freeze
20
+
21
+ STATUSES = FORMATS.keys
22
+
23
+ attr_reader :out, :err
24
+
25
+ def initialize(stdout, stderr)
26
+ @out = stdout
27
+ @err = stderr
28
+ end
29
+
30
+ def progress(result)
31
+ out.print format result.progress
32
+ end
33
+
34
+ def summarize(checkpoints)
35
+ steps = checkpoints.flat_map(&:steps)
36
+ scenarios = checkpoints.flat_map(&:scenarios)
37
+ Summary.new(steps, scenarios, out).summarize
38
+ end
39
+
40
+ def summarize_remaining(remaining_jobs)
41
+ out.puts
42
+ out.puts 'The following features have not been run:'
43
+ remaining_jobs.each do |job|
44
+ out.puts job.id
45
+ end
46
+ end
47
+
48
+ private
49
+
50
+ def format(status)
51
+ format_string FORMATS[status], status
52
+ end
40
53
  end
41
54
  end
42
-
43
- private
44
- def format(status)
45
- format_string FORMATS[status], status
46
- end
47
55
  end
48
56
  end
@@ -1,64 +1,82 @@
1
1
  require 'cucumber/formatter/console'
2
2
  require 'flatware/cucumber/formatters/console'
3
3
 
4
- module Flatware::Cucumber::Formatters
5
- class Console
6
- class Summary
7
- include ::Cucumber::Formatter::Console
8
- attr_reader :io, :steps, :scenarios
4
+ module Flatware
5
+ module Cucumber
6
+ module Formatters
7
+ class Console
8
+ class Summary
9
+ include ::Cucumber::Formatter::Console
10
+ attr_reader :io, :steps, :scenarios
9
11
 
10
- def initialize(steps, scenarios=[], io=StringIO.new)
11
- @io = io
12
- @steps = steps
13
- @scenarios = scenarios
14
- end
12
+ def initialize(steps, scenarios = [], io = StringIO.new)
13
+ @io = io
14
+ @steps = steps
15
+ @scenarios = scenarios
16
+ end
15
17
 
16
- def summarize
17
- 2.times { io.puts }
18
- print_failures(steps, 'step')
19
- print_failures(scenarios.select(&:failed_outside_step?), 'scenario')
20
- print_failed_scenarios scenarios
21
- print_counts 'scenario', scenarios
22
- print_counts 'step', steps
23
- end
18
+ def summarize
19
+ 2.times { io.puts }
20
+ print_failures(steps, 'step')
21
+ print_failures(scenarios.select(&:failed_outside_step?), 'scenario')
22
+ print_failed_scenarios scenarios
23
+ print_counts 'scenario', scenarios
24
+ print_counts 'step', steps
25
+ end
24
26
 
25
- private
27
+ private
26
28
 
27
- def print_failed_scenarios(scenarios)
28
- return unless scenarios.any? &with_status(:failed)
29
+ def print_failed_scenarios(scenarios)
30
+ failed_scenarios = scenarios.select(&with_status(:failed))
31
+ return if failed_scenarios.empty?
29
32
 
30
- io.puts format_string "Failing Scenarios:", :failed
31
- scenarios.select(&with_status(:failed)).sort_by(&:file_colon_line).each do |scenario|
32
- io.puts format_string(scenario.file_colon_line, :failed) + format_string(" # Scenario: " + scenario.name, :comment)
33
- end
34
- io.puts
35
- end
33
+ io.puts format_string 'Failing Scenarios:', :failed
34
+ failed_scenarios
35
+ .sort_by(&:file_colon_line)
36
+ .map(&method(:to_failed_scenario_line))
37
+ .each(&io.method(:puts))
38
+ io.puts
39
+ end
36
40
 
37
- def print_failures(collection, label)
38
- failures = collection.select(&with_status(:failed))
39
- print_elements failures, :failed, pluralize(label, failures.size)
40
- end
41
+ def to_failed_scenario_line(scenario)
42
+ [
43
+ [scenario.file_colon_line, :failed],
44
+ ["# Scenario: #{scenario.name}", :comment]
45
+ ].map do |string, format|
46
+ format_string string, format
47
+ end.join(' ')
48
+ end
41
49
 
42
- def print_counts(label, collection)
43
- io.puts pluralize(label, collection.size) + count_summary(collection)
44
- end
50
+ def print_failures(collection, label)
51
+ failures = collection.select(&with_status(:failed))
52
+ print_elements failures, :failed, pluralize(label, failures.size)
53
+ end
45
54
 
46
- def pluralize(word, number)
47
- "#{number} #{number == 1 ? word : word + 's'}"
48
- end
55
+ def print_counts(label, collection)
56
+ io.puts(
57
+ pluralize(label, collection.size) + count_summary(collection)
58
+ )
59
+ end
49
60
 
50
- def with_status(status)
51
- proc {|r| r.status == status}
52
- end
61
+ def pluralize(word, number)
62
+ "#{number} #{number == 1 ? word : "#{word}s"}"
63
+ end
64
+
65
+ def with_status(status)
66
+ proc { |r| r.status == status }
67
+ end
53
68
 
54
- def count_summary(results)
55
- return "" unless results.any?
56
- status_counts = STATUSES.map do |status|
57
- count = results.select(&with_status(status)).size
58
- format_string "#{count} #{status}", status if count > 0
59
- end.compact.join ", "
69
+ def count_summary(results)
70
+ return '' unless results.any?
60
71
 
61
- " (#{status_counts})"
72
+ status_counts = STATUSES.map do |status|
73
+ count = results.select(&with_status(status)).size
74
+ format_string "#{count} #{status}", status if count.positive?
75
+ end.compact.join ', '
76
+
77
+ " (#{status_counts})"
78
+ end
79
+ end
62
80
  end
63
81
  end
64
82
  end
@@ -5,12 +5,12 @@ module Flatware
5
5
 
6
6
  def initialize(progress)
7
7
  @progress = progress
8
- @worker = ENV['TEST_ENV_NUMBER'].to_i
8
+ @worker = ENV.fetch('TEST_ENV_NUMBER', 0).to_i
9
9
  end
10
10
 
11
11
  class << self
12
12
  def step(*args)
13
- step = StepResult.new *args
13
+ step = StepResult.new(*args)
14
14
  new step.progress, [step]
15
15
  end
16
16
 
@@ -3,13 +3,12 @@ require 'cucumber'
3
3
  module Flatware
4
4
  module Cucumber
5
5
  class Runtime < ::Cucumber::Runtime
6
-
7
6
  attr_accessor :configuration, :loader
8
- attr_reader :out, :err
9
- attr_reader :visitor
7
+ attr_reader :out, :err, :visitor
10
8
 
11
- def initialize(out=StringIO.new, err=out)
12
- @out, @err = out, err
9
+ def initialize(out = StringIO.new, err = out)
10
+ @out = out
11
+ @err = err
13
12
  super(default_configuration)
14
13
  load_step_definitions
15
14
  @results = Results.new(configuration)
@@ -21,9 +20,13 @@ module Flatware
21
20
  config
22
21
  end
23
22
 
24
- def run(feature_files=[], options=[])
23
+ def run(feature_files = [], options = [])
25
24
  @loader = nil
26
- options = Array(feature_files) + %w[--format Flatware::Cucumber::Formatter] + options
25
+ options = [
26
+ Array(feature_files),
27
+ %w[--format Flatware::Cucumber::Formatter],
28
+ options
29
+ ].reduce(:+)
27
30
 
28
31
  configure(::Cucumber::Cli::Main.new(options, out, err).configuration)
29
32
 
@@ -5,7 +5,8 @@ module Flatware
5
5
  attr_reader :status, :exception
6
6
 
7
7
  def initialize(status, exception)
8
- @status, @exception = status, (serialized(exception) if exception)
8
+ @status = status
9
+ @exception = (serialized(exception) if exception)
9
10
  end
10
11
 
11
12
  def passed?
@@ -21,9 +22,10 @@ module Flatware
21
22
  end
22
23
 
23
24
  private
24
- def serialized(e)
25
- e.backtrace and e.backtrace.unshift e.backtrace.shift.sub(Dir.pwd, '.')
26
- SerializedException.new(e.class, e.message, e.backtrace)
25
+
26
+ def serialized(err)
27
+ err.backtrace&.unshift(err.backtrace.shift.sub(Dir.pwd, '.'))
28
+ SerializedException.new(err.class, err.message, err.backtrace)
27
29
  end
28
30
  end
29
31
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flatware-cucumber
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 2.0.0.rc1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Dunn
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-23 00:00:00.000000000 Z
11
+ date: 2021-03-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cucumber
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 1.2.0
33
+ version: 2.0.0.rc1
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 1.2.0
40
+ version: 2.0.0.rc1
41
41
  description: A distributed cucumber runner
42
42
  email: brian@hashrocket.com
43
43
  executables: []
@@ -56,29 +56,31 @@ files:
56
56
  - lib/flatware/cucumber/formatters/console/summary.rb
57
57
  - lib/flatware/cucumber/result.rb
58
58
  - lib/flatware/cucumber/runtime.rb
59
- - lib/flatware/cucumber/scenario_result.rb
60
59
  - lib/flatware/cucumber/step_result.rb
61
60
  homepage: http://github.com/briandunn/flatware
62
61
  licenses:
63
62
  - MIT
64
63
  metadata: {}
65
- post_install_message:
64
+ post_install_message:
66
65
  rdoc_options: []
67
66
  require_paths:
68
67
  - lib
69
68
  required_ruby_version: !ruby/object:Gem::Requirement
70
69
  requirements:
71
- - - "~>"
70
+ - - ">="
71
+ - !ruby/object:Gem::Version
72
+ version: '2.6'
73
+ - - "<"
72
74
  - !ruby/object:Gem::Version
73
- version: '2.1'
75
+ version: '3.1'
74
76
  required_rubygems_version: !ruby/object:Gem::Requirement
75
77
  requirements:
76
- - - ">="
78
+ - - ">"
77
79
  - !ruby/object:Gem::Version
78
- version: '0'
80
+ version: 1.3.1
79
81
  requirements: []
80
- rubygems_version: 3.0.3
81
- signing_key:
82
+ rubygems_version: 3.2.3
83
+ signing_key:
82
84
  specification_version: 4
83
85
  summary: A distributed cucumber runner
84
86
  test_files: []
@@ -1,38 +0,0 @@
1
- require 'flatware/serialized_exception'
2
- module Flatware
3
- module Cucumber
4
- class ScenarioResult
5
- attr_reader :status, :file_colon_line, :name
6
- def initialize(status, file_colon_line, name, e)
7
- @status = status
8
- @file_colon_line = file_colon_line
9
- @name = name
10
- @exception = SerializedException.new(e.class, e.message, e.backtrace) if e
11
- @failed_outside_step = false
12
- end
13
-
14
- def passed?
15
- status == :passed
16
- end
17
-
18
- def failed?
19
- status == :failed
20
- end
21
-
22
- def failed_outside_step!(file_colon_line)
23
- @failed_outside_step = file_colon_line
24
- end
25
-
26
- def failed_outside_step?
27
- !!@failed_outside_step
28
- end
29
-
30
- def exception
31
- @exception.tap do |e|
32
- e.backtrace = e.backtrace.grep(Regexp.new(Dir.pwd)).map { |line| line[Dir.pwd.size..-1] }
33
- e.backtrace = e.backtrace + [@failed_outside_step] if failed_outside_step?
34
- end
35
- end
36
- end
37
- end
38
- end