Skip to content

Instantly share code, notes, and snippets.

@warmwaffles
Created March 13, 2015 15:02
Show Gist options
  • Save warmwaffles/9eee7c3ddcd24b16a645 to your computer and use it in GitHub Desktop.
Save warmwaffles/9eee7c3ddcd24b16a645 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
# Put this on your path or in <app>/bin/m and then execute individual tests
# with `bin/m path/to/test`
$LOAD_PATH.unshift('lib', 'spec', 'test')
ARGV.each do |path|
if File.directory?(path)
dir = path.gsub(/\/+\Z/, '')
Dir.glob("#{dir}/**/*_{spec,test}.rb").each { |f| load(f) }
else
load(path)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment