Sha256: 062632671b085393d412fb58e5a6c733bc753059f090cd911529bddcea3d2a73

Contents?: true

Size: 1.23 KB

Versions: 5

Compression:

Stored size: 1.23 KB

Contents

require 'simplecov'
require 'simplecov-rcov'
require "codeclimate-test-reporter"

SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new(
  [
    SimpleCov::Formatter::HTMLFormatter,
    SimpleCov::Formatter::RcovFormatter,
    CodeClimate::TestReporter::Formatter
  ]
)

SimpleCov.start do
  add_filter 'test'
end

CodeClimate::TestReporter.start

require 'minitest/autorun'

# Rails 4.0.x pins to an old minitest
unless defined?(MiniTest::Test)
  MiniTest::Test = MiniTest::Unit::TestCase
end

require 'active_record'
require 'data_mapper'
require 'digest/sha2'
require 'sequel'

$:.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
$:.unshift(File.dirname(__FILE__))
require 'attr_encrypted'

DB = if defined?(RUBY_ENGINE) && RUBY_ENGINE.to_sym == :jruby
  Sequel.jdbc('jdbc:sqlite::memory:')
else
  Sequel.sqlite
end

# The :after_initialize hook was removed in Sequel 4.0
# and had been deprecated for a while before that:
# http://sequel.rubyforge.org/rdoc-plugins/classes/Sequel/Plugins/AfterInitialize.html
# This plugin re-enables it.
Sequel::Model.plugin :after_initialize

SECRET_KEY = SecureRandom.random_bytes(32)

def base64_encoding_regex
  /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=|[A-Za-z0-9+\/]{4})$/
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
attr_encrypted-3.0.3 test/test_helper.rb
attr_encrypted-3.0.2 test/test_helper.rb
attr_encrypted-3.0.1 test/test_helper.rb
attr_encrypted-3.0.0 test/test_helper.rb
attr_encrypted-2.0.0 test/test_helper.rb