Sha256: 1725fb8549b3a589ad01c1a8eba607c9faba46fb85ef2555c20d94371ed190e4

Contents?: true

Size: 1.16 KB

Versions: 3

Compression:

Stored size: 1.16 KB

Contents

# make sure this is set before Sinatra is required
ENV["RACK_ENV"] = "test"

# have this database is available for tests
ENV["TEST_DATABASE_URL"] ||= "postgres://localhost/pliny-gem-test"

require "bundler"
Bundler.require

require "active_support/all"
require "fileutils"
require "rack/test"
require "sequel"
require "sinatra/namespace"
require "sinatra/router"
require "timecop"

require_relative "../lib/pliny"
Pliny::Utils.require_glob("./spec/support/**/*.rb")
DB = Sequel.connect(ENV["TEST_DATABASE_URL"])

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

  config.expect_with :minitest
  config.mock_with :rspec
  config.run_all_when_everything_filtered = true
  config.filter_run :focus

  config.before :each do
    Pliny::RequestStore.clear!
  end

  # Run specs in random order to surface order dependencies. If you find an
  # order dependency and want to debug it, you can fix the order by providing
  # the seed, which is printed after each run.
  #     --seed 1234
  config.order = 'random'

  # the rack app to be tested with rack-test:
  def app
    @rack_app || fail("Missing @rack_app")
  end
end

Pliny.stdout = StringIO.new
Pliny.stderr = StringIO.new

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
pliny-1.2.0 spec/spec_helper.rb
pliny-1.1.0 spec/spec_helper.rb
pliny-1.0.0 spec/spec_helper.rb