[Nitro] PATCH: Og Testsuite, Kirby store fixes

Bryan Soto bryan.a.soto at gmail.com
Wed Jan 25 02:32:55 EST 2006


Hey list,

Apologies for the long post, but if you use multiple stores in your code,
please check out the first item, if nothing else.

Zip archive contains:

* og_manager_fix:
Adds checks so that Og managers don't try to enchant an already enchanted
class.

Regarding my earlier post (see
http://rubyforge.org/pipermail/nitro-general/2006-January/002511.html where
I reported that, due to multiple enchantments of a class, we were attempting
to create a subclass with the same name as it's superclass, i.e. class
Object < Object; end) , I decided that the real problem was that Og was
managing classes that were being managed already and so, added this check.

This does change Og's behaviour, but I'm not sure if this is something
people would even notice. So, if anyone uses multiple stores in your code,
you might want to test this and give some feedback. All I can say is, it
worked with the test suite. ;)

~~~~~

These fixes were implied by the tests.

* glue_taggable_fix:
 Fixes taggable to account for modules when adding a tag.

* legacy_fix
 Ensures the find_[all|by]_* methods work for legacy databases by retrieving
the field name from the classes properties.

~~~~~

For testing purposes only.

* og_test_config_fix
Makes config responsible for setting up stores. Changes logger if debug is
false so that logger doesn't dump to stdout.
As a consequence of the above changes, you might need to ensure rubygems is
required during test runs if you don't already.

* og_test_suite_fix
Changes the test suite to use global store configs $og1 and $og2 set up in
CONFIG.rb. All test suites just call manage classes, which ignore's its
arguments for some reason.

Moves all class definitions to within the TestCase subclass definition to
ensure that all managed classes have their own table.

 Various test case fixes, including:
   Changing module names from Og to Glue.
     tc_hierarchical
     tc_optimistic_locking
     tc_orderable
   Fixed some asserts to actually pass.
     tc_taggable
     tc_multi_validations
   Added a file
     multi_validations_model
   Commented out some tests that just don't work.
     tc_kirby
     tc_filesys

* rakefile_fix
 Fixes include directories in test task.

~~~~~

Separately attached is:

* og_store_kirby_fix
 Adds a couple of missing lines to eval_og_insert.

~~~~~

With all the above fixes applied to a clean repository, rake test runs and
completes on Linux2.6 (x86) and WinXP using Mysql, Sqlite and Kirby. By
default now, it will run silently. If you want the logger info to print to
screen, simply change CONFIG.rb debug flag to true. My advice, is to leave
$og2 set to Mysql or Postgres. One of the test cases needs to execute sql
which doesn't seem to work with Sqlite, if I remember correctly.

bryan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/nitro-general/attachments/20060125/177e0fdf/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: og_tests_fixes.zip
Type: application/zip
Size: 28415 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/nitro-general/attachments/20060125/177e0fdf/attachment.zip 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: og_store_kirby_fix
Type: application/octet-stream
Size: 11706 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/nitro-general/attachments/20060125/177e0fdf/attachment.obj 


More information about the Nitro-general mailing list