class RSpec::Instafail

Constants

VERSION

Public Class Methods

new(output) click to toggle source
Calls superclass method
# File lib/rspec/instafail/rspec_3.rb, line 7
def initialize(output)
  super
  @failed_examples = []
end

Public Instance Methods

example_failed(example, counter, failure) click to toggle source
# File lib/rspec/instafail/rspec_1.rb, line 5
def example_failed(example, counter, failure)
  dump_failure(counter, failure)
end

Private Instance Methods

_dump_pending_example(example, index) click to toggle source
# File lib/rspec/instafail/rspec_2.rb, line 17
def _dump_pending_example(example, index)
  if defined? pending_fixed? # > 2.8
    if pending_fixed?(example)
      dump_pending_fixed(example, index)
    else
      preserve_size(example.example_group.ancestors) do
        dump_failure(example, index)
      end
    end
  else
    dump_pending_example_fixed(example, index) || dump_failure(example, index)
  end
end
preserve_size(array) { || ... } click to toggle source
# File lib/rspec/instafail/rspec_2.rb, line 31
def preserve_size(array)
  old = array.size
  yield
  array.pop if array.size > old
end