Sha256: 0d2ec0c140bacf8d6923e733b7b3c04911a627aa5016249ed64a45b49ee12574

Contents?: true

Size: 1.25 KB

Versions: 17

Compression:

Stored size: 1.25 KB

Contents

%w(auth authentication authorization).each do |library_name|
  path = File.expand_path("../../#{library_name}/lib", __FILE__)
  $LOAD_PATH.unshift(path) unless $LOAD_PATH.include?(path)
end

ENV["RACK_ENV"] = "test"
ENV["RAILS_ENV"] = "test"

require "byebug"
require "rspec"
require "awesome_print"
Dir.glob("./spec/support/**/*.rb").sort.each { |path| load path }

require "simple/sql"

unless ENV["USE_ACTIVE_RECORD"]
  database_url = Simple::SQL::Config.determine_url

  Simple::SQL.connect! database_url
  Simple::SQL.ask "DELETE FROM users"
end

SQL = Simple::SQL
USER_COUNT = 2

ActiveRecord::Base.logger.level = Logger::DEBUG
Simple::SQL.logger.level = Logger::DEBUG

RSpec.configure do |config|
  config.run_all_when_everything_filtered = true
  config.filter_run focus: (ENV["CI"] != "true")
  config.expect_with(:rspec) { |c| c.syntax = :expect }
  config.order = "random"
  config.example_status_persistence_file_path = ".rspec.data"

  config.backtrace_exclusion_patterns << /spec\/support/
  config.backtrace_exclusion_patterns << /spec_helper/
  config.backtrace_exclusion_patterns << /database_cleaner/

  config.around(:each) do |example|
    Simple::SQL.ask "TRUNCATE TABLE users, unique_users, organizations RESTART IDENTITY CASCADE"
    example.run
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
simple-sql-0.5.14 spec/spec_helper.rb
simple-sql-0.5.13 spec/spec_helper.rb
simple-sql-0.5.12 spec/spec_helper.rb
simple-sql-0.5.11 spec/spec_helper.rb
simple-sql-0.5.10 spec/spec_helper.rb
simple-sql-0.5.9 spec/spec_helper.rb
simple-sql-0.5.8 spec/spec_helper.rb
simple-sql-0.5.7 spec/spec_helper.rb
simple-sql-0.5.6 spec/spec_helper.rb
simple-sql-0.5.5 spec/spec_helper.rb
simple-sql-0.5.4 spec/spec_helper.rb
simple-sql-0.5.3 spec/spec_helper.rb
simple-sql-0.4.41 spec/spec_helper.rb
simple-sql-0.5.2 spec/spec_helper.rb
simple-sql-0.4.40 spec/spec_helper.rb
simple-sql-0.4.39 spec/spec_helper.rb
simple-sql-0.4.38 spec/spec_helper.rb