Rob Kaufman wrote:
> Hi All,
>   Wanted to let you know that this month SDRuby meeting will be on the
> 8th (next Thursday).  Hope to see everyone there.  Also I'm still
> looking for another speaker for this months meeting.  If you'd like to
> speak or have a suggestion for a topic please let us know =-)

I could show off the next version of assert{ 2.0 } and assert{ xpath }:

   http://assert2.rubyforge.org/assert21.html
   http://assert2.rubyforge.org/assert2_xpath.html

(That web page itself is one of their proofing applications...)

Here's what the latest (unreleased) version can do. This is an XPath test using 
Java and some Brand-X framework:

assertThat(
     document,
     hasTextAtXPath("//d...@id='info']//p[id='name']",
       containingString("Bob Jones")));

Here's the equivalent, with the XPath converted into a lite Ruby DSL:

   assert_xhtml document

   assert do
     xpath :div, :info do
       xpath :p, :name, ?. => 'Bob Jones'
     end
   end

Among other benefits, it handles escapes and naughty characters in the string 
payloads correctly. And if the inner xpath fails, its diagnostic only contains 
the <div id='info'>...</div> - not the entire containing document!

-- 
   Phlip

--~--~---------~--~----~------------~-------~--~----~
SD Ruby mailing list
[email protected]
http://groups.google.com/group/sdruby
-~----------~----~----~----~------~----~------~--~---

Reply via email to