BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
7faafa5a
Commit
7faafa5a
authored
Mar 30, 2017
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'rs-spinach-reporter' into 'master'
Monkey patch the Spinach StdoutReporter to show scenario locations See merge request !10321
parents
03538558
9aedf9c4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
env.rb
features/support/env.rb
+16
-0
No files found.
features/support/env.rb
View file @
7faafa5a
...
...
@@ -33,3 +33,19 @@ Spinach.hooks.before_run do
include
FactoryGirl
::
Syntax
::
Methods
end
module
StdoutReporterWithScenarioLocation
# Override the standard reporter to show filename and line number next to each
# scenario for easy, focused re-runs
def
before_scenario_run
(
scenario
,
step_definitions
=
nil
)
@max_step_name_length
=
scenario
.
steps
.
map
(
&
:name
).
map
(
&
:length
).
max
if
scenario
.
steps
.
any?
name
=
scenario
.
name
# This number has no significance, it's just to line things up
max_length
=
@max_step_name_length
+
19
out
.
puts
"
\n
#{
'Scenario:'
.
green
}
#{
name
.
light_green
.
ljust
(
max_length
)
}
"
\
" #
#{
scenario
.
feature
.
filename
}
:
#{
scenario
.
line
}
"
end
end
Spinach
::
Reporter
::
Stdout
.
prepend
(
StdoutReporterWithScenarioLocation
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment