RSpec results

# RSpec Code Examples

Passed Failed Pending

pending spec with no implementation
  is pending (PENDING: Not yet implemented)

pending command with block format

with content that would fail
  is pending (PENDING: No reason given)

behaves like shared
  is marked as pending but passes n.nnnns

      Expected pending 'No reason given' to fail. No Error was raised.
      Shared Example Group: "shared" called from ./spec/rspec/core/resources/formatter_specs.rb:22

      ./spec/rspec/core/resources/formatter_specs.rb:4

      2
      3RSpec.shared_examples_for "shared" do
      4  it "is marked as pending but passes" do
      5    pending
      6    expect(1).to eq(1)

passing spec
  passesn.nnnns

failing spec
  fails n.nnnns

      Failure/Error: expect(1).to eq(2)

        expected: 2
             got: 1

        (compared using ==)

      ./spec/rspec/core/resources/formatter_specs.rb:33:in `block (2 levels) in <top (required)>'

      31RSpec.describe "failing spec" do
      32  it "fails" do
      33    expect(1).to eq(2)
      34  end
      35end

a failing spec with odd backtraces
  fails with a backtrace that has no file n.nnnns

      Failure/Error: ERB.new("<%= raise 'foo' %>").result

      RuntimeError:
        foo

      ./spec/rspec/core/resources/formatter_specs.rb:41:in `block (2 levels) in <top (required)>'

      39    require 'erb'
      40
      41    ERB.new("<%= raise 'foo' %>").result
      42  end

  fails with a backtrace containing an erb file n.nnnns

      Failure/Error: Unable to find /foo.html.erb to read failed line

      Exception:
        Exception

      /foo.html.erb:1:in `<main>': foo (RuntimeError)
         from /lib/ruby/1.9.1/erb.rb:753:in `eval'

        Showing full backtrace because every line was filtered out.
        See docs for RSpec::Configuration#backtrace_exclusion_patterns and
        RSpec::Configuration#backtrace_inclusion_patterns for more information.

      -1# Couldn't get snippet for

with a `nil` backtrace
  raises n.nnnns

      Failure/Error: Unable to find matching line from backtrace

      RuntimeError:
        boom

      -1# Couldn't get snippet for