Whitespace

This commit is contained in:
Bryan Helmkamp 2010-01-17 20:35:42 -05:00
parent 4ac8456a48
commit eb3a4ff5d6
3 changed files with 5 additions and 5 deletions

View File

@ -14,7 +14,7 @@ module Webrat
@error_message = e.message
false
end
def does_not_match?(response)
response.session.wait_for do
!response.selenium.is_text_present(text_finder)
@ -44,7 +44,7 @@ module Webrat
"match #{@content.inspect}"
end
end
def text_finder
if @content.is_a?(Regexp)
"regexp:#{@content.source}"

View File

@ -19,11 +19,11 @@ describe "contain" do
it "should call element#matches? when the argument is a regular expression" do
@body.should contain(/hello, world/)
end
it "should treat newlines as spaces" do
"<div>it takes\ndifferent strokes</div>".should contain("it takes different strokes")
end
it "should multiple spaces as a single space" do
"<div>it takes different strokes</div>".should contain("it takes different strokes")
end

View File

@ -29,7 +29,7 @@ describe "save_and_open_page" do
it "should save pages to the directory configured" do
Webrat.configuration.stub!(:saved_pages_dir => "path/to/dir")
File.should_receive(:open).with("path/to/dir/webrat-1234.html", "w").and_yield(@file_handle)
save_and_open_page
end