Yehuda Katz wrote:
> In the interest of collecting some demographic information on the
> community, Matt (Aimonetti, Rails evangelist) put together a poll of
> testing framework usage.
>
> Please vote at http://twtpoll.com/zhh2fm. Thanks!
Assert{ 2.0 } makes test/unit competitive with any of those literate systems.
[Plug!] 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
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---