[rspec-users] Phlip's be_html_with was RE: Problem with Custom matcher and Blocks

Phlip phlip2005 at gmail.com
Sat Apr 4 13:46:07 EDT 2009

Brandon Olivares wrote:

>       it "should have a name field" do
>         response.body.should be_html_with {
>           form.contact! do
>             label 'Name'
>             input.name!
>           end
>         }
>       end # it "should have a name field"
> There is most definitely not a name field, nor its associated label.

Can you try the assert_xhtml version? I think it will drop in with:

Spec::Runner.configure do |c|
   c.include Test::Unit::Assertions

be_html_with{} is something of a nail-soup issue for me because we always only 
use test/unit at my day job... sorry!

I will look at the issue this weekend - the @failure_message might not bubble up 
to the RSpec wrapper correctly...

More information about the rspec-users mailing list