Fredo is a project mainly written in Ruby, based on the MIT license.
sinatra-like web resource stubbing for testing purposes. Based on fakeweb.
= Fredo ==== Stubs web services by plugging a sinatra-y DSL on Net::Http
I know it was you, Fredo[http://www.youtube.com/watch?v=FcFlp6kl508]
I needed a slightly more articulated stub behaviour than the one provided by fakeweb[http://github.com/chrisk/fakeweb] to mimic S3 uploads and external APIs to process my attachments. Inside my simple cucumber steps.
== Install On the console:
gem install fredo
In your app:
config.gem 'fredo'
== Usage
I borrowed the sinatra router, fakeweb's Net::Http extension and glued them together with Rack like returns and accepts:
# and in your s3_steps.rb or what not:
Fredo.put "http://s3.amazonaws.com/*/:size.:ext" do
[200, {}, 'OK']
end
Fredo.get "http://s3.amazonaws.com/*/:size.:ext" do
fixture_path = File.expand_path("../../support/s3/placeholder_#{params[:size]}.#{params[:ext]}", __FILE__)
[200, {'ContentType' => "image/#{params[:ext]}"}, File.read]
end
== Bugs This is in a very early stage for the project, feel free to provide feedback. Please use the Github issues.
== Note on Patches/Pull Requests
== Copyright
Copyright (c) 2010 Leandro Pedroni. See LICENSE for details.