[rspec-users] (x)HTML Parsing Errors, Cuc 0.2.0 + Rspec 1.2

Peer Allan Peer.Allan at canadadrugs.com
Tue Apr 7 13:08:54 EDT 2009

We found the issue and it was related to how rspec wraps assert_select.  In
rspec-rails 1.1.12 HTML::Document is initialized differently for
response.body than for strings.  In 1.2.2 this was changed so that they were
initialized in the same way. This caused the string to be validated as XML
and generated the warnings and matcher errors we were seeing .  We patched
assert_select.rb so that strings are initialized the old way and all the
errors went away.  

I forked the project on github and the patch is available there (but not as
a gem)



Peer Allan
Development Team Lead, e-Business

24  Terracon Place
Winnipeg, MB, Canada
R2J  4G7

Phone: (204) 654-7951
Fax:  (204) 654-7910

> From: Peer Allan <Peer.Allan at canadadrugs.com>
> Reply-To: rspec-users <rspec-users at rubyforge.org>
> Date: Tue, 07 Apr 2009 09:53:23 -0500
> To: rspec-users <rspec-users at rubyforge.org>
> Subject: Re: [rspec-users] (x)HTML Parsing Errors, Cuc 0.2.0 + Rspec 1.2
>> This is going to sound a lot like buck-passing, but the have_tag
>> matcher in rspec-rails is a wrapper for Rails' assert_select, which is
>> what does the actual parsing. So if the fix is to make it more
>> tolerant of poorly formatted XHTML, that's going to have to go to the
>> rails project.
> You given us a new direction to pursue, so don't feel too bad ;)  Thanks.
> Peer
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users

More information about the rspec-users mailing list