Sha256: ed4e192c3e9971c9f5b505ef16f18a880177b71803e05ec8f125688edc010475

Contents?: true

Size: 1.02 KB

Versions: 1

Compression:

Stored size: 1.02 KB

Contents

# frozen_string_literal: true

ENV["RACK_ENV"] = "test"

require "rubygems"
require "bundler/setup"

require "simplecov"
SimpleCov.start

require "split"
require "ostruct"
require "yaml"

Dir["./spec/support/*.rb"].each { |f| require f }

module GlobalSharedContext
  extend RSpec::SharedContext
  let(:mock_user) { Split::User.new(double(session: {})) }

  before(:each) do
    Split.configuration = Split::Configuration.new
    Split.redis = Redis.new
    Split.redis.select(10)
    Split.redis.flushdb
    Split::Cache.clear
    @ab_user = mock_user
    @params = nil
  end
end

RSpec.configure do |config|
  config.order = "random"
  config.include GlobalSharedContext
  config.raise_errors_for_deprecations!
end

def session
  @session ||= {}
end

def params
  @params ||= {}
end

def request(ua = "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_6; de-de) AppleWebKit/533.20.25 (KHTML, like Gecko) Version/5.0.4 Safari/533.20.27")
  @request ||= begin
    r = OpenStruct.new
    r.user_agent = ua
    r.ip = "192.168.1.1"
    r
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
split-4.0.2 spec/spec_helper.rb