Skip to content

Instantly share code, notes, and snippets.

@andyferra
Created February 25, 2010 03:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andyferra/314202 to your computer and use it in GitHub Desktop.
Save andyferra/314202 to your computer and use it in GitHub Desktop.
FakeWeb.allow_net_connect = false
FakeWeb.register_uri :any, 'https://bigredape-test.s3.amazonaws.com/', :status => ["200", "OK"], :body => ''
FakeWeb.register_uri :get, 'https://s3.amazonaws.com/', :status => ["200", "OK"], :body => %{<?xml version="1.0" encoding="UTF-8"?><ListAllMyBucketsResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/"><Owner><ID>6a3801b3d3f91f3d2a67cc127f18d8a532b86831e5457814b2ed2ab929f98547</ID><DisplayName>led</DisplayName></Owner><Buckets><Bucket><Name>bigredape-development</Name><CreationDate>2010-02-15T08:10:19.000Z</CreationDate></Bucket><Bucket><Name>bigredape-test</Name><CreationDate>2010-02-15T08:58:13.000Z</CreationDate></Bucket></Buckets></ListAllMyBucketsResult>}, :content_type => 'application/xml'
FakeWeb.register_uri :get, /http(s?):\/\/bigredape-test\.s3\.amazonaws\.com\/\?prefix=works(.*?)images(.*?)thumbnail(.*?)face\.jpg/, :status => ["200", "OK"], :body => '<?xml version="1.0" encoding="UTF-8"?><ListBucketResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/"><Name>bigredape-test</Name><Prefix>works/images/1/thumbnail/face\.jpg</Prefix><Marker></Marker><MaxKeys>1000</MaxKeys><IsTruncated>false</IsTruncated></ListBucketResult>', :content_type => 'application/xml'
FakeWeb.register_uri :any, /http(s?):\/\/bigredape-test\.s3\.amazonaws\.com\/works(.*?)images(.*?)thumbnail(.*?)face\.jpg/, :status => ["200", "OK"], :body => ''
FakeWeb.register_uri :get, /http(s?):\/\/bigredape-test\.s3\.amazonaws\.com\/\?prefix=works(.*?)images(.*?)medium(.*?)face\.jpg/, :status => ["200", "OK"], :body => '<?xml version="1.0" encoding="UTF-8"?><ListBucketResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/"><Name>bigredape-test</Name><Prefix>works/images/1/medium/face\.jpg</Prefix><Marker></Marker><MaxKeys>1000</MaxKeys><IsTruncated>false</IsTruncated></ListBucketResult>', :content_type => 'application/xml'
FakeWeb.register_uri :any, /http(s?):\/\/bigredape-test\.s3\.amazonaws\.com\/works(.*?)images(.*?)medium(.*?)face\.jpg/, :status => ["200", "OK"], :body => ''
FakeWeb.register_uri :get, /http(s?):\/\/bigredape-test\.s3\.amazonaws\.com\/\?prefix=works(.*?)images(.*?)large(.*?)face\.jpg/, :status => ["200", "OK"], :body => '<?xml version="1.0" encoding="UTF-8"?><ListBucketResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/"><Name>bigredape-test</Name><Prefix>works/images/1/large/face\.jpg</Prefix><Marker></Marker><MaxKeys>1000</MaxKeys><IsTruncated>false</IsTruncated></ListBucketResult>', :content_type => 'application/xml'
FakeWeb.register_uri :any, /http(s?):\/\/bigredape-test\.s3\.amazonaws\.com\/works(.*?)images(.*?)large(.*?)face\.jpg/, :status => ["200", "OK"], :body => ''
FakeWeb.register_uri :get, /http(s?):\/\/bigredape-test\.s3\.amazonaws\.com\/\?prefix=works(.*?)images(.*?)original(.*?)face\.jpg/, :status => ["200", "OK"], :body => '<?xml version="1.0" encoding="UTF-8"?><ListBucketResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/"><Name>bigredape-test</Name><Prefix>works/images/1/original/face\.jpg</Prefix><Marker></Marker><MaxKeys>1000</MaxKeys><IsTruncated>false</IsTruncated></ListBucketResult>', :content_type => 'application/xml'
FakeWeb.register_uri :any, /http(s?):\/\/bigredape-test\.s3\.amazonaws\.com\/works(.*?)images(.*?)original(.*?)face\.jpg/, :status => ["200", "OK"], :body => ''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment