Skip to content

Instantly share code, notes, and snippets.

@eightbitraptor
Created February 5, 2012 21:47
Show Gist options
  • Save eightbitraptor/1748082 to your computer and use it in GitHub Desktop.
Save eightbitraptor/1748082 to your computer and use it in GitHub Desktop.
test harness for faking a rails app in tests.
class TestMigration < ActiveRecord::Migration
def self.up
create_table :test_models do |t|
t.integer :created_at
end
end
end
require 'active_record'
ActiveRecord::Base.establish_connection({
adapter: "sqlite3",
database: ":memory:"
})
ActiveRecord::Migrator.up('.')
class TestModel < ActiveRecord::Base;
include Wallpaper
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment