require File.join(File.dirname(__FILE__), 'CONFIG.rb') require 'rubygems' require 'facets' require 'test/unit' require 'og' require 'glue/timestamped' class TC_OgAggrCalc < Test::Unit::TestCase # :nodoc: all include Og class Category attr_accessor :name, String end class User attr_accessor :name, String joins_many Category def initialize name @name = name end end $og1.manage_classes(User, Category) def test_all c1 = Category.create_with :name => 'one' c2 = Category.create_with :name => 'two' u = User.new 'gmosx' u.categories << c1 u.categories << c2 u.save g = User[1] assert_equal 2, g.categories.size end end