Sha256: 21e51245df0ace34b4ab73fa113a9ee4bd797b7877668be961ec7cc656c121ab

Contents?: true

Size: 1.08 KB

Versions: 2

Compression:

Stored size: 1.08 KB

Contents

# frozen_string_literal: true
# Load dependencies
require "rubygems"
require "bundler/setup"
require "rspec"
require "webmock/rspec"
require "rack/test"
require "pry"

require "simplecov"
SimpleCov.start do
  add_filter do |src|
    # Ignoring files from the spec directory
    src.filename =~ %r{/spec/}
  end
end

# ENV["APP_ENV"] replaces "RACK_ENV" since we're not in
# a Rack context.
ENV["APP_ENV"] = "test"
require File.expand_path("../../config/boot", __FILE__)

Dir[File.expand_path("../support/**/*.rb", __FILE__)].each { |f| require(f) }

# Database setup, teardown and cleanup during tests
require "sequel/extensions/migration"
require "toggl_cache/data/report_repository"
client = TogglCache::Data::DB

MIGRATIONS_DIR = File.expand_path("../../config/db_migrations", __FILE__)
RSpec.configure do |config|

  config.before(:all) do
    Sequel::Migrator.apply(client, MIGRATIONS_DIR)
  end

  config.after(:each) do
    TogglCache::Data::ReportRepository.new.delete_where("TRUE")
  end

  config.after(:all) do
    Sequel::Migrator.apply(client, MIGRATIONS_DIR, 0)
  end
end

require "toggl_cache"

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
toggl_cache-0.2.1 spec/spec_helper.rb
toggl_cache-0.2.0 spec/spec_helper.rb