Sha256: 17eee9085fcadeaf68243e7bd2c012d552d20ae3a26a55d3f56c859d827adafb

Contents?: true

Size: 1.28 KB

Versions: 6

Compression:

Stored size: 1.28 KB

Contents

$:.unshift File.expand_path(__dir__)
$:.unshift File.expand_path('../lib',__dir__)
$:.unshift File.expand_path('support',__dir__)

require 'bundler'
Bundler.setup :default, :test

require 'simplecov'
SimpleCov.start 'praxis'

require 'praxis'

require 'rack/test'

require 'rspec/its'
require 'rspec/collection_matchers'

require 'pry'

Dir["#{File.dirname(__FILE__)}/../lib/praxis/plugins/*.rb"].each do |file|
  require file
end

Dir["#{File.dirname(__FILE__)}/support/*.rb"].each do |file|
  require file
end


RSpec.configure do |config|
  config.include Rack::Test::Methods

  config.before(:suite) do
    Praxis::Blueprint.caching_enabled = true
    Praxis::Application.instance.setup(root:'spec/spec_app')

    # create the table
    setup_database!
  end

  config.before(:each) do
    Praxis::Blueprint.cache = Hash.new do |hash, key|
      hash[key] = Hash.new
    end
  end

  config.before(:all) do
    # disable logging below warn level
    Praxis::Application.instance.logger.level = 2 # warn
  end
end

# create the test db schema
def setup_database!
  mapper = Praxis::Application.instance.plugins[:praxis_mapper]
  Sequel.connect(mapper.config.repositories["default"]['connection_settings'].dump) do |db|
    db.create_table! :people do
      primary_key :id
      string :name
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
praxis-0.16.1 spec/spec_helper.rb
praxis-0.16.0 spec/spec_helper.rb
praxis-0.15.0 spec/spec_helper.rb
praxis-0.14.0 spec/spec_helper.rb
praxis-0.13.0 spec/spec_helper.rb
praxis-0.11.2 spec/spec_helper.rb