Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
running model specs requiring active record
require 'active_record' # or older require "activerecord"
require_relative 'app/models/your_model'
ActiveRecord::Base.establish_connection(adapter: 'mysql', host: 'localhost', username: 'root', database: 'your_database')
describe "something" do
it "should spec somehting" do
YourModel.first.should be_a(YourModel)
end
end
# time rspec your_model_spec.rb => ~ 3sec
# time bacon your_model_spec.rb => ~ 1sec
Owner

makevoid commented Oct 14, 2011

tell me your thoughts about it! much appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment