acts_as-fu is a gem that lets you build ...
acts_as-fu is a gem that lets you build ActiveRecord models on the fly for testing, or whatever other reason you may have:
build_model :foos do
string :name
integer :age
end
If you’ve got an easier way to test-drive ActiveRecord extensions, do share!
Comments
How is this better than
class Foos < ActiveRecord::Base attr_accessor :name, :age endor using something like machinist or shoulda?
Your snippet and both of those tools require you to have your ActiveRecord configuration setup in advance. Also, your snippet wouldn’t actually save the :name or :age attributes to the database.
With acts_as-fu, there’s no database.yml, no fixtures, or anything else like that.
build_modelhandles everything. It’s also not tied to your test suite, so you can use it in an entirely different context, like so: gist.github.com/20015.Ahh.. do you mean “testing” not as in TDD but general prototyping / playing around?
Post a comment