Class: Pork::Description
- Defined in:
- lib/pork/report/description.rb
Instance Attribute Summary collapse
-
#last_executor ⇒ Object
Returns the value of attribute last_executor.
Attributes inherited from Report
Instance Method Summary collapse
- #case_end ⇒ Object
- #case_start(context) ⇒ Object
- #msg_errored ⇒ Object
- #msg_failed ⇒ Object
- #msg_pass ⇒ Object
- #msg_skip ⇒ Object
Instance Attribute Details
#last_executor ⇒ Object
Returns the value of attribute last_executor.
6 7 8 |
# File 'lib/pork/report/description.rb', line 6 def last_executor @last_executor end |
Instance Method Details
#case_end ⇒ Object
35 36 37 |
# File 'lib/pork/report/description.rb', line 35 def case_end io.puts end |
#case_start(context) ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/pork/report/description.rb', line 21 def case_start context self.last_executor ||= Executor executor = context.class levels = executor.ancestors.drop(1).count{ |a| a <= Executor } if executor != Executor && last_executor != executor io.puts "#{' ' * (levels - 1)}#{executor.desc}" end io.print "#{' ' * levels}#{context.pork_description}" self.last_executor = executor end |
#msg_errored ⇒ Object
19 |
# File 'lib/pork/report/description.rb', line 19 def msg_errored; "\e[1G#{super}"; end |
#msg_failed ⇒ Object
18 |
# File 'lib/pork/report/description.rb', line 18 def msg_failed ; "\e[1G#{super}"; end |
#msg_pass ⇒ Object
8 9 10 11 12 13 14 15 |
# File 'lib/pork/report/description.rb', line 8 def msg_pass msg = "\e[1Go" if respond_to?(:green, true) green(msg) else msg end end |
#msg_skip ⇒ Object
17 |
# File 'lib/pork/report/description.rb', line 17 def msg_skip ; "\e[1G#{super}"; end |