Cross Reference: documentation_progress_formatter.rb
xref
: /
ontohub
/
spec
/
support
/
documentation_progress_formatter.rb
Home
History
Annotate
Line#
Navigate
Download
Search
only in
./
documentation_progress_formatter.rb revision 90653c5ebd50c820b48efe2e4c6c0d4b1c1ee317
463
N/A
require
"
rspec
/
core
/
formatters
/
base_text_formatter
"
463
N/A
463
N/A
class
DocumentationProgressFormatter
<
RSpec
::
Core
::
Formatters
::
BaseTextFormatter
463
N/A
MAX_GROUP_LEVEL
=
2
463
N/A
463
N/A
def
initialize
(
output
)
463
N/A
super
(
output
)
463
N/A
@
group_level
=
0
463
N/A
end
463
N/A
463
N/A
def
example_group_started
(
example_group
)
463
N/A
super
(
example_group
)
463
N/A
463
N/A
if
@
group_level
<
MAX_GROUP_LEVEL
463
N/A
output.puts
if
@
group_level
==
0
463
N/A
output.puts
463
N/A
output.print
"#{current_indentation}#{
example_group.description.strip
}"
463
N/A
output.print
' '
463
N/A
end
463
N/A
463
N/A
@
group_level
+=
1
463
N/A
end
525
N/A
525
N/A
def
example_group_finished
(
example_group
)
463
N/A
@
group_level
-=
1
463
N/A
end
463
N/A
463
N/A
def
stop
463
N/A
output.puts
463
N/A
output.puts
463
N/A
end
463
N/A
463
N/A
def
example_passed
(
example
)
463
N/A
super
(
example
)
output.print
passed_output
(
example
)
end
def
example_pending
(
example
)
super
(
example
)
output.print
pending_output
(
example
)
end
def
example_failed
(
example
)
super
(
example
)
output.print
failure_output
(
example
)
end
def
failure_output
(
example
)
failure_color
(
'F'
)
end
def
passed_output
(
example
)
success_color
(
'.'
)
end
def
pending_output
(
example
)
pending_color
(
'*'
)
end
def
current_indentation
' '
* @
group_level
end
end