Skip to content

Commit

Permalink
Fix rspec detection code
Browse files Browse the repository at this point in the history
The rspec detection code was broken when your path included multiple
strings that looked like a version triplet.
  • Loading branch information
jtdowney committed Jul 14, 2014
1 parent ae849d0 commit caf4bf2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugin/ruby.vim
Expand Up @@ -141,8 +141,8 @@ class RubyTest
'zeus rspec'
elsif File.exists?('./bin/rspec')
'./bin/rspec'
elsif File.exists?("Gemfile") && (match = `bundle show rspec-core`.match(/(\d+\.\d+\.\d+)/) || match = `bundle show rspec`.match(/(\d+\.\d+\.\d+)/i))
match.to_a.last.to_f < 2 ? "bundle exec spec" : "bundle exec rspec"
elsif File.exists?("Gemfile") && (match = `bundle show rspec-core`.scan(/(\d+\.\d+\.\d+)/) || match = `bundle show rspec`.scan(/(\d+\.\d+\.\d+)/i))
match.flatten.last.to_f < 2 ? "bundle exec spec" : "bundle exec rspec"
else
system("rspec -v > /dev/null 2>&1") ? "rspec --no-color" : "spec"
end
Expand Down

0 comments on commit caf4bf2

Please sign in to comment.