Sha256: 4ba095d63f4cc807f1627272c54e590b70bc413d51c676fdc3b2caa716cefd5a
Contents?: true
Size: 1.25 KB
Versions: 2
Compression:
Stored size: 1.25 KB
Contents
=begin FileSys is currently not available. require File.join(File.dirname(__FILE__), '..', 'CONFIG.rb') require 'rubygems' require 'facets' require 'test/unit' require 'og' class TestCaseOgFilesys < Test::Unit::TestCase # :nodoc: all include Og @og = Og.setup(:store => :filesys, :name => 'test') class Article property :body, String has_many :comment, Comment def initialize(body = nil) @body = body end end class Comment property :body, String belongs_to :article, Article def initialize(body = nil) @body = body end end class User property :name, :name_key => true end @og.manage_classes(Article, Comment, User) def self.og @og end def og self.class.og end def test_all # p Comment.metadata # p Article.metadata a1 = Article.new('Article 1') og.store.save(a1) a2 = og.store.load(1, Article) assert_equal a1.body, a2.body a3 = Article.new('Article 3') a3.save og.store.delete(a3) assert og.store.load(1, Article) assert !og.store.load(2, Article) a2.delete # a.comments << Comment.new('Comment 1') # a.save # a = Article[1] og.store.close # @og.store.class.destroy(@og.options) end end =end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
og-0.41.0 | test/og/store/tc_filesys.rb |
og-0.40.0 | test/og/store/tc_filesys.rb |