<commit_before>require File.join(File.dirname(__FILE__), '..', 'init.rb')

require 'rubygems'
require 'sinatra'
require 'rack/test'
require 'rspec'

set :environment, :test

module LokkaTestMethods
  def app
    @app ||= Lokka::App
  end
end

RSpec.configure do |config|
  config.include Rack::Test::Methods
  config.include LokkaTestMethods
end<commit_msg>fixed database connection error at test.<commit_after>require File.join(File.dirname(__FILE__), '..', 'init.rb')

require 'rubygems'
require 'sinatra'
require 'rack/test'
require 'rspec'

set :environment, :test
Lokka::Database.new.connect

module LokkaTestMethods
  def app
    @app ||= Lokka::App
  end
end

RSpec.configure do |config|
  config.include Rack::Test::Methods
  config.include LokkaTestMethods
end
{'fraction_non_alphanumeric': 0.1235370611183355, 'fraction_numerical': 0.0, 'mean_word_length': 5.311475409836065, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7444639', 'n_tokens_mistral': 266, 'n_tokens_neox': 257, 'n_words': 65}