Created
October 14, 2011 13:19
-
-
Save makevoid/1287071 to your computer and use it in GitHub Desktop.
running model specs requiring active record
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
tell me your thoughts about it! much appreciated!