Sha256: c27c4db2a07923ec5802a80ad7b059e76624eca23c665031ac285c9540a428f0

Contents?: true

Size: 1.59 KB

Versions: 20

Compression:

Stored size: 1.59 KB

Contents

require 'simplecov' if ENV['COVERAGE']

ENV['RAILS_ENV'] = 'test'
require 'mock_app/config/environment'
require 'rails/test_help'
require 'minitest/autorun'
require 'mocha/minitest'
require 'cow_proxy'

require 'minitest/reporters'
Minitest::Reporters.use!

def load_schema
  stdout = $stdout
  $stdout = StringIO.new # suppress output while building the schema
  load Rails.root.join('db', 'schema.rb')
  $stdout = stdout
end
load_schema

ActiveScaffold.threadsafe!
# avoid freezing defaults so we can stubs in tests for testing with different defaults
class << ActiveScaffold::Config::Core
  def freeze; end
end

%w[model_stub const_mocker company].each do |file|
  require File.join(File.dirname(__FILE__), file)
end

I18n.backend.store_translations :en, YAML.load_file(File.expand_path('../config/locales/en.yml', __dir__))['en']

# rails 4.0
unless defined? Minitest::Test
  class Minitest::Test < MiniTest::Unit::TestCase
  end

  class MiniTest::Unit::TestCase
    def with_js_framework(framework)
      framework, ActiveScaffold.js_framework = ActiveScaffold.js_framework, framework
      yield
      ActiveScaffold.js_framework = framework
    end
  end
end

class MiniTest::Test
  protected

  def with_js_framework(framework)
    framework, ActiveScaffold.js_framework = ActiveScaffold.js_framework, framework
    yield
    ActiveScaffold.js_framework = framework
  end

  def config_for(klass, namespace = nil)
    ActiveScaffold::Config::Core.new("#{namespace}#{klass.to_s.underscore.downcase}")
  end
end

Config = RbConfig # HACK: needed some comments

class ColumnMock < ActiveScaffold::Tableless::Column
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
active_scaffold-3.6.20 test/test_helper.rb
active_scaffold-3.6.19 test/test_helper.rb
active_scaffold-3.6.17 test/test_helper.rb
active_scaffold-3.6.15 test/test_helper.rb
active_scaffold-3.6.14 test/test_helper.rb
active_scaffold-3.6.13 test/test_helper.rb
active_scaffold-3.6.12 test/test_helper.rb
active_scaffold-3.6.11.1 test/test_helper.rb
active_scaffold-3.6.11 test/test_helper.rb
active_scaffold-3.6.10 test/test_helper.rb
active_scaffold-3.6.9 test/test_helper.rb
active_scaffold-3.6.8 test/test_helper.rb
active_scaffold-3.6.6 test/test_helper.rb
active_scaffold-3.6.5 test/test_helper.rb
active_scaffold-3.6.4.1 test/test_helper.rb
active_scaffold-3.6.4 test/test_helper.rb
active_scaffold-3.6.3 test/test_helper.rb
active_scaffold-3.6.2 test/test_helper.rb
active_scaffold-3.6.1 test/test_helper.rb
active_scaffold-3.6.0 test/test_helper.rb