Skip to content

Update lib/capistrano-helpers/specs.rb #13

Open
wants to merge 1 commit into from

2 participants

@Altonymous

This adds support for those that put rspec-rails in their test group instead of development group or forget it all together.

@Altonymous Altonymous Update lib/capistrano-helpers/specs.rb
This adds support for those that put rspec-rails in their test group instead of development group or forget it all together.
017d926
@woods
West Arete member

This is a clever way to do it. But I'm a bit concerned that since we're depending on exact wording of debug output, this might break in a future version of rake. What do you think about asking rake to list all available tasks, and then checking for the "spec" task in that list, like this?

if `rake --tasks` =~ /^rake spec\b/
  # spec task exists
else
  # spec task does not exist
end

We're still depending somewhat on output format, but it seems like more stable output. The purpose of the condition may be a bit more clear too.

I'd prefer it if it didn't use rake at all and instead just used rspec This way it works with any project that includes rspec as the testing framework; without having to create a rake task.

West Arete member
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.