Sha256: cba3986a1a8c1c1dc23aec1635bb8f69dde889c41ffa20a2bba14c07bd8eb801

Contents?: true

Size: 1.13 KB

Versions: 11

Compression:

Stored size: 1.13 KB

Contents

# frozen_string_literal: true

SQLSERVER_HELPER = "test/cases/helper_sqlserver.rb"
SQLSERVER_COERCED = "test/cases/coerced_tests.rb"

def env_ar_test_files
  return unless ENV["TEST_FILES_AR"] && !ENV["TEST_FILES_AR"].empty?

  @env_ar_test_files ||= begin
    ENV["TEST_FILES_AR"].split(",").map { |file|
      File.join ARTest::SQLServer.root_activerecord, file.strip
    }.sort
  end
end

def env_test_files
  return unless ENV["TEST_FILES"] && !ENV["TEST_FILES"].empty?

  @env_test_files ||= ENV["TEST_FILES"].split(",").map(&:strip)
end

def sqlserver_cases
  @sqlserver_cases ||= Dir.glob("test/cases/*_test_sqlserver.rb")
end

def ar_cases
  @ar_cases ||= begin
    Dir.glob("#{ARTest::SQLServer.root_activerecord}/test/cases/**/*_test.rb").reject { |x| x =~ /\/adapters\// }.sort
  end
end

def test_files
  if env_ar_test_files
    [SQLSERVER_HELPER] + env_ar_test_files
  elsif env_test_files
    env_test_files
  elsif ENV["ONLY_SQLSERVER"]
    sqlserver_cases
  elsif ENV["ONLY_ACTIVERECORD"]
    [SQLSERVER_HELPER] + (ar_cases + [SQLSERVER_COERCED])
  else
    [SQLSERVER_HELPER] + (ar_cases + [SQLSERVER_COERCED] + sqlserver_cases)
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
activerecord-sqlserver-adapter-6.0.3 test/support/rake_helpers.rb
activerecord-sqlserver-adapter-6.1.3.0 test/support/rake_helpers.rb
activerecord-sqlserver-adapter-6.1.2.1 test/support/rake_helpers.rb
activerecord-sqlserver-adapter-6.1.2.0 test/support/rake_helpers.rb
activerecord-sqlserver-adapter-6.1.1.0 test/support/rake_helpers.rb
activerecord-sqlserver-adapter-6.1.0.0 test/support/rake_helpers.rb
activerecord-sqlserver-adapter-6.1.0.0.rc1 test/support/rake_helpers.rb
activerecord-sqlserver-adapter-6.0.2 test/support/rake_helpers.rb
activerecord-sqlserver-adapter-6.0.1 test/support/rake_helpers.rb
activerecord-sqlserver-adapter-6.0.0 test/support/rake_helpers.rb
activerecord-sqlserver-adapter-6.0.0.rc2 test/support/rake_helpers.rb