From: Andrew Timberlake Date: 2009-01-24T00:53:32+09:00 Subject: Re: Testing against an api --0016364587e8bf35ba0461286afc Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On Fri, Jan 23, 2009 at 5:38 PM, Brent Collier wrote: > When testing code that consumes a web service, is it bad for the > tests/specs to actually hit the api, or should the get/post/whatever > requests be stubbed out? > > I'm currently writing a Ruby gem for a particular micro-blogging api. My > tests actually make requests against the api and I was just wondering if > maybe I shouldn't be doing that... > -- > Posted via http://www.ruby-forum.com/. > > Two reasons you shouldn't 1) It slows down your tests which means your run them less often or stop testing eventually 2) Your calls will be directly affecting the remote service and actually creating, modifying or deleting things in the process (not usually what you want to do while testing) -- Andrew Timberlake http://ramblingsonrails.com http://www.linkedin.com/in/andrewtimberlake "I have never let my schooling interfere with my education" - Mark Twain --0016364587e8bf35ba0461286afc--