Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Do not assume 'rspec' found on $PATH is suitable #214

Closed
wants to merge 1 commit into from

3 participants

@BanzaiMan

It could be arbitrarily old, or the Ruby run time that is running thor :spec may have a more suitable rspec.

@sferik
Owner

Doesn't this depend on rubygems?

@BanzaiMan

I suppose so.

Otherwise, we'd need something like:

require 'rbconfig'
…
ruby = File.join(RbConfig::CONFIG["bindir"], RbConfig::CONFIG["RUBY_INSTALL_NAME"])
exec "#{ruby} -S rspec --color --format=documentation spec"
@eventualbuddha
Collaborator

Wait, why is this a problem? Don't you guys run the specs with bundle exec thor spec?

@BanzaiMan

@eventualbuddha
I suspect that the problem becomes "Do not assume bundle found on $PATH is suitable," then.

@eventualbuddha
Collaborator

I'm still having trouble understanding why this is a problem. This is for running thor's own specs on a machine you control, right? Or is this trying to fix something else?

@BanzaiMan

I have a JRuby installation that has its own rspec. In $PATH, rspec points to MRI's. exec will pick the latter. Problems ensue.

@eventualbuddha
Collaborator

I see. Do you not use bundler to run the specs? Seems to me that would fix the problem (and is what you ought to be using anyway).

@sferik sferik closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  Thorfile
View
2  Thorfile
@@ -25,6 +25,6 @@ class Default < Thor
desc "spec", "Run RSpec code examples"
def spec
- exec "rspec --color --format=documentation spec"
+ exec "#{Gem.ruby} -S rspec --color --format=documentation spec"
end
end
Something went wrong with that request. Please try again.