Skip to content
Browse files

Improve how we find the path to the rspec exe.

On travis, it found `/home/travis/builds/rspec/exe/rspec`,
and that didn't exist. I'm not sure why it didn't find the
one in rspec-core, but I think this'll fix it.
  • Loading branch information...
1 parent a8d9014 commit cafef45eceba3f38791bf9535d0fc52bf1829705 @myronmarston myronmarston committed
Showing with 8 additions and 2 deletions.
  1. +8 −2 script/find_path_to_rspec_exe
10 script/find_path_to_rspec_exe
@@ -1,7 +1,13 @@
#!/usr/bin/env ruby
require File.expand_path('../../bundle/bundler/setup', __FILE__)
-rspec_core_path = $LOAD_PATH.grep(/rspec-core\/lib$/).first
+$LOAD_PATH.each do |path|
+ next unless path =~ %r|rspec-core/lib$|
+ rspec_exe = File.expand_path('../exe/rspec', path)
-puts File.expand_path('../exe/rspec', rspec_core_path)
+ if File.exist?(rspec_exe)
+ puts rspec_exe
+ exit(0)
+ end

0 comments on commit cafef45

Please sign in to comment.
Something went wrong with that request. Please try again.