Sha256: 411e2424c30b3804193bb651400a6fc04f415d3b62db7f5e7a2d29da7438d158
Contents?: true
Size: 1.26 KB
Versions: 4
Compression:
Stored size: 1.26 KB
Contents
require File.join(File.dirname(__FILE__), '..', 'CONFIG.rb') require 'rubygems' require 'facets' require 'test/unit' require 'og' =begin FileSys is currently inaccessible through Og.setup? 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
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
og-0.28.0 | test/og/store/tc_filesys.rb |
og-0.29.0 | test/og/store/tc_filesys.rb |
og-0.30.0 | test/og/store/tc_filesys.rb |
og-0.31.0 | test/og/store/tc_filesys.rb |