tpope/fivemat

Fivemat tracebacks when a test fails under Rails 5.2.3

Closed this issue · 3 comments

Converting a Rails app from 4.2.11 to 5.2.3 (Ruby 2.6.3) I am having a problem with Fivemat wherein it fails and outputs a traceback when any test in the test suite fails. It works fine when all the tests pass.

I created a simple test to show this:

RSpec.describe "something" do
  it "does something that passes" do
    expect(5).to eq(5)
  end

  it "does something that fails" do
    expect(5).to eq(4)
  end

  it "does something that is pending", :pending => true do
    expect(5).to be < 3
  end

  it "does something that is skipped", :skip => true do
    expect(5).to be < 3
  end
end

If we remove the "does something that fails" test, we get what we expect:

17:40:51 - INFO - Running: spec/example_spec.rb
Running via Spring preloader in process 96351
Run options: exclude {:slow=>true}

Randomized with seed 15663
something **.

Finished in 0.03158 seconds (files took 0.22213 seconds to load)
3 examples, 0 failures, 2 pending

Randomized with seed 15663
[1] guard(main)>

However, if we put back that test and it fails (as expected), we get:

17:42:36 - INFO - Running: spec/example_spec.rb
Running via Spring preloader in process 96254
Run options: exclude {:slow=>true}

Randomized with seed 46191
something **.F

Finished in 0.03747 seconds (files took 0.18493 seconds to load)
4 examples, 1 failure, 2 pending

Failed examples:

rspec ./spec/example_spec.rb:6 # something does something that fails

Randomized with seed 46191
Traceback (most recent call last):
        46: from -e:1:in `<main>'
        45: from /Users/username/.rvm/rubies/ruby-2.6.3/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
        44: from /Users/username/.rvm/rubies/ruby-2.6.3/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
        43: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/spring-2.1.0/lib/spring/application/boot.rb:19:in `<top (required)>'
        42: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/spring-2.1.0/lib/spring/application.rb:139:in `run'
        41: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/spring-2.1.0/lib/spring/application.rb:139:in `loop'
        40: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/spring-2.1.0/lib/spring/application.rb:145:in `block in run'
        39: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/spring-2.1.0/lib/spring/application.rb:175:in `serve'
        38: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/spring-2.1.0/lib/spring/application.rb:175:in `fork'
        37: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/spring-2.1.0/lib/spring/application.rb:215:in `block in serve'
        36: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/spring-2.1.0/lib/spring/command_wrapper.rb:38:in `call'
        35: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/spring-commands-rspec-1.0.4/lib/spring/commands/rspec.rb:18:in `call'
        34: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:285:in `load'
        33: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:257:in `load_dependency'
        32: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:285:in `block in load'
        31: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:54:in `load'
        30: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:54:in `load'
        29: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/rspec-core-3.9.0/exe/rspec:4:in `<main>'
        28: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/rspec-core-3.9.0/lib/rspec/core/runner.rb:45:in `invoke'
        27: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/rspec-core-3.9.0/lib/rspec/core/runner.rb:71:in `run'
        26: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/rspec-core-3.9.0/lib/rspec/core/runner.rb:89:in `run'
        25: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/rspec-core-3.9.0/lib/rspec/core/runner.rb:115:in `run_specs'
        24: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/rspec-core-3.9.0/lib/rspec/core/reporter.rb:74:in `report'
        23: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/rspec-core-3.9.0/lib/rspec/core/runner.rb:116:in `block in run_specs'
        22: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/rspec-core-3.9.0/lib/rspec/core/configuration.rb:2031:in `with_suite_hooks'
        21: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/rspec-core-3.9.0/lib/rspec/core/runner.rb:121:in `block (2 levels) in run_specs'
        20: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/rspec-core-3.9.0/lib/rspec/core/runner.rb:121:in `map'
        19: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/rspec-core-3.9.0/lib/rspec/core/runner.rb:121:in `block (3 levels) in run_specs'
        18: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/rspec-core-3.9.0/lib/rspec/core/example_group.rb:607:in `run'
        17: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/rspec-core-3.9.0/lib/rspec/core/reporter.rb:123:in `example_group_finished'
        16: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/rspec-core-3.9.0/lib/rspec/core/reporter.rb:208:in `notify'
        15: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/rspec-core-3.9.0/lib/rspec/core/reporter.rb:208:in `each'
        14: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/rspec-core-3.9.0/lib/rspec/core/reporter.rb:209:in `block in notify'
        13: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/fivemat-1.3.7/lib/fivemat/rspec3.rb:51:in `example_group_finished'
        12: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/fivemat-1.3.7/lib/fivemat/rspec3.rb:51:in `each_with_index'
        11: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/fivemat-1.3.7/lib/fivemat/rspec3.rb:51:in `each'
        10: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/fivemat-1.3.7/lib/fivemat/rspec3.rb:52:in `block in example_group_finished'
         9: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/rspec-core-3.9.0/lib/rspec/core/notifications.rb:200:in `fully_formatted'
         8: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/rspec-core-3.9.0/lib/rspec/core/formatters/exception_presenter.rb:78:in `fully_formatted'
         7: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/rspec-core-3.9.0/lib/rspec/core/formatters/exception_presenter.rb:86:in `fully_formatted_lines'
         6: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/rspec-core-3.9.0/lib/rspec/core/formatters/exception_presenter.rb:240:in `formatted_message_and_backtrace'
         5: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/rspec-core-3.9.0/lib/rspec/core/formatters/exception_presenter.rb:34:in `colorized_message_lines'
         4: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/rspec-core-3.9.0/lib/rspec/core/formatters/exception_presenter.rb:149:in `failure_lines'
         3: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/rspec-core-3.9.0/lib/rspec/core/formatters/exception_presenter.rb:149:in `tap'
         2: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/rspec-core-3.9.0/lib/rspec/core/formatters/exception_presenter.rb:150:in `block in failure_lines'
         1: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/rspec-core-3.9.0/lib/rspec/core/formatters/exception_presenter.rb:163:in `failure_slash_error_lines'
/Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/rspec-core-3.9.0/lib/rspec/core/formatters/exception_presenter.rb:218:in `read_failed_lines': undefined method `extract_expression_lines_at' for RSpec::Core::Formatters::SnippetExtractor:Class (NoMethodError)
        39: from -e:1:in `<main>'
        38: from /Users/username/.rvm/rubies/ruby-2.6.3/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
        37: from /Users/username/.rvm/rubies/ruby-2.6.3/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
        36: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/spring-commands-rspec-1.0.4/lib/spring/commands/rspec.rb:18:in `call'
        35: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:54:in `load'
        34: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:54:in `load'
        33: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/rspec-core-3.9.0/exe/rspec:4:in `<main>'
        32: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/rspec-core-3.9.0/lib/rspec/core/runner.rb:45:in `invoke'
        31: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/rspec-core-3.9.0/lib/rspec/core/runner.rb:71:in `run'
        30: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/rspec-core-3.9.0/lib/rspec/core/runner.rb:89:in `run'
        29: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/rspec-core-3.9.0/lib/rspec/core/runner.rb:115:in `run_specs'
        28: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/rspec-core-3.9.0/lib/rspec/core/reporter.rb:74:in `report'
        27: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/rspec-core-3.9.0/lib/rspec/core/runner.rb:116:in `block in run_specs'
        26: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/rspec-core-3.9.0/lib/rspec/core/configuration.rb:2031:in `with_suite_hooks'
        25: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/rspec-core-3.9.0/lib/rspec/core/runner.rb:121:in `block (2 levels) in run_specs'
        24: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/rspec-core-3.9.0/lib/rspec/core/runner.rb:121:in `map'
        23: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/rspec-core-3.9.0/lib/rspec/core/runner.rb:121:in `block (3 levels) in run_specs'
        22: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/rspec-core-3.9.0/lib/rspec/core/example_group.rb:607:in `run'
        21: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/rspec-core-3.9.0/lib/rspec/core/reporter.rb:123:in `example_group_finished'
        20: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/rspec-core-3.9.0/lib/rspec/core/reporter.rb:208:in `notify'
        19: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/rspec-core-3.9.0/lib/rspec/core/reporter.rb:208:in `each'
        18: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/rspec-core-3.9.0/lib/rspec/core/reporter.rb:209:in `block in notify'
        17: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/fivemat-1.3.7/lib/fivemat/rspec3.rb:51:in `example_group_finished'
        16: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/fivemat-1.3.7/lib/fivemat/rspec3.rb:51:in `each_with_index'
        15: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/fivemat-1.3.7/lib/fivemat/rspec3.rb:51:in `each'
        14: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/fivemat-1.3.7/lib/fivemat/rspec3.rb:52:in `block in example_group_finished'
        13: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/rspec-core-3.9.0/lib/rspec/core/notifications.rb:200:in `fully_formatted'
        12: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/rspec-core-3.9.0/lib/rspec/core/formatters/exception_presenter.rb:78:in `fully_formatted'
        11: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/rspec-core-3.9.0/lib/rspec/core/formatters/exception_presenter.rb:86:in `fully_formatted_lines'
        10: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/rspec-core-3.9.0/lib/rspec/core/formatters/exception_presenter.rb:240:in `formatted_message_and_backtrace'
         9: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/rspec-core-3.9.0/lib/rspec/core/formatters/exception_presenter.rb:34:in `colorized_message_lines'
         8: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/rspec-core-3.9.0/lib/rspec/core/formatters/exception_presenter.rb:149:in `failure_lines'
         7: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/rspec-core-3.9.0/lib/rspec/core/formatters/exception_presenter.rb:149:in `tap'
         6: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/rspec-core-3.9.0/lib/rspec/core/formatters/exception_presenter.rb:150:in `block in failure_lines'
         5: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/rspec-core-3.9.0/lib/rspec/core/formatters/exception_presenter.rb:163:in `failure_slash_error_lines'
         4: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/rspec-core-3.9.0/lib/rspec/core/formatters/exception_presenter.rb:204:in `read_failed_lines'
         3: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/rspec-core-3.9.0/lib/rspec/core/formatters/exception_presenter.rb:220:in `rescue in read_failed_lines'
         2: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/active_support.rb:59:in `load_missing_constant'
         1: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/active_support.rb:16:in `allow_bootsnap_retry'
/Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/active_support.rb:60:in `block in load_missing_constant': uninitialized constant RSpec::Core::Formatters::SnippetExtractor::NoSuchFileError (NameError)
        40: from -e:1:in `<main>'
        39: from /Users/username/.rvm/rubies/ruby-2.6.3/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
        38: from /Users/username/.rvm/rubies/ruby-2.6.3/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
        37: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/spring-commands-rspec-1.0.4/lib/spring/commands/rspec.rb:18:in `call'
        36: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:54:in `load'
        35: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:54:in `load'
        34: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/rspec-core-3.9.0/exe/rspec:4:in `<main>'
        33: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/rspec-core-3.9.0/lib/rspec/core/runner.rb:45:in `invoke'
        32: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/rspec-core-3.9.0/lib/rspec/core/runner.rb:71:in `run'
        31: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/rspec-core-3.9.0/lib/rspec/core/runner.rb:89:in `run'
        30: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/rspec-core-3.9.0/lib/rspec/core/runner.rb:115:in `run_specs'
        29: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/rspec-core-3.9.0/lib/rspec/core/reporter.rb:74:in `report'
        28: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/rspec-core-3.9.0/lib/rspec/core/runner.rb:116:in `block in run_specs'
        27: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/rspec-core-3.9.0/lib/rspec/core/configuration.rb:2031:in `with_suite_hooks'
        26: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/rspec-core-3.9.0/lib/rspec/core/runner.rb:121:in `block (2 levels) in run_specs'
        25: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/rspec-core-3.9.0/lib/rspec/core/runner.rb:121:in `map'
        24: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/rspec-core-3.9.0/lib/rspec/core/runner.rb:121:in `block (3 levels) in run_specs'
        23: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/rspec-core-3.9.0/lib/rspec/core/example_group.rb:607:in `run'
        22: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/rspec-core-3.9.0/lib/rspec/core/reporter.rb:123:in `example_group_finished'
        21: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/rspec-core-3.9.0/lib/rspec/core/reporter.rb:208:in `notify'
        20: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/rspec-core-3.9.0/lib/rspec/core/reporter.rb:208:in `each'
        19: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/rspec-core-3.9.0/lib/rspec/core/reporter.rb:209:in `block in notify'
        18: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/fivemat-1.3.7/lib/fivemat/rspec3.rb:51:in `example_group_finished'
        17: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/fivemat-1.3.7/lib/fivemat/rspec3.rb:51:in `each_with_index'
        16: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/fivemat-1.3.7/lib/fivemat/rspec3.rb:51:in `each'
        15: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/fivemat-1.3.7/lib/fivemat/rspec3.rb:52:in `block in example_group_finished'
        14: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/rspec-core-3.9.0/lib/rspec/core/notifications.rb:200:in `fully_formatted'
        13: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/rspec-core-3.9.0/lib/rspec/core/formatters/exception_presenter.rb:78:in `fully_formatted'
        12: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/rspec-core-3.9.0/lib/rspec/core/formatters/exception_presenter.rb:86:in `fully_formatted_lines'
        11: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/rspec-core-3.9.0/lib/rspec/core/formatters/exception_presenter.rb:240:in `formatted_message_and_backtrace'
        10: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/rspec-core-3.9.0/lib/rspec/core/formatters/exception_presenter.rb:34:in `colorized_message_lines'
         9: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/rspec-core-3.9.0/lib/rspec/core/formatters/exception_presenter.rb:149:in `failure_lines'
         8: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/rspec-core-3.9.0/lib/rspec/core/formatters/exception_presenter.rb:149:in `tap'
         7: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/rspec-core-3.9.0/lib/rspec/core/formatters/exception_presenter.rb:150:in `block in failure_lines'
         6: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/rspec-core-3.9.0/lib/rspec/core/formatters/exception_presenter.rb:163:in `failure_slash_error_lines'
         5: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/rspec-core-3.9.0/lib/rspec/core/formatters/exception_presenter.rb:204:in `read_failed_lines'
         4: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/rspec-core-3.9.0/lib/rspec/core/formatters/exception_presenter.rb:220:in `rescue in read_failed_lines'
         3: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/active_support.rb:58:in `load_missing_constant'
         2: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/active_support.rb:79:in `rescue in load_missing_constant'
         1: from /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/active_support.rb:8:in `without_bootsnap_cache'
/Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/active_support.rb:79:in `block in load_missing_constant': uninitialized constant RSpec::Core::Formatters::SnippetExtractor::NoSuchFileError (NameError)
17:42:37 - ERROR - Failed: "bundle exec spring rspec -f Fivemat -r /Users/username/.rvm/gems/ruby-2.6.3@myRailsApp/gems/guard-rspec-4.7.3/lib/guard/rspec_formatter.rb -f Guard::RSpecFormatter --failure-exit-code 2  spec/example_spec.rb" (exit code: 1)

Running this test using the "progress" format works as expected:

17:51:52 - INFO - Running: spec/example_spec.rb
Running via Spring preloader in process 3629
Run options: exclude {:slow=>true}

Randomized with seed 60797

F*.*

Pending:
  something does something that is pending
    # No reason given
    # ./spec/example_spec.rb:10
  something does something that is skipped
    # No reason given
    # ./spec/example_spec.rb:14

Failures:

  1) something does something that fails
     Failure/Error: expect(5).to eq(4)

       expected: 4
            got: 5

       (compared using ==)
     # ./spec/example_spec.rb:7:in `block (2 levels) in <main>'
     # -e:1:in `<main>'

Finished in 0.03176 seconds
4 examples, 1 failure, 2 pending

Failed examples:

rspec ./spec/example_spec.rb:6 # something does something that fails

Randomized with seed 60797

Running this test using the "documentation" format works as expected:

17:54:01 - INFO - Running: spec/example_spec.rb
Running via Spring preloader in process 4170
Run options: exclude {:slow=>true}

Randomized with seed 4267


something
  does something that is pending (PENDING: No reason given)
  does something that passes
  does something that is skipped (PENDING: No reason given)
  does something that fails (FAILED - 1)

Pending:
  something does something that is pending
    # No reason given
    # ./spec/example_spec.rb:10
  something does something that is skipped
    # No reason given
    # ./spec/example_spec.rb:14

Failures:

  1) something does something that fails
     Failure/Error: expect(5).to eq(4)

       expected: 4
            got: 5

       (compared using ==)
     # ./spec/example_spec.rb:7:in `block (2 levels) in <main>'
     # -e:1:in `<main>'

Finished in 0.03444 seconds
4 examples, 1 failure, 2 pending

Failed examples:

rspec ./spec/example_spec.rb:6 # something does something that fails

Randomized with seed 4267

I was able to reproduce this in a clean, new Rails 5.2.3 app. using Ruby 2.6.3

Not sure how to go about troubleshooting this.

tpope commented

Finally got around to trying to reproduce this and I couldn't. I matched the version numbers of Ruby, Rails, and RSpec exactly. Perhaps a change in a dependency fixed this.

If someone can provide a simple test app that demonstrates the problem, I'd be happy to take a look.

Wow, that is an old one. I had a test app up on github that showed the issue, but after github was nagging me about security vulnerabilities, I deleted it. I will see if I still have the original code and repost.

Tom,
I couldn't find the original app so I recreated one here
However, I could not reproduce the problem using the example_spec.rb from above.
Since neither of us could reproduce the issue, and it is almost three years old, we might as well close it.