Created
October 17, 2010 12:59
-
-
Save ayosec/630829 to your computer and use it in GitHub Desktop.
This scripts preloads the Rails environment, so you can run tests using "run 'test/unit/foo_test.rb'"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
ENV["RAILS_ENV"] = "test" | |
require File.expand_path('../../config/application', __FILE__) | |
module Kernel | |
def run(test_file) | |
Process.waitpid(fork do | |
$: << File.dirname(__FILE__)+"/../test/" | |
load test_file | |
end) | |
end | |
end | |
puts 'Use run "test/path/file.rb"' | |
require 'irb' | |
IRB.start | |
# vim: syntax=ruby |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment