[rspec-users] problems matching generated html output...
matt at mattwynne.net
Fri Nov 4 05:24:14 EDT 2011
On 3 Nov 2011, at 23:25, Patrick J. Collins wrote:
>> I realise this isn't the answer you're looking for, but I'm curious: where
>> did you get the idea that a presenter should know anything about HTML?
> Maybe I am using the wrong terminology then. I always thought presenters were
> classes that output presentational content
Well, in any discussion I've seen of the pattern, that's the job of the view.
MVP / Passive View is quite a well-established pattern in curly-bracket languages, and the presenter's job in that pattern is to tell the view, at a logical level, what to show. The view is then just left with the simple job of showing it. The idea being that you could use the same presenter with a view for a web app, a view for a rich-client GUI, or a view for a mobile app. In theory.
This makes them both much easier to test.
Steve Klabnik has been writing about their application in the Ruby / Rails world recently
Freelance programmer & coach
Author, http://pragprog.com/book/hwcuc/the-cucumber-book (with Aslak Hellesøy)
+44(0)7974430184 | http://twitter.com/mattwynne
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the rspec-users