Welcome "Bryan"
-Welcome 'Bryan'
-Welcome 'Bryan"
--
-
- First -
- Second -
diff --git a/History.txt b/History.txt index 0d9900c..c6513a6 100644 --- a/History.txt +++ b/History.txt @@ -1,5 +1,6 @@ * Bug fixes - + + * Make "should contain" ignore extra whitespace when doing string comparisons (Noah Davis) * Make selenium matchers handle negative match more consistently with positive match (Luke Melia) == 0.6.0 / 2009-11-28 diff --git a/lib/webrat/core/matchers/have_content.rb b/lib/webrat/core/matchers/have_content.rb index c3b6f33..24827ca 100644 --- a/lib/webrat/core/matchers/have_content.rb +++ b/lib/webrat/core/matchers/have_content.rb @@ -12,7 +12,7 @@ module Webrat case @content when String - @element.include?(@content) + @element.gsub(/\s+/, ' ').include?(@content) when Regexp @element.match(@content) end diff --git a/spec/public/matchers/contain_spec.rb b/spec/public/matchers/contain_spec.rb index e0677ac..40017fb 100644 --- a/spec/public/matchers/contain_spec.rb +++ b/spec/public/matchers/contain_spec.rb @@ -3,21 +3,6 @@ require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper") describe "contain" do include Webrat::Matchers - before(:each) do - @body = <<-HTML -