lib/acouchi/rspec/matchers.rb in acouchi-0.0.6 vs lib/acouchi/rspec/matchers.rb in acouchi-0.0.7
- old
+ new
@@ -6,5 +6,18 @@
end
failure_message_for_should do |actual|
"expected \"#{actual.content.join("\n")}\" to include \"#{expected}\""
end
end
+
+RSpec::Matchers.define :have_text do |expected|
+ match do |actual|
+ actual.has_text? expected
+ end
+ failure_message_for_should do |actual|
+ <<-FAIL
+ expected "#{actual.content.join("\n")}" to include "#{expected}"
+ all content on page:
+ #{actual.all_content.join("\n")}
+ FAIL
+ end
+end