Sheep is a simple Rack application pretenting to be the API of a CloudComputing service provider.
Why Sheep? Well it does what it is told and looks like a cloud untilexamined in a big more depth.
It's only real purpose is to give a very simple HTTP API that allowsyou to control the response directly from the request which can bedeveloped against.
$ curl http://localhost:9292/servers/200.json\?id\=srv-12345{"id":"srv-12345"}$ curl -i http://localhost:9292/servers/401.xml\?id\=srv-12345HTTP/1.1 401 UnauthorizedContent-Type: application/xmlTransfer-Encoding: chunkedServer: WEBrick/1.3.1 (Ruby/1.9.3/2012-04-20)Date: Mon, 12 Nov 2012 22:07:57 GMTContent-Length: 86Connection: Keep-Alive<?xml version="1.0" encoding="UTF-8"?><hash> <id>srv-12345</id></hash>$ curl -X POST http://localhost:9292/servers/200.json --data "id=srv-12345"{"id":"srv-12345"}
At the moment it is super generic but may be tweaked to be like a cloudprovider without getting too complex.
$ git clone https://github.com/tokengeek/sheep$ cd sheep$ bundle install
Thesheep
gem already exists unfortunately but is a API wrapper arounda seemingly gone social network.
Sheep is a Rack application to run locally whilst it pretends to be acloud provider.
$ rackup[2012-11-12 22:02:53] INFO WEBrick 1.3.1[2012-11-12 22:02:53] INFO ruby 1.9.3 (2012-04-20) [x86_64-darwin11.4.2][2012-11-12 22:02:53] INFO WEBrick::HTTPServer#start: pid=87194 port=9292
Now you make http requests using URLs in the following form:
http://localhost:9292/{your_reference}/{desired_response_code}.{json,xml}?key=value&other_key=other_valuehttp://localhost:9292/get_server/200.jsonhttp://localhost:9292/bad_authentication/401.xml?reason=checksum_screwy
Then, you build against it!
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request