On 8/15/07, Rick Olson <[EMAIL PROTECTED]> wrote: > > On 8/15/07, giles bowkett <[EMAIL PROTECTED]> wrote: > > > > Hi all - there's a patch I need to apply from a ticket: > > > > http://dev.rubyonrails.org/ticket/8798 > > > > The ticket appears to be stalled on the lack of a test case.
As original submittor, the stall has been my fault :-(. I"ve been heads down on a pretty large project that happens to be using ARes (with my patch) successfully -- but thanks for taking this on. > > I figured > > I'd just whip one up, but because it's an Active Resource thing, and > > the test case would need to do ModelName.find(:all), I'd need to > > either mock the network connection or set one up. > > > > In this case setting up a mock seems kind of weak, but setting up the > > net con seems kind of overbearing. > > > > What's recommended here? > > The active resource unit tests use a mock request object for testing. One thing that makes me a little uncomfortable with the ARes unit tests is that the ones that consume XML do not start from raw XML input ... they start from a Ruby Hash that is converted into XML, and therefore might *not* reflect the kind of data you might really get across the wire. Maybe that is really more appropriate for higher level testing -- but the bug that 8798 reports was not caught by the current tests ... and indeed did not bite me until I actually tried to parse XML passed across the network (from a Rails app using to_xml to serialize ActiveRecord models, which is subtly different than to_xml on a Hash). Craig McClanahan > > -- > Rick Olson > http://lighthouseapp.com > http://weblog.techno-weenie.net > http://mephistoblog.com > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" 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/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
