Welcome to FlickrMocks

FlickrMocks makes it possible to Marshal responses generated from the FLickRaw gem. This is useful for Mocking/Stubbing the Flickr interface for testing purposes.

The FlickRaw::Response and FlickRaw::ResponseList objects can not be Marshaled because they contain singleton’s.

Getting Started

  1. Install flickrmocks:

    <tt>gem install flickrmocks</tt>
    
  2. require ‘flickrmocks’

  3. You should be able to Marshal/Unmarshal FlickRaw::Response and FlickRaw::ResponseList

classes.

FlickRaw.api_key = ‘xxx your flickr api key goes here’ a = flickr.photos.search :tags => ‘dog’ b = Marshal.dump(a) Marshal.load(b)

Rails Installation (Test::Unit)

Specify the gem dependency in your config/environment.rb file:

Rails::Initializer.run do |config|
  config.gem "flickrmocks", :lib => "flickrmocks"
end

Then:

$ rake gems:install
$ rake gems:unpack

Note on Patches/Pull Requests

  • Fork the project.

  • Make your feature addition or bug fix.

  • Add tests for it. This is important so I don’t break it in a future version unintentionally.

  • Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)

  • Send me a pull request. Bonus points for topic branches.

License

FlickrMocks is released under the MIT license.

Copyright © 2010 Takaltoo.