aboutsummaryrefslogtreecommitdiffstats
path: root/script
diff options
context:
space:
mode:
Diffstat (limited to 'script')
-rwxr-xr-xscript/autospec6
-rwxr-xr-xscript/spec10
2 files changed, 14 insertions, 2 deletions
diff --git a/script/autospec b/script/autospec
new file mode 100755
index 000000000..837bbd7f4
--- /dev/null
+++ b/script/autospec
@@ -0,0 +1,6 @@
+#!/usr/bin/env ruby
+gem 'test-unit', '1.2.3' if RUBY_VERSION.to_f >= 1.9
+ENV['RSPEC'] = 'true' # allows autotest to discover rspec
+ENV['AUTOTEST'] = 'true' # allows autotest to run w/ color on linux
+system((RUBY_PLATFORM =~ /mswin|mingw/ ? 'autotest.bat' : 'autotest'), *ARGV) ||
+ $stderr.puts("Unable to find autotest. Please install ZenTest or fix your PATH")
diff --git a/script/spec b/script/spec
index 28e8676cc..46fdbe6e4 100755
--- a/script/spec
+++ b/script/spec
@@ -1,4 +1,10 @@
#!/usr/bin/env ruby
-$LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__) + "/../vendor/plugins/rspec/lib"))
-require 'spec'
+if ARGV.any? {|arg| %w[--drb -X --generate-options -G --help -h --version -v].include?(arg)}
+ require 'rubygems' unless ENV['NO_RUBYGEMS']
+else
+ gem 'test-unit', '1.2.3' if RUBY_VERSION.to_f >= 1.9
+ ENV["RAILS_ENV"] ||= 'test'
+ require File.expand_path(File.dirname(__FILE__) + "/../config/environment") unless defined?(RAILS_ROOT)
+end
+require 'spec/autorun'
exit ::Spec::Runner::CommandLine.run