Shane Mingins wrote:
> That currently would be my sentiment too. I am hoping to use Rails
The best accolade for Ruby, so far, comes from the Pragmatic Programmers:
Ruby stays out of your way
That's a good way to say that Ruby has a user-interface tuned for
programmer's needs. (It's also an excuse why Ruby puts the needs of the
programmer above those of the CPU!)
I thought of a similar accolade for Rails:
Rails shortens the distances between two points
Under classical web programming, you typically must add a variable to both
the SQL and HTML, then you must spend hours adding plumbing and
infrastructure to link the two.
Rails flattens that problem. You can often add a variable to the SQL, match
it in the HTML, and add _nothing_ in between. Rails took care of the
plumbing for you. And if you need that variable in the controller layer, to
add business logic, then it's usually ready and waiting for you.
> I have just read Cody Fauser's RJS Template for Rails which had
> a link about TDD RJS. I have yet to try it out. It may be of
> interest to you if you have not already seen it.
I rebutt that effort (although I am almost about to use it myself). It's a
good first start, but it's not really TDD as we know it. I will explain why,
starting with a simpler HTML example.
between languages, not worry about escapes, etc...)
If I wrote HTML, it might look like: <em>yo<strong>dude</em></strong>.
So this is not a good test for that:
assert_equal '<em>yo<strong>dude</em></strong>', my_html
We wouldn't do that for TDD on the Logic Layer, so we shouldn't accept it
for the GUI Layer. It only tests that an intermediate artifact trivially
matches our test reference.
And it didn't catch the bug - the tags are not nested.
assert_rjs is a very pretty, high-level way to do just this. It does not
indeed turned another panel blue. Instead, it trivially tests that the
Here's the RJS to update a panel:
page.replace_html 'span_id', '<em>yo<strong>dude</strong></em>'
That is light-years more convenient than the equivalent 200 lines of
assert_rjs :replace_html, 'span_id', '<em>yo<strong>dude</strong></em>'
It's a decorated form of a Log String Test. It treats the RJS page object as
a mock object that absorbs a string recording all its calls, then it
Bugs could waltz thru that system with impunity. And, that system would
impede legitimate re-work which did . Those are the two indicators of TFUI
Short-term, the only fix is to augment our Ajax with acceptance tests, such
as Watir. Long term, assert_rjs could upgrade to start interpreting that
trivially eval()-ed it, we could build a mock browser.
> BTW ... nice job on the amazon site
Dude, I have finally go to the point where writing about this stuff takes
longer than actually doing it!!
http://www.greencheese.us/ZeekLand <-- NOT a blog!!!