Sha256: 0ef53072557548f8ac00d7f97d8fe3c6559e4c8d55234f700b590beb2f3c598a
Contents?: true
Size: 906 Bytes
Versions: 1
Compression:
Stored size: 906 Bytes
Contents
require File.join(File.dirname(__FILE__), '..', 'CONFIG.rb') require 'rubygems' require 'facets' require 'test/unit' require 'og' require 'glue/optimistic_locking' $og = Og.setup( :store => 'psql', :name => 'test', :user => 'postgres', :password => 'navelrulez', :destroy => true ) class TC_OgLocking < Test::Unit::TestCase # :nodoc: all include Og class Article property :body, String include Og::Locking def initialize(body) @body = body end end def test_all $og.manage_classes Article.create('test') a = Article[1] b = Article[1] a.body = 'Changed' assert_nothing_raised do a.save end b.body = 'Ooops' assert_raise(Og::StaleObjectError) do b.update end c = Article[1] a.body = 'Changed again' assert_nothing_raised do a.update end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
og-0.27.0 | test/og/mixin/tc_optimistic_locking.rb |