jacobmendoza / rspec-tree-runner

RSpec runner and files analyzer for Atom editor
https://atom.io/packages/rspec-tree-runner
MIT License
9 stars 2 forks source link

Force JSON formatter in RSpec call. #2

Closed phyllisstein closed 9 years ago

phyllisstein commented 9 years ago
jacobmendoza commented 9 years ago

Hey @phyllisstein, thanks a lot!

I'd like to have more information about the error. As you were pointing out in the issue, my idea is to use the json formatter of the RSpec runner and use it to parse easily the results. As far as I know, it is standard and should be included with RSpec.

I thought that it would be more flexible to put the --json parameter in a configuration instead of hardcoding the value in the command, just in case somebody used it in a way that I didn't expect at the moment. To be honest, seems a bad idea now, and your PR seems perfect.

Anyway, before merging, I'd like to understand how you received the error. The format -j should be included in a configuration variable named rspecPathCommand, which by default contains 'rspec --format j'. Did you change that variable? Were you using a custom value or something?.

I really appreciate the time that you've taken to write the issue and PR. I'd love to keep hearing from you with any idea or improvement.

phyllisstein commented 9 years ago

Yup! It's apparently standard-issue, I just didn't know about it, hah. I had to change the RSpec Path Command value in the configuration to bin/rspec: I'm test-driving Homebrew's Ruby build and have no idea where in Creation it's sticking my gem binaries, so I fell back on the Bundler binstub. Since changing that setting clobbers your default, it seemed like you'd probably avoid future tickets from future dummies by just forcing the --formatter flag---from what I can see, it looks like a hard enough requirement for the package to function that you can get away with hard-coding it. I'd vote for keeping the Path Command configuration option, to satisfy the other weird edge case I'm occupying, but just moving the flag into your CoffeeScript.

Thanks again, and good luck!

jacobmendoza commented 9 years ago

Daniel,

As you were saying, I'm going to consider the formatter a hard requirement, which I think makes a lot of sense. Without it things just won't work, so I don't see the point of having it exposed.

Thanks again for your time.