Sha256: b62848440d652329056f65c9088552efc2d1f39bf2670b8362e788ec75817934

Contents?: true

Size: 1.25 KB

Versions: 35

Compression:

Stored size: 1.25 KB

Contents

require File.join(File.dirname(__FILE__), '..', 'lib', 'firefly.rb')

require 'rubygems'
require "bundler/setup"

require 'sinatra'
require 'rack/test'
require 'yaml'
require 'database_cleaner'

# set test environment
set :environment, :test
set :run, false
set :raise_errors, true
set :logging, false

@@app = Firefly::Server.new do
  set :hostname,        "test.host"
  set :api_key,         "test"
  set :database,        "sqlite3::memory:"

  set :sharing_key,     "asdfasdf"
  set :sharing_targets, [:twitter, :hyves, :facebook]
  set :sharing_domains, ["example.com", "example.net"]
end

RSpec.configure do |config|

  config.before(:suite) do
    DatabaseCleaner.strategy = :truncation
    DatabaseCleaner.clean_with(:truncation)
    Firefly::CodeFactory.create(:count => 0)
  end

  config.before(:each) do
    DatabaseCleaner.start
  end

  config.after(:each) do
    DatabaseCleaner.clean
    Firefly::CodeFactory.create(:count => 0)
  end

  # Loads the urls.yml fixtures.
  def load_fixtures
    Firefly::Url.destroy
    urls = YAML::load(File.open('spec/fixtures/urls.yml'))
    urls.each { |key, url| Firefly::Url.create(url) }
  end

  # Load a spec file and return its contents
  def spec_file(filename)
    File.open('spec/files/'+filename) { |f| f.read }
  end
end

Version data entries

35 entries across 35 versions & 4 rubygems

Version Path
tmin-0.2.6 spec/spec_helper.rb
tmin-0.2.5 spec/spec_helper.rb
tmin-0.2.4 spec/spec_helper.rb
tmin-0.2.3 spec/spec_helper.rb
tmin-0.2.2 spec/spec_helper.rb
tmin-0.2.1 spec/spec_helper.rb
tmin-0.2.0 spec/spec_helper.rb
tmin-0.1.9 spec/spec_helper.rb
tmin-0.1.8 spec/spec_helper.rb
tmin-0.1.7 spec/spec_helper.rb
tmin-0.1.6 spec/spec_helper.rb
tmin_test-0.0.5 spec/spec_helper.rb
tmin_test-0.0.4 spec/spec_helper.rb
tmin_test-0.0.3 spec/spec_helper.rb
tmin_test-0.0.2 spec/spec_helper.rb
tmin_test-0.0.1 spec/spec_helper.rb
tmin-0.1.5 spec/spec_helper.rb
tmin-0.1.4 spec/spec_helper.rb
tmin-0.1.3 spec/spec_helper.rb
tmin-0.1.2 spec/spec_helper.rb