Skip to content

Instantly share code, notes, and snippets.

@makevoid
Created October 14, 2011 13:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save makevoid/1287071 to your computer and use it in GitHub Desktop.
Save makevoid/1287071 to your computer and use it in GitHub Desktop.
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
@makevoid
Copy link
Author

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