spec/spec_helper.rb in username_suggester-0.2.2 vs spec/spec_helper.rb in username_suggester-0.3.0

- old
+ new

@@ -1,13 +1,11 @@ -begin - require File.dirname(__FILE__) + '/../../../../spec/spec_helper' -rescue LoadError - puts "You need to install rspec in your base app" - exit -end +require 'active_record' +require 'with_model' -plugin_spec_dir = File.dirname(__FILE__) -ActiveRecord::Base.logger = Logger.new(plugin_spec_dir + "/debug.log") +# At last require our lib +require 'username_suggester' -databases = YAML::load(IO.read(plugin_spec_dir + "/db/database.yml")) -ActiveRecord::Base.establish_connection(databases[ENV["DB"] || "mysql"]) -load(File.join(plugin_spec_dir, "db", "schema.rb")) +RSpec.configure do |config| + config.extend WithModel +end + +ActiveRecord::Base.establish_connection(:adapter => "sqlite3", :database => ":memory:") \ No newline at end of file