Class: RSpecLive::ResultDetail
- Inherits:
-
Object
- Object
- RSpecLive::ResultDetail
- Defined in:
- lib/rspec-live/result_detail.rb
Instance Attribute Summary collapse
-
#verbosity ⇒ Object
readonly
Returns the value of attribute verbosity.
Instance Method Summary collapse
- #cycle_verbosity ⇒ Object
- #detailed_examples ⇒ Object
- #focus_next ⇒ Object
-
#initialize(suite) ⇒ ResultDetail
constructor
A new instance of ResultDetail.
- #toggle_all ⇒ Object
Constructor Details
#initialize(suite) ⇒ ResultDetail
Returns a new instance of ResultDetail.
5 6 7 8 9 |
# File 'lib/rspec-live/result_detail.rb', line 5 def initialize(suite) @suite = suite @show_all = false @verbosity = 1 end |
Instance Attribute Details
#verbosity ⇒ Object (readonly)
Returns the value of attribute verbosity.
3 4 5 |
# File 'lib/rspec-live/result_detail.rb', line 3 def verbosity @verbosity end |
Instance Method Details
#cycle_verbosity ⇒ Object
19 20 21 |
# File 'lib/rspec-live/result_detail.rb', line 19 def cycle_verbosity @verbosity = (@verbosity + 1) % 4 end |
#detailed_examples ⇒ Object
23 24 25 26 27 28 29 30 |
# File 'lib/rspec-live/result_detail.rb', line 23 def detailed_examples all = @suite.ordered_examples if @focused index = @suite.ordered_example_names.index(@focused) || 0 all = all[index, all.length-index] + all[0, index] end @show_all ? all : all.select(&:failed?) end |
#focus_next ⇒ Object
15 16 17 |
# File 'lib/rspec-live/result_detail.rb', line 15 def focus_next @focused = detailed_examples[1].name if detailed_examples[1] end |
#toggle_all ⇒ Object
11 12 13 |
# File 'lib/rspec-live/result_detail.rb', line 11 def toggle_all @show_all = !@show_all end |