Re: [rspec-users] How are people speccing and cuke-ing Paperclip (with S3)?

2010-07-17 Thread Ashley Moran

On 17 Jul 2010, at 5:43 PM, doug livesey wrote:

> Please tell me they're doing *some*thing, as I'm using S3 storage, which 
> would really slow my tests down if I just did nothing.
> I'm starting to think of all sorts of horrible solutions, like making the 
> storage strategy dependent on the environment, like using the file system if 
> it is a test or cucumber env.

For absolute confidence, you can use S3 for a full integration test.  You only 
need one of these for each type of interaction with S3 though.

For faster local integration tests, you could write a mock implementation of S3.

I've not used Paperclip, but it looks like it works as a DSL embedded into 
ActiveRecord class definitions.  That'll make it a lot harder to separate out 
the file handling that if you were writing it out explicitly.

Ash

-- 
http://www.patchspace.co.uk/
http://www.linkedin.com/in/ashleymoran



___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users


Re: [rspec-users] How are people speccing and cuke-ing Paperclip (with S3)?

2010-07-17 Thread Ashley Moran

On 17 Jul 2010, at 5:58 PM, Steve Klabnik wrote:

>  You don't need to test Paperclip's ability to put files to S3

It depends on your confidence in Paperclip (s/Paperclip/X random library) and 
the severity of problem it could cause if it doesn't work.  To me, at least, 
it's more a risk/value judgement than a binary decision.  If millions of pounds 
rested on Paperclip uploading files to the right place, I'd test the hell out 
of it before using it in my own app!

Ash

-- 
http://www.patchspace.co.uk/
http://www.linkedin.com/in/ashleymoran



___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users


Re: [rspec-users] How are people speccing and cuke-ing Paperclip (with S3)?

2010-07-17 Thread doug livesey
I was wary of taking an approach like that, as it feels a little like test
code bleeding into production code, but the sheer number of problems I'm
having trying another way tells me that I'm very inadvisedly swimming
against the stream, here.
So I think I'll rethink my strategy & try something more like this --
thanks!
   Doug.

On 17 July 2010 17:58, Steve Klabnik  wrote:

> One of the things that you learn after testing for a while is "what to
> test." You don't need to test Paperclip's ability to put files to S3; that's
> what Paperclip's internal tests are for. So what I do is this:
>
> http://gist.github.com/479647
>
> When I'm developing locally or testing, I just write files to my local
> machine. On production, they go to S3.
>
> ___
> 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

Re: [rspec-users] How are people speccing and cuke-ing Paperclip (with S3)?

2010-07-17 Thread Steve Klabnik
One of the things that you learn after testing for a while is "what to
test." You don't need to test Paperclip's ability to put files to S3; that's
what Paperclip's internal tests are for. So what I do is this:

http://gist.github.com/479647

When I'm developing locally or testing, I just write files to my local
machine. On production, they go to S3.
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users