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("//div[@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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---