Update specs for changes to matchers
This commit is contained in:
parent
7e94d48801
commit
006a70c0c5
@ -2,6 +2,7 @@ require File.expand_path(File.dirname(__FILE__) + "/../spec_helper")
|
|||||||
|
|
||||||
describe Webrat::Matchers do
|
describe Webrat::Matchers do
|
||||||
include Webrat::Matchers
|
include Webrat::Matchers
|
||||||
|
include Webrat::HaveTagMatcher
|
||||||
|
|
||||||
before(:each) do
|
before(:each) do
|
||||||
@body = <<-EOF
|
@body = <<-EOF
|
||||||
@ -64,19 +65,19 @@ describe Webrat::Matchers do
|
|||||||
</div>
|
</div>
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
@element.stub!(:contains?)
|
@element.stub!(:include?)
|
||||||
@element.stub!(:matches?)
|
@element.stub!(:match)
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "#matches?" do
|
describe "#matches?" do
|
||||||
it "should call element#contains? when the argument is a string" do
|
it "should call element#include? when the argument is a string" do
|
||||||
@element.should_receive(:contains?)
|
@element.should_receive(:include?)
|
||||||
|
|
||||||
Webrat::Matchers::HasContent.new("hello, world!").matches?(@element)
|
Webrat::Matchers::HasContent.new("hello, world!").matches?(@element)
|
||||||
end
|
end
|
||||||
|
|
||||||
it "should call element#matches? when the argument is a regular expression" do
|
it "should call element#match when the argument is a regular expression" do
|
||||||
@element.should_receive(:matches?)
|
@element.should_receive(:match)
|
||||||
|
|
||||||
Webrat::Matchers::HasContent.new(/hello, world/).matches?(@element)
|
Webrat::Matchers::HasContent.new(/hello, world/).matches?(@element)
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user