Sha256: 014eb7ae8d9d640f1d47c4b648709d72b40c9db7b2c13b0ff438049a118176b3

Contents?: true

Size: 1.07 KB

Versions: 4

Compression:

Stored size: 1.07 KB

Contents

# frozen_string_literal: true

require "active_support"
require "minitest/autorun"
require "arel"

require_relative "support/fake_record"

Minitest::Expectation.class_eval do
  def must_be_like(other)
    self.class.new(target.gsub(/\s+/, " ").strip, ctx).must_equal other.gsub(/\s+/, " ").strip
  end
end

module Arel
  class Test < ActiveSupport::TestCase
    def setup
      super
      @arel_engine = Arel::Table.engine
      Arel::Table.engine = FakeRecord::Base.new
    end

    def teardown
      Arel::Table.engine = @arel_engine if defined? @arel_engine
      super
    end
  end

  class Spec < Minitest::Spec
    before do
      @arel_engine = Arel::Table.engine
      Arel::Table.engine = FakeRecord::Base.new
    end

    after do
      Arel::Table.engine = @arel_engine if defined? @arel_engine
    end
    include ActiveSupport::Testing::Assertions

    # test/unit backwards compatibility methods
    alias :assert_no_match :refute_match
    alias :assert_not_equal :refute_equal
    alias :assert_not_same :refute_same
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ibm_db-5.5.0-x86-mingw32 test/cases/arel/helper.rb
ibm_db-5.4.1-x86-mingw32 test/cases/arel/helper.rb
ibm_db-5.4.0-x86-mingw32 test/cases/arel/helper.rb
ibm_db-5.3.2-x86-mingw32 test/cases/arel/helper.rb