Sha256: b5b165532a45ed39da512726b18172b729a86f04c037bb472fb1a4829203ecca

Contents?: true

Size: 1.25 KB

Versions: 1

Compression:

Stored size: 1.25 KB

Contents

= Stale Fish

This gem provides a method for keeping your fixtures in sync with their sources. This will prevent the scenario where your build is broken in production, but CI has a green build to do outdated fixture data.

== How To

Simply drop in a YAML file in your application (for rails, RAILS_ROOT/config/stale_fish.yml is preferred) and issue the following commands.

A sample YAML file:
  --- 
  stale: 
    yahoo: 
      filepath: ./tmp/yahoo.html
      source: http://www.yahoo.com
      updated: 
      frequency: 1.day
    google: 
      filepath: git_commit.json
      source: http://api.github.com/post_commit/
      updated: 
      frequency: 2.weeks

Specify one block for every fixture you would like to update. The frequency field takes any relative date included in the ActiveSupport library.

=== RSpec

For a single test:

  describe UsersController do
    before do
      StaleFish.load_config = "#{RAILS_ROOT}/config/stale_fish.yml"
      StaleFish.update_stale
    end
    ....
  end

For all tests:

  Spec::Runner.configure do |config|
    ...
    before do
      StaleFish.load_config = "#{RAILS_ROOT}/config/stale_fish.yml"
      StaleFish.update_stale
    end
    ....
  end

== Copyright

Copyright (c) 2009 Justin Smestad. See LICENSE for details.

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
jsmestad-stale_fish-1.0.0 README.rdoc