Commit Graph

59 Commits

Author SHA1 Message Date
Brad Price
0a5b41c4c0 Check that entire collection has been loaded before short circuiting
Currently, when checking that the collection has been loaded, only the first
record is checked. In specific scenarios, if a record is fetched via an `after_initialize`
hook, there is a chance that the first record has been loaded, but other records in the
collection have not.

In order to successfully short circuit the fetching of data, we need to verify that
all of the records in the collection have been loaded.

* Create test for edge case
* Move `reset_callbacks` method to `cases/helper`, since it has been defined in multiple
  locations.

Closes #37730
2019-11-19 15:32:36 -06:00
Gannon McGibbon
74201c3885 Make has_many inversing opt-in
Make has_many inversing support available through an opt-in config
variable. This behaviour is likely to break existing applications, but
it is correct behaviour.
2019-10-11 15:55:46 -04:00
yuuji.yaginuma
43add6fb2c Partially revert 4a9ef5e1202cdab1882989eb561b0dc854c9891b
This broke CI. https://buildkite.com/rails/rails/builds/63708
2019-09-17 09:15:35 +09:00
Akira Matsuda
4a9ef5e120 Use Regext#match? where MatchData is not needed 2019-09-17 07:59:04 +09:00
Rafael Mendonça França
967beb7229
Revert "MethodCallAssertions is a regular player of the team ActiveSupport::TestCase now"
This reverts commit 98d0f7ebd34b858f12a12dcf37ae54fdbb5cab64.
2019-08-02 00:24:21 -04:00
Akira Matsuda
98d0f7ebd3 MethodCallAssertions is a regular player of the team ActiveSupport::TestCase now
It's used everywhere, clean and mature enough
2019-08-02 05:36:15 +09:00
Ryuta Kamizono
0810c076de Except SCHEMA SQLs in capture_sql
Testing the result of `capture_sql` is fragile, it is due to whether
SCHEMA SQLs are executed or not depends on whether schema cache is
filled or not.

https://buildkite.com/rails/rails/builds/61248#a5b9dc59-ff0c-40c0-b56e-0895662fbc4c/993-1004
https://buildkite.com/rails/rails/builds/61248#1157b389-f2c7-4554-b6e5-a37624a0e74a/996-1005

I've confirmed all `capture_sql` use cases in our code base, all cases
won't expect SCHEMA SQLs are included.

```
% git grep -n capture_sql
test/cases/associations/belongs_to_associations_test.rb:202:    sql = capture_sql { comment.post }
test/cases/associations/belongs_to_associations_test.rb:204:    assert_not_equal sql, capture_sql { comment.post }
test/cases/associations/has_many_associations_test.rb:169:    sql = capture_sql { post.comments.to_a }
test/cases/associations/has_many_associations_test.rb:171:    assert_not_equal sql, capture_sql { post.comments.to_a }
test/cases/associations/has_many_associations_test.rb:276:    expected_sql = capture_sql { author.thinking_posts.delete_all }
test/cases/associations/has_many_associations_test.rb:281:    loaded_sql = capture_sql { author.thinking_posts.delete_all }
test/cases/associations/has_many_associations_test.rb:289:    expected_sql = capture_sql { author.posts.delete_all }
test/cases/associations/has_many_associations_test.rb:294:    loaded_sql = capture_sql { author.posts.delete_all }
test/cases/associations/left_outer_join_association_test.rb:22:      queries = capture_sql do
test/cases/associations/left_outer_join_association_test.rb:49:    queries = capture_sql { Author.left_outer_joins(:posts).to_a }
test/cases/associations/left_outer_join_association_test.rb:54:    queries = capture_sql { Author.joins(:posts).left_outer_joins(:posts).to_a }
test/cases/associations/left_outer_join_association_test.rb:60:    queries = capture_sql { Author.left_outer_joins({}).to_a }
test/cases/associations/left_outer_join_association_test.rb:65:    queries = capture_sql { Author.left_outer_joins([]).to_a }
test/cases/associations/left_outer_join_association_test.rb:78:    queries = capture_sql { Author.left_outer_joins(:essays).to_a }
test/cases/associations_test.rb:384:    log = capture_sql do
test/cases/associations_test.rb:399:    log = capture_sql do
test/cases/associations_test.rb:414:    log = capture_sql do
test/cases/associations_test.rb:429:    log = capture_sql do
test/cases/associations_test.rb:444:    log = capture_sql do
test/cases/associations_test.rb:459:    log = capture_sql do
test/cases/reflection_test.rb:307:    expected_sql = capture_sql { hotel.recipes.to_a }
test/cases/reflection_test.rb:312:    loaded_sql = capture_sql { hotel.recipes.to_a }
test/cases/relation_test.rb:212:      queries = capture_sql { Author.joins(:posts).merge(Post.joins(:comments)).to_a }
test/cases/relation_test.rb:232:      queries = capture_sql { Post.joins(:author, :categorizations).merge(Author.select(:id)).merge(categorizations_with_authors).to_a }
test/cases/relation_test.rb:347:      log = capture_sql do
test/cases/scoping/relation_scoping_test.rb:146:      log = capture_sql do
test/cases/scoping/relation_scoping_test.rb:159:    log = capture_sql do
test/cases/test_case.rb:33:    def capture_sql
test/cases/test_case.rb:41:      capture_sql { yield }
```
2019-05-21 23:25:14 +09:00
Yasuo Honda
6a32e8aa72 Remove ignored_sql from SQLCounter by adding "TRANSACTION" to log name
This commit adds "TRANSACTION" to savepoint and commit, rollback statements
because none of savepoint statements were removed by #36153 since they are not "SCHEMA" statements.

Although, only savepoint statements can be labeled as "TRANSACTION"
I think all of transaction related method should add this label.

Follow up #36153
2019-05-08 00:21:31 +09:00
Yasuo Honda
6030110f56 Remove database specific sql statements from SQLCounter
Every database executes different type of sql statement to get metadata then `ActiveRecord::TestCase` ignores these database specific sql statements to make `assert_queries` or `assert_no_queries` work consistently.

Connection adapter already labels these statement by setting "SCHEMA" argument, this pull request makes use of "SCHEMA" argument to ignore metadata queries.

Here are the details of these changes:

* PostgresqlConnectionTest

Each of PostgresqlConnectionTest modified just executes corresponding methods

fef174f5c5/activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb (L182-L195)

```ruby
        # Returns the current database encoding format.
        def encoding
          query_value("SELECT pg_encoding_to_char(encoding) FROM pg_database WHERE datname = current_database()", "SCHEMA")
        end

        # Returns the current database collation.
        def collation
          query_value("SELECT datcollate FROM pg_database WHERE datname = current_database()", "SCHEMA")
        end

        # Returns the current database ctype.
        def ctype
          query_value("SELECT datctype FROM pg_database WHERE datname = current_database()", "SCHEMA")
        end
```

* BulkAlterTableMigrationsTest

mysql2 adapter executes `SHOW KEYS FROM ...` to see if there is an index already created as below. I think the main concerns of these tests are how each database adapter creates or drops indexes then ignoring  `SHOW KEYS FROM` statement makes sense.

fef174f5c5/activerecord/lib/active_record/connection_adapters/mysql/schema_statements.rb (L11)

```ruby
          execute_and_free("SHOW KEYS FROM #{quote_table_name(table_name)}", "SCHEMA") do |result|
```

* Temporary change not included in this commit to show which statements executed

```diff
$ git diff
diff --git a/activerecord/test/cases/migration_test.rb b/activerecord/test/cases/migration_test.rb
index 8e8ed494d9..df05f9bd16 100644
--- a/activerecord/test/cases/migration_test.rb
+++ b/activerecord/test/cases/migration_test.rb
@@ -854,7 +854,7 @@ def test_adding_indexes

       classname = ActiveRecord::Base.connection.class.name[/[^:]*$/]
       expected_query_count = {
-        "Mysql2Adapter"     => 3, # Adding an index fires a query every time to check if an index already exists or not
+        "Mysql2Adapter"     => 1, # Adding an index fires a query every time to check if an index already exists or not
         "PostgreSQLAdapter" => 2,
       }.fetch(classname) {
         raise "need an expected query count for #{classname}"
@@ -886,7 +886,7 @@ def test_removing_index

       classname = ActiveRecord::Base.connection.class.name[/[^:]*$/]
       expected_query_count = {
-        "Mysql2Adapter"     => 3, # Adding an index fires a query every time to check if an index already exists or not
+        "Mysql2Adapter"     => 1, # Adding an index fires a query every time to check if an index already exists or not
         "PostgreSQLAdapter" => 2,
       }.fetch(classname) {
         raise "need an expected query count for #{classname}"
$
```

* Executed these modified tests

```ruby
$ ARCONN=mysql2 bin/test test/cases/migration_test.rb -n /index/
Using mysql2
Run options: -n /index/ --seed 8462

F

Failure:
BulkAlterTableMigrationsTest#test_adding_indexes [/home/yahonda/git/rails/activerecord/test/cases/migration_test.rb:863]:
3 instead of 1 queries were executed.
Queries:
SHOW KEYS FROM `delete_me`
SHOW KEYS FROM `delete_me`
ALTER TABLE `delete_me` ADD UNIQUE INDEX `awesome_username_index`  (`username`), ADD  INDEX `index_delete_me_on_name_and_age`  (`name`, `age`).
Expected: 1
  Actual: 3

bin/test test/cases/migration_test.rb:848

F

Failure:
BulkAlterTableMigrationsTest#test_removing_index [/home/yahonda/git/rails/activerecord/test/cases/migration_test.rb:895]:
3 instead of 1 queries were executed.
Queries:
SHOW KEYS FROM `delete_me`
SHOW KEYS FROM `delete_me`
ALTER TABLE `delete_me` DROP INDEX `index_delete_me_on_name`, ADD UNIQUE INDEX `new_name_index`  (`name`).
Expected: 1
  Actual: 3

bin/test test/cases/migration_test.rb:879

..

Finished in 0.379245s, 10.5473 runs/s, 7.9105 assertions/s.
4 runs, 3 assertions, 2 failures, 0 errors, 0 skips
$
```

* ActiveRecord::ConnectionAdapters::Savepoints

Left `self.ignored_sql` to ignore savepoint related statements because these SQL statements are not related "SCHEMA"

```
self.ignored_sql = [/^SAVEPOINT/, /^ROLLBACK TO SAVEPOINT/, /^RELEASE SAVEPOINT/]
```

fef174f5c5/activerecord/lib/active_record/connection_adapters/abstract/savepoints.rb (L10-L20)

```ruby
      def create_savepoint(name = current_savepoint_name)
        execute("SAVEPOINT #{name}")
      end

      def exec_rollback_to_savepoint(name = current_savepoint_name)
        execute("ROLLBACK TO SAVEPOINT #{name}")
      end

      def release_savepoint(name = current_savepoint_name)
        execute("RELEASE SAVEPOINT #{name}")
      end
```
2019-05-01 13:30:11 +00:00
Yasuo Honda
05781f1f9c No need to handle if FrozenError is available
Rails 6 requires Ruby 2.5, which introduces `FrozenError`
https://docs.ruby-lang.org/en/2.5.0/NEWS.html

Related to #31520
2018-12-23 13:26:20 +00:00
Eugene Kenny
0ac81ee6ff Omit BEGIN/COMMIT statements for empty transactions
If a transaction is opened and closed without any queries being run, we
can safely omit the `BEGIN` and `COMMIT` statements, as they only exist
to modify the connection's behaviour inside the transaction. This
removes the overhead of those statements when saving a record with no
changes, which makes workarounds like `save if changed?` unnecessary.

This implementation buffers transactions inside the transaction manager
and materializes them the next time the connection is used. For this to
work, the adapter needs to guard all connection use with a call to
`materialize_transactions`. Because of this, adapters must opt in to get
this new behaviour by implementing `supports_lazy_transactions?`.

If `raw_connection` is used to get a reference to the underlying
database connection, the behaviour is disabled and transactions are
opened eagerly, as we can't know how the connection will be used.
However when the connection is checked back into the pool, we can assume
that the application won't use the reference again and reenable lazy
transactions. This prevents a single `raw_connection` call from
disabling lazy transactions for the lifetime of the connection.
2018-08-13 16:51:54 +01:00
Ryuta Kamizono
ac2bc00482 require "active_support/test_case" is not supported since 53e877f7
It will cause "undefined method `test_order' for ActiveSupport:Module
(NoMethodError)".

https://travis-ci.org/rails/rails/jobs/373472604#L1208
2018-05-02 01:10:33 +09:00
Matthew Draper
7098f28853
Merge pull request #31331 from dinahshi/postgresql_bulk_update
Add bulk alter support for PostgreSQL
2018-01-03 13:15:07 +10:30
Yasuo Honda
01efbc128d Handle FrozenError if it is available
This pull request handles `FrozenError` introduced by Ruby 2.5.
Refer https://bugs.ruby-lang.org/projects/ruby-trunk/repository/revisions/61131

Since `FrozenError` is a subclass of `RuntimeError` minitest used by master
branch can handle it, though it would be better to handle `FrozenError`
explicitly if possible.

`FrozenError` does not exist in Ruby 2.4 or lower, `frozen_error_class`
handles which exception is expected to be raised.

This pull request is intended to be merged to master,
then backported to `5-1-stable` to address #31508
2017-12-20 11:52:01 +00:00
Dinah Shi
8dd4868cc1 Add bulk alter support for PostgreSQL 2017-12-06 18:09:24 +08:00
Yasuo Honda
82e973dfd5 Address incorrect number of queries executed at Oracle enhanced adapter
This pull request addresses these 17 failures when tested with Oracle enhanced adapter.
All of these failures are due to the incorrect number of queries. Here is the first one.

```ruby
$ ARCONN=oracle bin/test test/cases/nested_attributes_test.rb:1086
Using oracle
Run options: --seed 27985

F

Finished in 0.874514s, 1.1435 runs/s, 1.1435 assertions/s.

  1) Failure:
TestHasManyAutosaveAssociationWhichItselfHasAutosaveAssociations#test_circular_references_do_not_perform_unnecessary_queries [/home/yahonda/git/rails/activerecord/test/cases/nested_attributes_test.rb:1086]:
6 instead of 3 queries were executed.
Queries:
select us.sequence_name from all_sequences us where us.sequence_owner = :owner and us.sequence_name = :sequence_name
INSERT INTO "SHIPS" ("NAME", "ID") VALUES (:a1, :a2)
select us.sequence_name from all_sequences us where us.sequence_owner = :owner and us.sequence_name = :sequence_name
INSERT INTO "SHIP_PARTS" ("NAME", "SHIP_ID", "UPDATED_AT", "ID") VALUES (:a1, :a2, :a3, :a4)
select us.sequence_name from all_sequences us where us.sequence_owner = :owner and us.sequence_name = :sequence_name
INSERT INTO "TREASURES" ("LOOTER_ID", "LOOTER_TYPE", "SHIP_ID", "ID") VALUES (:a1, :a2, :a3, :a4).
Expected: 3
  Actual: 6

1 runs, 1 assertions, 1 failures, 0 errors, 0 skips
$
```

Since https://github.com/rsim/oracle-enhanced/pull/1490 Oracle enhanced adapter drops its own schema caching called OracleEnhancedAdapter.cache_columns` to use Rails scehema cache
generated by `db:schema:cache:dump`.

By this change some extra sql statements executed at ActiveRecord unit test, which can be
fixed by adding the sql statement to `oracle_ignored`.

* All 17 failures fixed by this pull request:
```ruby
ARCONN=oracle bin/test test/cases/nested_attributes_test.rb:1086
ARCONN=oracle bin/test test/cases/locking_test.rb:308
ARCONN=oracle bin/test test/cases/locking_test.rb:365
ARCONN=oracle bin/test test/cases/dirty_test.rb:351
ARCONN=oracle bin/test test/cases/dirty_test.rb:334
ARCONN=oracle bin/test test/cases/autosave_association_test.rb:192
ARCONN=oracle bin/test test/cases/associations/has_many_associations_test.rb:950
ARCONN=oracle bin/test test/cases/associations/has_many_associations_test.rb:1059
ARCONN=oracle bin/test test/cases/autosave_association_test.rb:627
ARCONN=oracle bin/test test/cases/autosave_association_test.rb:607
ARCONN=oracle bin/test test/cases/autosave_association_test.rb:617
ARCONN=oracle bin/test test/cases/autosave_association_test.rb:641
ARCONN=oracle bin/test test/cases/associations/has_many_through_associations_test.rb:546
ARCONN=oracle bin/test test/cases/associations/has_many_through_associations_test.rb:297
ARCONN=oracle bin/test test/cases/associations/has_many_through_associations_test.rb:586
ARCONN=oracle bin/test test/cases/associations/has_many_through_associations_test.rb:172
ARCONN=oracle bin/test test/cases/associations/has_many_through_associations_test.rb:269
```
2017-10-31 19:53:40 +00:00
Rafael França
15ef55efb5 Merge pull request #29732 from kirs/frozen-activerecord
Use frozen-string-literal in ActiveRecord
2017-07-21 14:36:30 -04:00
Sean Griffin
93c9a95e01 Revert "Extract bind_param and bind_attribute into ActiveRecord::TestCase"
This reverts commit b6ad4052d18e4b29b8a092526c2beef013e2bf4f.

This is not something that the majority of Active Record should be
testing or care about. We should look at having fewer places rely on
these details, not make it easier to rely on them.
2017-07-21 14:01:08 -04:00
Kir Shatrov
831be98f9a Use frozen-string-literal in ActiveRecord 2017-07-19 22:27:07 +03:00
Matthew Draper
87b3e226d6 Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"
This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing
changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
2017-07-02 02:15:17 +09:30
Kir Shatrov
cfade1ec7e Enforce frozen string in Rubocop 2017-07-01 02:11:03 +03:00
Ryuta Kamizono
b6ad4052d1 Extract bind_param and bind_attribute into ActiveRecord::TestCase
These are used in tests from anywhere.
2017-05-04 03:25:10 +09:00
Rafael Mendonça França
fe1f4b2ad5
Add more rubocop rules about whitespaces 2016-10-29 01:17:49 -02:00
Xavier Noria
56832e791f let Regexp#match? be globally available
Regexp#match? should be considered to be part of the Ruby core library. We are
emulating it for < 2.4, but not having to require the extension is part of the
illusion of the emulation.
2016-10-27 09:13:55 +02:00
Jean Boussier
84d35da86c Preserve cached queries name in AS notifications 2016-09-22 15:30:45 +02:00
Rafael Mendonça França
55f9b8129a
Add three new rubocop rules
Style/SpaceBeforeBlockBraces
Style/SpaceInsideBlockBraces
Style/SpaceInsideHashLiteralBraces

Fix all violations in the repository.
2016-08-16 04:30:11 -03:00
Ryuta Kamizono
407e43866e Consolidate ActiveRecord::TestCase and ActiveSupport::TestCase in AR test cases 2016-08-14 04:34:35 +09:00
Xavier Noria
a9dc45459a code gardening: removes redundant selfs
A few have been left for aesthetic reasons, but have made a pass
and removed most of them.

Note that if the method `foo` returns an array, `foo << 1`
is a regular push, nothing to do with assignments, so
no self required.
2016-08-08 01:12:38 +02:00
Xavier Noria
9617db2078 applies new string literal convention in activerecord/test
The current code base is not uniform. After some discussion,
we have chosen to go with double quotes by default.
2016-08-06 18:26:53 +02:00
Xavier Noria
95b2a6abc7 adds missing requires 2016-07-24 21:29:29 +02:00
Xavier Noria
99cf755800 systematic revision of =~ usage in AR
Where appropriatei, prefer the more concise Regexp#match?,
String#include?, String#start_with?, or String#end_with?
2016-07-23 20:22:20 +02:00
Ryuta Kamizono
4e545d0e43 Remove unnecessary assert_date_from_db
`assert_date_from_db` was added at 6a2104d for SQL Server.
But latest sqlserver adapter work to pass expected behavior since
8e4624b.
2016-06-12 20:54:03 +09:00
Abdelkader Boudih
fb24d0ed6c Remove legacy mysql adapter 2015-12-17 15:54:57 +00:00
Ryuta Kamizono
edfb738b9c Remove #tables extra args again
This issue was resolved by #21687 already. But re-add args by #18856.
`#tables` extra args was only using by `#table_exists?`. This is for
internal API. This commit will remove these extra args again.
2015-10-22 13:16:35 +09:00
Sean Griffin
3e29d96ecd Fix test failures caused by d99db6b8b3e4
I messed up the merge conflict, and accidentally removed a schema query
that needed to be ignored.
2015-10-20 14:54:22 -06:00
Sean Griffin
4c42c89b04 Fix merge conflicts for #18856 2015-10-20 14:39:24 -06:00
Ryuta Kamizono
e29f02e1bd Refactor table_exists? in AbstractMysqlAdapter
`table_exists?` calls `tables` twice when passed `'dbname.tblname'` arg.
This change is that `table_exists?` execute only once query always and
extra args of `tables` is removed.
2015-09-20 14:46:35 +09:00
Ryuta Kamizono
ab12859947 Correctly dump composite primary key
Example:

    create_table :barcodes, primary_key: ["region", "code"] do |t|
      t.string :region
      t.integer :code
    end
2015-09-20 06:43:00 +09:00
Yves Senn
81ae632d08 make it possible to run AR tests with bin/test 2015-06-11 14:12:16 +02:00
Akshay Vishnoi
3932912a59 Add collation support for string and text columns in SQLite3 2015-05-28 08:40:40 +05:30
Matt Jones
1a836b21b9 Match table names exactly on MySQL
The `SHOW TABLES LIKE` command accepts metacharacters `%` and `_` in
potentially unexpected ways. This can be avoided by querying `information_schema.tables`
directly.

Fixes #17897
2015-02-08 19:06:52 -05:00
Vipul A M
166ce95f65 - Extracted silence_stream method to new module in activesupport/testing.
- Added include for the same in ActiveSupport::Test.
- Removed occurrences of silence_stream being used elsewhere.
- Reordered activesupport testcase requires alphabetically.

- Removed require of silence stream from test_case

- Moved quietly method to stream helper

- Moved capture output to stream helper module and setup requires for the same elsewhere
2015-01-20 22:28:48 +05:30
Erik Michaels-Ober
d1374f99bf Pass symbol as an argument instead of a block 2014-11-29 11:53:24 +01:00
Akira Matsuda
9ea80288f6 Ignore Postgresql "SELECT tablename FROM pg_tables" when counting queries 2014-08-20 17:50:11 +09:00
Akira Matsuda
c8ede23537 Ignore MySQL "SHOW VARIABLES" when counting queries 2014-08-15 02:44:57 +09:00
Yves Senn
2f93aa0d2b we intend to keep the capture helper for Active Record tests.
This is a follow up to f8f5cdc
2014-07-16 16:15:16 +02:00
Yves Senn
f8f5cdc98c Active Record tests still depend on capture. Let's keep it for now.
This is a follow-up to 3121412

/cc @rafaelfranca

This will remove deprecation warnings from the PostgreSQL suite:

```
DEPRECATION WARNING: #capture(stream) is deprecated and will be removed in the next release. (called from capture at /Users/senny/Projects/rails/activesupport/lib/active_support/core_ext/kernel/reporting.rb:89)
/Users/senny/Projects/rails/activesupport/lib/active_support/core_ext/kernel/reporting.rb:89:in `capture'
  /Users/senny/Projects/rails/activerecord/test/cases/adapters/postgresql/composite_test.rb:73:in `ensure_warning_is_issued'
  /Users/senny/Projects/rails/activerecord/test/cases/adapters/postgresql/composite_test.rb:48:in `test_column'
  /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest/test.rb:106:in `block (3 levels) in run'
  /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest/test.rb:204:in `capture_exceptions'
  /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest/test.rb:103:in `block (2 levels) in run'
  /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest/test.rb:256:in `time_it'
  /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest/test.rb:102:in `block in run'
  /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest.rb:317:in `on_signal'
  /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest/test.rb:276:in `with_info_handler'
  /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest/test.rb:101:in `run'
  /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest.rb:759:in `run_one_method'
  /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest.rb:293:in `run_one_method'
  /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest.rb:287:in `block (2 levels) in run'
  /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest.rb:286:in `each'
  /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest.rb:286:in `block in run'
  /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest.rb:317:in `on_signal'
  /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest.rb:306:in `with_info_handler'
  /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest.rb:285:in `run'
  /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest.rb:149:in `block in __run'
  /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest.rb:149:in `map'
  /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest.rb:149:in `__run'
  /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest.rb:126:in `run'
  /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest.rb:55:in `block in autorun'
```
2014-07-16 14:46:19 +02:00
Sean Griffin
8df8334327 Remove dead test code for unsupported adapters 2014-05-17 13:24:25 -06:00
eileencodes
49e17431ca refactor assert_sql query to reuse capture_sql
set assert_sql to reuse the capture_sql method from above
instead of repeating the code

in response to comments on issue #14546
2014-03-31 22:56:39 -04:00
eileencodes
a67293638e add capture_sql method to compare sql statements and compare
Other methods compare specific patterns, this method outputs
the actual sql query that is generated.
2014-03-31 19:28:44 -04:00