Sha256: fc8a15dc97c76b19987f05f583280d550fa3115cc8c5fbd2410baa3eba8c1a60

Contents?: true

Size: 1.35 KB

Versions: 7

Compression:

Stored size: 1.35 KB

Contents

require 'rubygems'
require 'active_support'
require 'test/unit'
require 'active_record'
require 'active_record/fixtures'
require 'shoulda'
require 'ruby-debug'

ActiveRecord::Base.configurations = YAML::load(IO.read(File.dirname(__FILE__) + '/database.yml'))
ActiveRecord::Base.establish_connection('test')
ActiveRecord::Base.logger = Logger.new(File.dirname(__FILE__) + "/test.log")

load(File.dirname(__FILE__) + "/schema.rb")

$LOAD_PATH.unshift(File.dirname(__FILE__))
require File.dirname(__FILE__)+'/../lib/property_sets'

class ActiveSupport::TestCase
  include ActiveRecord::TestFixtures

  def create_fixtures(*table_names)
    if block_given?
      Fixtures.create_fixtures(Test::Unit::TestCase.fixture_path, table_names) { yield }
    else
      Fixtures.create_fixtures(Test::Unit::TestCase.fixture_path, table_names)
    end
  end

  self.use_transactional_fixtures = true
  self.use_instantiated_fixtures  = false
end

ActiveSupport::TestCase.fixture_path = File.dirname(__FILE__) + "/fixtures/"
$LOAD_PATH.unshift(ActiveSupport::TestCase.fixture_path)

class Account < ActiveRecord::Base
  property_set :settings do
    property :foo
    property :bar
    property :baz
    property :hep, :default   => 'skep'
    property :pro, :protected => true
  end

  property_set :texts do
    property :foo
    property :bar
  end

  accepts_nested_attributes_for :texts
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
property_sets-0.4.0 test/helper.rb
property_sets-0.3.6 test/helper.rb
property_sets-0.3.5 test/helper.rb
property_sets-0.3.4 test/helper.rb
property_sets-0.3.3 test/helper.rb
property_sets-0.3.2 test/helper.rb
property_sets-0.3.0 test/helper.rb