jsmestad / stale_fish
- Source
- Commits
- Network (3)
- Issues (0)
- Wiki (4)
- Graphs
-
Tag:
v1.0.0
commit 52a3279baa88a152161c6de7d08f5a46aa61cbd6
tree c7b34dcd45a980abd6aa7e991a7440269c3423f9
parent 75b7e64ee7c85d892ddfded3c77d751cac26c21b
tree c7b34dcd45a980abd6aa7e991a7440269c3423f9
parent 75b7e64ee7c85d892ddfded3c77d751cac26c21b
| name | age | message | |
|---|---|---|---|
| |
.document | ||
| |
.gitignore | Fri Jun 26 14:18:08 -0700 2009 | |
| |
LICENSE | Fri Jun 26 12:13:11 -0700 2009 | |
| |
README.rdoc | ||
| |
Rakefile | ||
| |
VERSION | ||
| |
lib/ | ||
| |
spec/ | ||
| |
tmp/ | Fri Jun 26 14:18:08 -0700 2009 |
README.rdoc
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 © 2009 Justin Smestad. See LICENSE for details.

