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]