[rspec-users] problems matching generated html output...

Matt Wynne 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[1][2] 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[3]

[1] http://martinfowler.com/eaaDev/PassiveScreen.html
[2] http://www.objectmentor.com/resources/articles/TheHumbleDialogBox.pdf
[3] http://blog.steveklabnik.com/2011/09/06/the-secret-to-rails-oo-design.html


Freelance programmer & coach
Author, http://pragprog.com/book/hwcuc/the-cucumber-book (with Aslak Hellesøy)
Founder, http://relishapp.com
+44(0)7974430184 | http://twitter.com/mattwynne

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20111104/3ddc3394/attachment.html>

More information about the rspec-users mailing list