Whitespace
This commit is contained in:
parent
4ac8456a48
commit
eb3a4ff5d6
@ -14,7 +14,7 @@ module Webrat
|
|||||||
@error_message = e.message
|
@error_message = e.message
|
||||||
false
|
false
|
||||||
end
|
end
|
||||||
|
|
||||||
def does_not_match?(response)
|
def does_not_match?(response)
|
||||||
response.session.wait_for do
|
response.session.wait_for do
|
||||||
!response.selenium.is_text_present(text_finder)
|
!response.selenium.is_text_present(text_finder)
|
||||||
@ -44,7 +44,7 @@ module Webrat
|
|||||||
"match #{@content.inspect}"
|
"match #{@content.inspect}"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def text_finder
|
def text_finder
|
||||||
if @content.is_a?(Regexp)
|
if @content.is_a?(Regexp)
|
||||||
"regexp:#{@content.source}"
|
"regexp:#{@content.source}"
|
||||||
|
@ -19,11 +19,11 @@ describe "contain" do
|
|||||||
it "should call element#matches? when the argument is a regular expression" do
|
it "should call element#matches? when the argument is a regular expression" do
|
||||||
@body.should contain(/hello, world/)
|
@body.should contain(/hello, world/)
|
||||||
end
|
end
|
||||||
|
|
||||||
it "should treat newlines as spaces" do
|
it "should treat newlines as spaces" do
|
||||||
"<div>it takes\ndifferent strokes</div>".should contain("it takes different strokes")
|
"<div>it takes\ndifferent strokes</div>".should contain("it takes different strokes")
|
||||||
end
|
end
|
||||||
|
|
||||||
it "should multiple spaces as a single space" do
|
it "should multiple spaces as a single space" do
|
||||||
"<div>it takes different strokes</div>".should contain("it takes different strokes")
|
"<div>it takes different strokes</div>".should contain("it takes different strokes")
|
||||||
end
|
end
|
||||||
|
@ -29,7 +29,7 @@ describe "save_and_open_page" do
|
|||||||
it "should save pages to the directory configured" do
|
it "should save pages to the directory configured" do
|
||||||
Webrat.configuration.stub!(:saved_pages_dir => "path/to/dir")
|
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)
|
File.should_receive(:open).with("path/to/dir/webrat-1234.html", "w").and_yield(@file_handle)
|
||||||
|
|
||||||
save_and_open_page
|
save_and_open_page
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user