Sha256: 20e84ac1c68a24d9754204181fd5607e63339536e40aec2fe57eb127e501ae12

Contents?: true

Size: 561 Bytes

Versions: 1

Compression:

Stored size: 561 Bytes

Contents

require 'test/unit'

class Rails3PgDeferredConstraintsTest < Test::Unit::TestCase

  def run_dummy_test
    book_test = File.expand_path(File.join(File.dirname(__FILE__), 'dummy', 'test', 'unit', 'book_test.rb'))
    %x{#{RbConfig.ruby} #{book_test} 2>&1}
  end


  def test_dummy_tests_fail_if_fix_not_loaded
    ENV['PG_DEFERRED_CONSTRAINTS'] = nil
    assert run_dummy_test =~ /RI_ConstraintTrigger_/
  end

  def test_dummy_tests_pass_if_fix_loaded
    ENV['PG_DEFERRED_CONSTRAINTS'] = 'true'
    assert run_dummy_test !~ /RI_ConstraintTrigger_/
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rails3_pg_deferred_constraints-0.1.0 test/rails3_pg_deferred_constraints_test.rb