Add spec:jruby task for running spec suite with jruby
This commit is contained in:
parent
10d5d7695f
commit
22d5b91dd4
7
Rakefile
7
Rakefile
|
@ -88,8 +88,7 @@ Rake::RDocTask.new(:docs) do |rd|
|
||||||
rd.options << "-t #{title}"
|
rd.options << "-t #{title}"
|
||||||
end
|
end
|
||||||
|
|
||||||
desc "Run all specs"
|
desc "Run specs using jruby"
|
||||||
task "spec2" do
|
task "spec:jruby" do
|
||||||
require "lib/webrat/test/run_specs"
|
system "jruby -S rake spec"
|
||||||
run_specs(Dir["#{Dir.pwd}/spec//**/*_spec.rb"])
|
|
||||||
end
|
end
|
|
@ -44,7 +44,7 @@ module Webrat
|
||||||
end
|
end
|
||||||
|
|
||||||
def text
|
def text
|
||||||
@element.text
|
@element.inner_text
|
||||||
end
|
end
|
||||||
|
|
||||||
protected
|
protected
|
||||||
|
|
|
@ -84,13 +84,7 @@ require File.dirname(__FILE__) / "run_spec"
|
||||||
|
|
||||||
# Runs specs in all files matching the file pattern.
|
# Runs specs in all files matching the file pattern.
|
||||||
#
|
#
|
||||||
# ==== Parameters
|
def run_specs(globs)
|
||||||
# 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 = [])
|
|
||||||
require "optparse"
|
require "optparse"
|
||||||
require "spec"
|
require "spec"
|
||||||
globs = globs.is_a?(Array) ? globs : [globs]
|
globs = globs.is_a?(Array) ? globs : [globs]
|
||||||
|
|
Loading…
Reference in New Issue