Hey guys,
I was having issues with some of the way assert_select worked, so I
wrote an alternative to assert_select using hpricot.
The major differences:
- You get full support for CSS3 and limited XPath
- It uses hpricot, which is fast; plus you get improvements to hpricot
for
free in assert_elements as long as you update the gem. - Blocks work a bit differently (assert_elements tests whether any
matched
elements passes all of the assert_elements inside the
block–assert_select
tests whether the assert_selects in the block are true for the list of
matched elements). I felt as though this was the more intuitive
solution,
and you can read my reasoning on my blog.
You can read about it at