github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

nruth / anachronic

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 2
    • 1
  • Source
  • Commits
  • Network (1)
  • Issues (0)
  • Downloads (2)
  • Wiki (1)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (1)
    • master ✓
  • Tags (2)
    • v0.1.1
    • v0.1.0
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

FS directory content snapshots for diffing in tests — Read more

  cancel

http://github.com/nruth/anachronic

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

adding missing features note 
nruth (author)
Wed Nov 18 21:10:24 -0800 2009
commit  7bab698d02f4996b37f3fe11e27d74eafea419aa
tree    357b36475075690f555f2a94ff99a2b2d54474a7
parent  8e99c5b42ce265af93d8f7139eabe7c4c6c6bbac
anachronic /
name age
history
message
file .document Loading commit data...
file .gitignore
file LICENSE
file README.markdown
file Rakefile
file VERSION
directory lib/
directory rails/
directory spec/
README.markdown

anachronic

Directory content snapshots w/ comparison functionality to track filename & existence changes in testing. Developed for cucumber & rspec.

Enables easy implementation of this kind of cucumber scenario:

Scenario: completely delete an image
  Given I record the state of "public/system"
  And a site image exists
  Then the file contents of "public/system" should have changed
  When I go to the site_image's page
  And I press "Delete Image"
  Then the site image should be deleted
  When I go to the site_images page
  Then I should not see "Metal Box"
  Then the file contents of "public/system" should be as they were

Where the steps of interest are:

Given I record the state of "public/system"
Then the file contents of "public/system" should have changed
Then the file contents of "public/system" should be as they were

And are as simple as:

Given /^I record the state of "([^\"]*)"$/ do |path|
  @snapshot = Anachronic::Directory.new(path)
end

Then /^the file contents of "([^\"]*)" should have changed$/ do |path|
  @snapshot.name_diff(Anachronic::Directory.new(path)).should_not be_empty
end

Then /^the file contents of "([^\"]*)" should be as they were$/ do |path|
  diff = @snapshot.name_diff(Anachronic::Directory.new(path))
  diff.should be_empty, "#{diff.inspect}"
end

Where this code sits in vendor/plugins/anachronism.

Gem to follow, when I get it to work.

Missing Functionality / Planned Features

  • Does not detect file size, timestamp, or content changes
  • Does not show whether files were +'d or -'d (think diff)

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.

Copyright

Copyright (c) 2009 Nicholas Rutherford. See LICENSE for details.

Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server