Sha256: bf773ce8b52a1e98c047b8c7d47c79ced693c6e7b6e1b3f70a8b8cee833bd35d

Contents?: true

Size: 1.22 KB

Versions: 3

Compression:

Stored size: 1.22 KB

Contents

require File.expand_path(File.dirname(__FILE__) + '/../lib/sidekiq/cobweb_helper')
require File.expand_path(File.dirname(__FILE__) + '/../lib/cobweb')
require File.expand_path(File.dirname(__FILE__) + '/../spec/samples/sample_server')
require File.expand_path(File.dirname(__FILE__) + '/../spec/http_stubs')
require 'mock_redis'

require 'coveralls'
Coveralls.wear!

# Sets up the environment as test so that exceptions are raised
ENVIRONMENT = "test"
APP_ROOT = File.expand_path(File.dirname(__FILE__) + '/../')

RSpec.configure do |config|

  if ENV["TRAVIS_RUBY_VERSION"] || ENV['CI']
    config.filter_run_excluding :local_only => true
  end

  THIN_INSTALLED = false
  if Gem::Specification.find_all_by_name("thin", ">=1.0.0").count >= 1
    require 'thin'
    THIN_INSTALLED = true
    Thread.new do
      @thin ||= Thin::Server.start("0.0.0.0", 3532, SampleServer.app)
    end
  end

  # WAIT FOR START TO COMPLETE
  sleep 1


  config.before(:all) {
    # START THIN SERVER TO HOST THE SAMPLE SITE FOR CRAWLING
  }

  config.before(:each) {

    @redis_mock_object = MockRedis.new
    Redis.stub(:new).and_return(@redis_mock_object)
    Redis::Namespace.stub(:new).and_return(@redis_mock_object)

    @redis_mock_object.flushdb

  }

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
cobweb-1.2.1 spec/spec_helper.rb
cobweb-1.2.0 spec/spec_helper.rb
cobweb-1.1.0 spec/spec_helper.rb