pezra / rspec-mode

An RSpec minor mode for Emacs
257 stars 112 forks source link

Including rake files as spec-able files #140

Closed dcluna closed 8 years ago

dcluna commented 8 years ago

Currently it's not possible to run specs for Rake tasks (which usually end with the .rake file extension) from their own buffer, due to rspec-specize-file-name only recognizing the .rb extension. This PR fixes that.

dgutov commented 8 years ago

Hi!

Is there actually a standard for writing and naming specs for Rake tasks? I'd love to read about it.

dcluna commented 8 years ago

The project I'm working on follows the convention outlined here: https://robots.thoughtbot.com/test-rake-tasks-like-a-boss.

It puts the task files under lib/tasks/, and the specs under spec/lib/tasks/ spec/tasks/. It works seamlessly with rspec-mode (modulo this commit), so I think it's a good convention.

dgutov commented 8 years ago

Thanks for the link. I like it too.

dcluna commented 8 years ago

@dgutov Finally got it right (nested cl-loops are nasty), can you review again?

Also, this project follows the '1 commit per PR' rule?

dgutov commented 8 years ago

Cool. Could you remove the optional-ity of rspec-targetize-file-name's second argument?

Also, this project follows the '1 commit per PR' rule?

Nope.

dcluna commented 8 years ago

Done

dgutov commented 8 years ago

Great, thanks!