class RSpecLive::ResultDetail

Attributes

verbosity[R]

Public Class Methods

new(suite) click to toggle source
# File lib/rspec-live/result_detail.rb, line 5
def initialize(suite)
  @suite = suite
  @show_all = false
  @verbosity = 1
end

Public Instance Methods

cycle_verbosity() click to toggle source
# File lib/rspec-live/result_detail.rb, line 19
def cycle_verbosity
  @verbosity = (@verbosity + 1) % 4
end
detailed_examples() click to toggle source
# 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() click to toggle source
# File lib/rspec-live/result_detail.rb, line 15
def focus_next
  @focused = detailed_examples[1].name if detailed_examples[1]
end
toggle_all() click to toggle source
# File lib/rspec-live/result_detail.rb, line 11
def toggle_all
  @show_all = !@show_all
end