No worries, nothing wrong with some honest discussion. :) What you describe definitely makes sense. Purely relying on mocks can be fragile and won't ensure that the entire application works as expected. That's where acceptance tests come in, and the new request specs seem like a great way to write these (but there are many other viable approaches, such as Selenium).
Truth be told I may very well end up heavily leaning on request specs and rarely writing controller, view, or helper specs. But I think there are cases where this makes a lot of sense. For example I might have a slightly more complex helper method, for which I want to ensure that it properly handles different types of input (edge cases, etc.). Trying to achieve good coverage of the entire stack with request specs alone seems like it could lead to a combinatorial explosion of test cases, in which case it would probably make more sense to cover the more complex pieces via unit tests. -Mirko On Oct 29, 10:45 pm, "Daniel N" <[EMAIL PROTECTED]> wrote: > On Thu, Oct 30, 2008 at 3:03 PM, Mirko <[EMAIL PROTECTED]> wrote: > > > I'd also prefer to keep the existing controller, view, and helper > > specs around. The new request specs sound great for functional > > testing, but I'd like to be able to still write unit tests for the > > various application layers. > > > -Mirko > > I really don't want to start a flame war here so I'm asking this very > humbly. > > What do you see as the benefits of these unit tests over the request > response tests? > > I personally have used the unit testing approach and used many mocks and > stubs in them. > > I've found that I can break my app and my specs still pass, and also I can > break my specs without breaking my app. > > To me personally it just feels very fragile to build a house of mocks and > mirrors. Perhaps I just write crap mocked specs because these have bitten > me badly in the past. > > I am seriously not trying to start a flame war. I am genuinely interested > in peoples reasons for wanting to to mocked tests of the app. > > Cheers > Daniel > > > > > On Oct 29, 1:02 am, Ashley Moran <[EMAIL PROTECTED]> > > wrote: > > > On Oct 29, 2008, at 4:21 am, Yehuda Katz wrote: > > > > > As of RC1, the notion of "controller", "view" and "helper" specs are > > > > deprecated in favor of "request" specs, which test the responses for > > > > a given request. > > > > I'd like to vote in favour of these being maintained, even if they're > > > not the "recommended offical way" to write specs. > > > > There's a large contingency of BDDers who prefer to maintain > > > acceptance tests in another tool (Story Runner or Cucumber), and use > > > RSpec for lower level things, such as controllers and helpers. > > > Deprecating the isolated spec formats gives us two ways of solving one > > > problem and none of solving the other. > > > > Ashley > > > > --http://www.patchspace.co.uk/http://aviewfromafar.net/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "merb" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/merb?hl=en -~----------~----~----~----~------~----~------~--~---
