Prev: [ANN] Ember 0.1.0
Next: openCV and ruby
From: Andrew Theaker on 3 Apr 2010 19:53 [Note: parts of this message were removed to make it a legal post.] I'm developing a data loading for work and I'm using RSpec as my testing framework. One feature of the tool is that it downloads any required data files that are missing from the local filesystem from a website. I have a test case that sets up a situation where a data file is should be downloaded, but I don't want the test to actually get the file from the website as the files are quite large and take a while to download, slowing down the internet connection. I've started looking into options for testing this functionality without the download. My current idea is to set up a local webserver as part of the test, maybe using Sinatra, and point my tool at it for the downloads. I'm not sure that this feels like the best option? Is there a way to do this with Mock objects? Any suggestions would be very much appreciated. This is also my first time using RSpec, so if I did go down the path of setting up a Sinatra webserver to download the files from, where is the best place to set it up? Should I create it in my spec file, or does it belong in the spec_helper? Cheers, Andrew Theaker
From: John Barnette on 3 Apr 2010 23:21 [Note: parts of this message were removed to make it a legal post.] On Apr 3, 2010, at 4:53 PM, Andrew Theaker wrote: > I have a test case that sets up a situation where a data file is should be > downloaded, but I don't want the test to actually get the file from the > website as the files are quite large and take a while to download, slowing > down the internet connection. http://github.com/chrisk/fakeweb ~ j.
|
Pages: 1 Prev: [ANN] Ember 0.1.0 Next: openCV and ruby |