Add spec:jruby task for running spec suite with jruby

This commit is contained in:
Bryan Helmkamp 2008-11-18 21:09:48 -05:00
parent 10d5d7695f
commit 22d5b91dd4
3 changed files with 5 additions and 12 deletions

View File

@ -88,8 +88,7 @@ Rake::RDocTask.new(:docs) do |rd|
rd.options << "-t #{title}"
end
desc "Run all specs"
task "spec2" do
require "lib/webrat/test/run_specs"
run_specs(Dir["#{Dir.pwd}/spec//**/*_spec.rb"])
desc "Run specs using jruby"
task "spec:jruby" do
system "jruby -S rake spec"
end

View File

@ -44,7 +44,7 @@ module Webrat
end
def text
@element.text
@element.inner_text
end
protected

View File

@ -84,13 +84,7 @@ require File.dirname(__FILE__) / "run_spec"
# Runs specs in all files matching the file pattern.
#
# ==== Parameters
# globs<String, Array[String]>:: File patterns to look for.
# spec_cmd<~to_s>:: The spec command. Defaults to "spec".
# run_opts<String>:: Options to pass to spec commands, for instance,
# if you want to use profiling formatter.
# except<Array[String]>:: File paths to skip.
def run_specs(globs, spec_cmd='spec', run_opts = "-c", except = [])
def run_specs(globs)
require "optparse"
require "spec"
globs = globs.is_a?(Array) ? globs : [globs]