Sha256: 63bf8a53ee7310a6c5068ecb198e11288922d2cee77dfca835b8a6fd53c67123

Contents?: true

Size: 1007 Bytes

Versions: 7

Compression:

Stored size: 1007 Bytes

Contents

require File.expand_path('../../lib/safe_cookies', __FILE__)
require 'timecop'

RSpec.configure do |config|
  config.treat_symbols_as_metadata_keys_with_true_values = true
  config.run_all_when_everything_filtered = true
  config.filter_run :focus

  # 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'
  
  config.before(:each) { SafeCookies.configure {} }
  config.after(:each) {
    SafeCookies.configuration = nil
    Timecop.return
  }
end

def stub_app_call(app, options = {})
  env = {}
  env['Set-Cookie'] = options[:application_cookies] if options[:application_cookies]
  app.stub :call => [ stub, env, stub ]
end

def set_request_cookies(env, *cookies)
  env['HTTP_COOKIE'] = cookies.join(',')
end

def extract_cookies(set_cookies_header)
  set_cookies_header.scan(/(?=^|\n)[^\n;]+=[^\n;]+(?=;\s)/i)
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
safe_cookies-0.2.2 spec/spec_helper.rb
safe_cookies-0.2.1 spec/spec_helper.rb
safe_cookies-0.2.0 spec/spec_helper.rb
safe_cookies-0.1.7 spec/spec_helper.rb
safe_cookies-0.1.6 spec/spec_helper.rb
safe_cookies-0.1.5 spec/spec_helper.rb
safe_cookies-0.1.4 spec/spec_helper.rb