hanami / view

Views, templates and presenters for Ruby web applications
http://hanamirb.org
MIT License
173 stars 80 forks source link

Make `Hanami::View::Rendered` more specs friendly #238

Closed jodosha closed 1 year ago

jodosha commented 1 year ago

Ref https://github.com/hanami/rspec/pull/15

jodosha commented 1 year ago

@timriley Nope. 😉 Old, but Gold: https://tenderlovemaking.com/2014/06/02/yagni-methods-are-killing-me.html

timriley commented 1 year ago

@jodosha Fair enough, though in a parallel universe, the actual return value of View#call would be literal String and no one would blink :) This is why I felt it might be a reasonable change here. But yes, keeping this as Rendered with a #to_str and a small handful of the most useful methods is a much more defensible position, so I'm happy to keep it as is 👍🏼