From 22d5b91dd4627701a3413ad56c763e4f689aae7e Mon Sep 17 00:00:00 2001 From: Bryan Helmkamp Date: Tue, 18 Nov 2008 21:09:48 -0500 Subject: [PATCH] Add spec:jruby task for running spec suite with jruby --- Rakefile | 7 +++---- lib/webrat/core/link.rb | 2 +- lib/webrat/test/run_specs.rb | 8 +------- 3 files changed, 5 insertions(+), 12 deletions(-) diff --git a/Rakefile b/Rakefile index 9076464..a97d4e5 100644 --- a/Rakefile +++ b/Rakefile @@ -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 \ No newline at end of file diff --git a/lib/webrat/core/link.rb b/lib/webrat/core/link.rb index 23da0f1..dceb91c 100644 --- a/lib/webrat/core/link.rb +++ b/lib/webrat/core/link.rb @@ -44,7 +44,7 @@ module Webrat end def text - @element.text + @element.inner_text end protected diff --git a/lib/webrat/test/run_specs.rb b/lib/webrat/test/run_specs.rb index be4a3a6..bfd1603 100644 --- a/lib/webrat/test/run_specs.rb +++ b/lib/webrat/test/run_specs.rb @@ -84,13 +84,7 @@ require File.dirname(__FILE__) / "run_spec" # Runs specs in all files matching the file pattern. # -# ==== Parameters -# globs:: File patterns to look for. -# spec_cmd<~to_s>:: The spec command. Defaults to "spec". -# run_opts:: Options to pass to spec commands, for instance, -# if you want to use profiling formatter. -# except:: 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]