Skip to content

Commit

Permalink
Allow tests to run without a network connection
Browse files Browse the repository at this point in the history
  • Loading branch information
trevorturk committed Mar 18, 2011
1 parent 1fe35e2 commit 5631438
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
10 changes: 9 additions & 1 deletion features/step_definitions/download_steps.rb
@@ -1,4 +1,12 @@
When /^I download the file '([^']+)'/ do |url|
unless ENV['REMOTE'] == 'true'
sham_rack_app = ShamRack.at('s3.amazonaws.com').stub
sham_rack_app.register_resource('/Monkey/testfile.txt', 'S3 Remote File', 'text/plain')
end

@uploader.download!(url)
end

unless ENV['REMOTE'] == 'true'
ShamRack.unmount_all
end
end
1 change: 1 addition & 0 deletions features/support/env.rb
Expand Up @@ -7,6 +7,7 @@

require 'spec'
require 'carrierwave'
require 'sham_rack'

alias :running :lambda

Expand Down

0 comments on commit 5631438

Please sign in to comment.