Tool for testing implementation independent AR components (like plugins)
Ruby
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
lib
test
.document
.gitignore
.rake_tasks~
LICENSE
README.rdoc
Rakefile
VERSION
artester.gemspec

README.rdoc

artester

Tool for testing AR implementation independent components (like plugins).

It recreate for every test tables (stores by sqlite in memory) and models.

Example

Artester.def :yaacl do

  model :user do
    definition do |t|
      t.string :name
      t.string :global_roles_list, :default => ''
    end

    klass do
      include YAACL::User
    end
  end

  model :role do
    definition do |t|
      t.integer :user_id
      t.string :entity_type
      t.integer :entity_id
      t.string :role
    end

    klass do
      include YAACL::Role
    end
  end
end

class UnitTest < Test::Unit::TestCase
  context "User creation" do
    setup do
      Artester[:yaacl].reload
      @author = User.create :name => 'Andrew'
    end
	end
end

Now you can use User as usual AR-model.

Copyright

Copyright © 2009 Andrew Rudenko. See LICENSE for details.