Did you know you can use regular expressions with assert_select? It’s pretty fun. Here’s a selector to verify a page does not include any table rows with ids of the form “day_entry_#”.
assert_select "tr[id*=?]", /day_entry_\d+/, :count => 0
Philip, I assume you're the original assert{ 2.0 } Philip, yes?
I actually had thought that project was in stasis. I'm the only
person I know using assert{ 2.0 }, but I do love it. The assert{ }
syntax along with the useful failure output is a big win.
Looks like you're adding on to that puppy - cool. Sadly, I haven't
written an assert_select for a long while, so assert_xhtml isn't
solving any pain points at this time. But I'll still happily go on
using assert{ 2.0 } as is!
I actually had thought that project was in stasis. I'm the only
person I know using assert{ 2.0 }, but I do love it. The assert{ }
syntax along with the useful failure output is a big win.
The version for Ruby 1.9 has a better layout at fault time. (I can factually identify the freaking \n linefeeds in the {} block using Ripper! Woot!)
Looks like you're adding on to that puppy - cool. Sadly, I haven't
written an assert_select for a long while, so assert_xhtml isn't
solving any pain points at this time. But I'll still happily go on
using assert{ 2.0 } as is!
Np. Another goal is its sub-modules take care of themselves, and you don't need to worry about them if you don't use them. xhtml.rb is not big enough for its own product, and after the 1.9 transition I will be free to unify all the diagnostic techniques into a seamless whole.
Folks, the point of the assert{ 2.0 } project is to make a lowly assertion as powerful as CppUnit ASSERT() was for me in Visual Studio (back in the days when MS still had a shred of relevance). When an assertion failed, it invoked a debugger breakpoint, and you would see in one window...
- the test source
- the call stack
- sometimes the code source
- all your local variable's values.
There's no reason any assert should not give you all that. You should not have to write extra at test time to get it - that would just slow you down!