Sha256: 05ec4c7bdc4a789e737c4f7a078008a9cbe1a7223a108f8d010daecb38ee6afe

Contents?: true

Size: 871 Bytes

Versions: 23

Compression:

Stored size: 871 Bytes

Contents

require 'rubygems'
require 'test/unit'
require 'active_record'

class << Test::Unit::TestCase
  def test(name, &block)
    test_name = :"test_#{name.gsub(' ','_')}"
    raise ArgumentError, "#{test_name} is already defined" if self.instance_methods.include? test_name.to_s
    if block
      define_method test_name, &block
    else
      puts "PENDING: #{name}"
    end
  end
end

class ActiveRecordTestCase < Test::Unit::TestCase
  def exec(sql)
    ActiveRecord::Base.connection.execute sql
  end

  def setup
    ActiveRecord::Base.establish_connection(
      :adapter => "sqlite3",
      :database  => ":memory:" #"tmp/test"
    )

    # eliminate ActiveRecord warning. TODO: delete as soon as ActiveRecord is fixed
    ActiveRecord::Base.connection.reconnect!
  end

  def teardown
    ActiveRecord::Base.connection.disconnect!
  end

  def default_test
  end
end

Version data entries

23 entries across 23 versions & 6 rubygems

Version Path
validating-workflow-0.7.12 test/test_helper.rb
validating-workflow-0.7.11 test/test_helper.rb
validating-workflow-0.7.10 test/test_helper.rb
validating-workflow-0.7.9 test/test_helper.rb
workflow-orchestrator-1.3.1 test/test_helper.rb
workflow-orchestrator-1.3.0 test/test_helper.rb
validating-workflow-0.7.7 test/test_helper.rb
workflow-1.2.0 test/test_helper.rb
validating-workflow-0.7.6 test/test_helper.rb
workflow-1.1.0 test/test_helper.rb
workflow-rails4-1.1.0 test/test_helper.rb
workflow-1.0.0 test/test_helper.rb
workflow-0.8.7 test/test_helper.rb
workflow-0.8.6 test/test_helper.rb
workflow-0.8.4 test/test_helper.rb
workflow-0.8.3 test/test_helper.rb
workflow-0.8.1 test/test_helper.rb
railsware-workflow-0.8.1 test/test_helper.rb
workflow-0.8.0 test/test_helper.rb
validating-workflow-0.7.2 test/test_helper.rb