On 5/4/07, <b class="gmail_sendername">Ezra Zygmuntowicz</b> &lt;<a href="mailto:ez@engineyard.com">ez@engineyard.com</a>&gt; wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>On May 4, 2007, at 3:29 PM, Brian Takita wrote:<br><br>&gt; A couple days ago I submitted a patch, that was committed by Ezra,<br>&gt; to the MrBlog project for the Rspec on Merb plugin.<br>&gt; So far, it only works with ActiveRecord including fixtures.
<br>&gt; Has any played with it? If so, did you get it to work?<br>&gt;<br>&gt; I&#39;m going to be submitting a patch for Controller specs soon. It<br>&gt; will be very bare bones, given my current lack of understanding of
<br>&gt; Merb controller development.<br>&gt; View and Helper specs will follow.<br>&gt;<br>&gt; I saw the question on IRC, but should ROM be folded into Merb<br>&gt; itself, or act as a plugin? There are advantages and disadvantages
<br>&gt; to both.<br>&gt;<br>&gt; A pull to integrate classes into Merb is that these classes can be<br>&gt; reused by Test::Unit tests and Rspec.<br>&gt; A pull to keep classes in a plugin is It can change whenever Merb<br>
&gt; or Rspec changes. Since both Merb and Rspec are rapidly evolving,<br>&gt; there may be a need for the plugin for a while.<br>&gt; Since Test::Unit is fairly static, there may not be a need to make<br>&gt; the Test::Unit library a plugin.
<br>&gt;<br>&gt; One flaw with Rails, that I hope does not get repeated in Merb, is<br>&gt; the tight coupling with Test;:Unit (same with tight coupling with<br>&gt; Rspec). Of course Rspec did not exist when Rails was first
<br>&gt; developed, so this should not be much of a problem as long as we<br>&gt; are vigilant. :)<br>&gt;<br>&gt; Brian<br>&gt;<br><br>Hey Brian-<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;I was able to get the user specs running in mrblog trunk. I commited
<br>a rake task to run them as &#39;rake specs&#39;.&nbsp;&nbsp;The presence of a spec<br>harness makes the need for proper environments in merb urgent. I will<br>hack up environments with different db settings this weekend so it<br>
will make testing and deving easier.<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;I think that we should keep it as a plugin for a little while. I<br>don&#39;t want to go down the tightly coupled road in merb&#39;s testing<br>capabilities. I think there are some core helper classes I need to
<br>write that could go in the framework and be used by test/unit or<br>rspec or whatver. Like a helper for making requests thru the<br>dispacther and controllers to test output without booting a<br>webserver, and some other stuff that will help with testing.
<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;I&#39;d like to see the test helpers that are merb specific made into<br>libraries within merb that you can use from test/unit, test/spec or<br>rspec.<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Thanks for getting this started Brian, it&#39;s a nice plugin. If you
<br>have any questions about merb internals please feel free to ask and I<br>will help you grok it quickly.</blockquote><div><br>Great. Thanks Ezra.<br><br>I submitted a patch for a frist stab at controller specs.<br>
<a href="http://merb.devjavu.com/projects/merb/ticket/45">http://merb.devjavu.com/projects/merb/ticket/45</a><br>
<br>
Here are some things of consideration:<br>
<ul><li>response.should redirect_to and response.should render_template and not implemented yet.<br></li><li>The controller Description class has a controller_class accessor. If
the first argument of describe is set to the controller class, the
examples will know that the requests are for the controller.</li><li>I couldn&#39;t figure out how to construct the correct uri given the
controller and the action.</li></ul></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Cheers-<br>-- Ezra Zygmuntowicz<br>-- Lead Rails Evangelist
<br>-- <a href="mailto:ez@engineyard.com">ez@engineyard.com</a><br>-- Engine Yard, Serious Rails Hosting<br>-- (866) 518-YARD (9273)<br><br><br></blockquote></div><br>