Sha256: 651f8e893c4543f4f2c42558ef9d52a733ccf509ab8b10e3e4c07f09a5f3c5e7
Contents?: true
Size: 999 Bytes
Versions: 3
Compression:
Stored size: 999 Bytes
Contents
require 'test/unit' require 'test/unit/assertions' require 'facet/ormsupport' require 'glue' require 'glue/fixture' require 'og' require 'og/test/assertions' module Test::Unit class TestCase # Include fixtures in this test case. #-- # gmosx: this method should probably be moved to glue. #++ def fixture(*classes) for klass in classes f = Glue::Fixture.new(klass) instance_variable_set "@#{klass.to_s.demodulize.underscore.pluralize}", f Glue::Fixtures[klass] = f # create variables for the fixture objects. for name, obj in f instance_variable_set "@#{name}", obj end end end # Include fixtures in this test case, and serialize them in # the active Og store. def og_fixture(*classes) fixture(*classes) for klass in classes f = Glue::Fixtures[klass] for obj in f.objects obj.save end end end end end # * George Moschovitis <gm@navel.gr>
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
og-0.29.0 | lib/og/test/testcase.rb |
og-0.30.0 | lib/og/test/testcase.rb |
og-0.31.0 | lib/og/test/testcase.rb |