Sha256: facf7e48cdd23411f8a1a4b73c248f58dc2ac70e625ef729612d5a1fb2271d14

Contents?: true

Size: 900 Bytes

Versions: 121

Compression:

Stored size: 900 Bytes

Contents

require 'test/unit'
require 'rubygems'
require 'action_controller'
require 'action_view/test_case'
require 'mocha'
begin
  require 'redgreen'
rescue LoadError
end

ENV['RAILS_ENV'] = 'test'
ENV['RAILS_ROOT'] ||= File.join(File.dirname(__FILE__), 'mock_app')

require File.expand_path(File.join(ENV['RAILS_ROOT'], 'config', 'environment.rb'))

def load_schema
  stdout = $stdout
  $stdout = StringIO.new # suppress output while building the schema
  load File.join(ENV['RAILS_ROOT'], 'db', 'schema.rb')
  $stdout = stdout
end

def silence_stderr(&block)
  stderr = $stderr
  $stderr = StringIO.new
  yield
  $stderr = stderr
end

for file in %w[model_stub const_mocker]
  require File.join(File.dirname(__FILE__), file)
end

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

Version data entries

121 entries across 121 versions & 6 rubygems

Version Path
active_scaffold_vho-4.0.0 test/test_helper.rb
active_scaffold_vho-3.2.14 test/test_helper.rb
active_scaffold_vho-3.2.13 test/test_helper.rb
active_scaffold-sequel-0.8.0 test/test_helper.rb
active_scaffold-sequel-0.7.1 test/test_helper.rb
active_scaffold_vho-3.2.12 test/test_helper.rb
active_scaffold_vho-3.2.11 test/test_helper.rb
active_scaffold_vho-3.2.10 test/test_helper.rb
active_scaffold_vho-3.2.9 test/test_helper.rb
active_scaffold_vho-3.2.8 test/test_helper.rb
active_scaffold_vho-3.2.7 test/test_helper.rb
active_scaffold_vho-3.2.6 test/test_helper.rb
active_scaffold_vho-3.2.5 test/test_helper.rb
active_scaffold_vho-3.2.4 test/test_helper.rb
active_scaffold_vho-3.2.3 test/test_helper.rb
active_scaffold_vho-3.2.2 test/test_helper.rb
active_scaffold_vho-3.2.1 test/test_helper.rb
active_scaffold-sequel-0.7.0 test/test_helper.rb
active_scaffold_vho-3.2.0 test/test_helper.rb
active_scaffold_vho-3.0.31 test/test_helper.rb