Hi Nicholas,

You have little choice but to mock external dependencies like S3 and
the file system in order to be able to do TDD. The problem is that, as
Matt said, if it's a mission critical feature you'll want to create
infrastructure to run tests against a real environment (even if it's
just a smoke suite that's separate from the unit tests).

Take a look at 
https://github.com/thoughtworks/cruisecontrol.rb/blob/master/test/file_sandbox.rb
which deals with this kind of issue in CC.rb for a (what I consider) a
rather nice way of dealing with this.

Best,
Sidu.
http://c42.in
http://about.me/ponnappa


On 13 April 2011 07:18, Nicholas Wieland <n...@nofeed.org> wrote:
> Hi *, the class I need to test is:
>
> https://gist.github.com/49ef28014bb648ffa63e
>
> I know my question is very generic, but I honestly fail to see how to test 
> something that is so strictly procedural and so dependent to the 
> platform/libraries.
> Should I mock/stub filesystem, services and pretty much everything that is in 
> there and test how it responds to different inputs, or adopt an "integration 
> style" ?
> How would you proceed in this case ? (you can refer to RSpec book and point 
> to parts that are relevant).
>
>  ngw
>
> --
> [ 926381, 23200231779, 1299022, 1045307475 ].collect { |a| a.to_s( 36 ) 
> }.join( " " )
> Nicholas Wieland (ngw)
> n...@nofeed.org
> http://www.nofeed.org
>
> _______________________________________________
> rspec-users mailing list
> rspec-users@rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>
_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to