$LOAD_PATH << File.join(File.dirname(__FILE__), '..', 'lib') require 'bundler/setup' require 'active_record' require 'cachai' require 'rack/test' ActiveRecord::Base.establish_connection( "adapter" => "sqlite3", "database" => ':memory:' ) ActiveRecord::Base.logger = Logger.new(STDOUT) # this is done automatically by cachai # load File.join(File.dirname(__FILE__), '/../db/schema.rb') class TestApp < Sinatra::Base use Cachai::Middleware, { :domain => 'domain.com', :recipient => 'test@example.com', :duration => 30, :sendgrid => { :api_key => 'test', :api_user => 'test' }, :blocked_ips => [ "12.12.12.12" ] } get '/' do 'Hello world' end end RSpec.configure do |config| config.color = true end