rspec / rspec-core

RSpec runner and formatters
http://rspec.info
MIT License
1.23k stars 765 forks source link

Is progress formatter wrongly being added when doc formatter is used? #1343

Closed myronmarston closed 10 years ago

myronmarston commented 10 years ago

Notice this output from https://travis-ci.org/rspec/rspec-expectations/jobs/19367516#L2953

RSpec::Expectations::PositiveExpectationHandler
  #handle_matcher
    calls failure_message if the matcher does not implement failure_message
.    calls failure_message if the matcher implements it
.    uses the custom failure message when one is provided as a callable object
.    asks the matcher if it matches
.    uses the custom failure message when one is provided
.    calls fail if matcher.diffable?
.    returns the match value
.
RSpec::Expectations::PositiveExpectationHandler
  handles submitted args
.  handles the submitted block
.
RSpec::Expectations::NegativeExpectationHandler
  #handle_matcher
    uses the custom failure message when one is provided
.    returns the match value
.    asks the matcher if it doesn't match when the matcher responds to #does_not_match?
.    uses the custom failure message when one is provided as a callable object
.    asks the matcher if it matches when the matcher doesn't respond to #does_not_match?
.    calls fail if matcher.diffable?
.

/cc @JonRowe

JonRowe commented 10 years ago

This is because both formatters are being used at once; .rspec is requiring spec_helper, which is detecting one file, no formatters, so adding documentation formatter, but the progress formatter is added by the command line... So it's require order issue in our setup...

myronmarston commented 10 years ago

Took me awhile to understand what you were saying here but I get it now. This is basically the same problem as #1280, but for the formatters rather than for files_to_run. We can probably solve it in a similar way, although it's a bit trickier here...requires need to be processed before custom formatters are loaded, I think (in case the formatter is at a non-standard path and needs to be made available by --require). We should be able to make it work some how, though...

JonRowe commented 10 years ago

Pretty much, it's a require vs formatter load order issue.

myronmarston commented 10 years ago

Fixed by #1353.