Skip to content

Commit

Permalink
Update specs for changes to matchers
Browse files Browse the repository at this point in the history
  • Loading branch information
brynary committed Nov 6, 2008
1 parent 7e94d48 commit 006a70c
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions spec/api/matchers_spec.rb
Expand Up @@ -2,6 +2,7 @@

describe Webrat::Matchers do
include Webrat::Matchers
include Webrat::HaveTagMatcher

before(:each) do
@body = <<-EOF
Expand Down Expand Up @@ -64,19 +65,19 @@
</div>
EOF

@element.stub!(:contains?)
@element.stub!(:matches?)
@element.stub!(:include?)
@element.stub!(:match)
end

describe "#matches?" do
it "should call element#contains? when the argument is a string" do
@element.should_receive(:contains?)
it "should call element#include? when the argument is a string" do
@element.should_receive(:include?)

Webrat::Matchers::HasContent.new("hello, world!").matches?(@element)
end

it "should call element#matches? when the argument is a regular expression" do
@element.should_receive(:matches?)
it "should call element#match when the argument is a regular expression" do
@element.should_receive(:match)

Webrat::Matchers::HasContent.new(/hello, world/).matches?(@element)
end
Expand Down

0 comments on commit 006a70c

Please sign in to comment.