Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/nigelramsay/test_fixtures

Rails plugin to validate test fixtures
https://github.com/nigelramsay/test_fixtures

Last synced: about 2 months ago
JSON representation

Rails plugin to validate test fixtures

Awesome Lists containing this project

README

        

TestFixtures
============

Adds a unit test called "fixtures_test" which confirms each of your fixtures are valid.

Just run:

rake test:units
or
ruby test/units/fixtures_test.rb

Example Output
==============

If your test fails, you will get an error message such as:

$ ruby test/unit/fixtures_test.rb
Loaded suite test/unit/fixtures_test
Started
F
Finished in 0.503429 seconds.

1) Failure:
test_fixtures(FixturesTest)
[test/unit/fixtures_test.rb:35:in `assert_valid'
test/unit/fixtures_test.rb:34:in `assert_valid'
test/unit/fixtures_test.rb:11:in `test_fixtures'
test/unit/fixtures_test.rb:10:in `each'
test/unit/fixtures_test.rb:10:in `test_fixtures'
test/unit/fixtures_test.rb:7:in `each'
test/unit/fixtures_test.rb:7:in `test_fixtures'
/Users/nigelramsay/projects/sharesight/vendor/rails/activesupport/lib/active_support/testing/setup_and_teardown.rb:33:in `__send__'
/Users/nigelramsay/projects/sharesight/vendor/rails/activesupport/lib/active_support/testing/setup_and_teardown.rb:33:in `run']:
Region[408794758] is not valid:
Label is too short (minimum is 3 characters)
Label can't be blank.
is not true.

1 tests, 36 assertions, 1 failures, 0 errors

Installation instructions
=========================

To install, run this:
script/plugin install git://github.com/nigelramsay/test_fixtures.git

To uninstall, run this:
script/plugin remove test_fixtures

Credits
=======

Much of the code is from an rspec test case. I found it somewhere out there on the internet, but I can't remember where. Credit goes to that guy. I just tweaked it to remove the rspec dependency, and enhanced the failure reporting.

Copyright (c) 2008 Able Technology Limited, released under the MIT license