Forum: Ruby on Rails Which test framework do you use?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Yehuda K. (Guest)
on 2009-01-02 21:25
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!
Phlip (Guest)
on 2009-01-02 21:45
(Received via mailing list)
Yehuda K. 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
This topic is locked and can not be replied to.