Skip to content

Instantly share code, notes, and snippets.

@HakubJozak
Created October 9, 2015 08:40
Show Gist options
  • Save HakubJozak/43ab41fbe25d3c27240f to your computer and use it in GitHub Desktop.
Save HakubJozak/43ab41fbe25d3c27240f to your computer and use it in GitHub Desktop.
Single test runner in Rails
#!/usr/bin/env ruby
# ($:).unshift 'test'
($:).unshift '.'
file = ARGV.shift
opts = ARGV.join(' ')
cmd = if opts
%{bin/rake test #{file} TESTOPTS="#{opts}"}
else
%{bin/rake test #{file}}
end
puts "(from #{__FILE__}: #{cmd})"
system cmd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment