Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #11425 (closed enhancement: fixed)

Opened 5 months ago

Last modified 5 months ago

[PATCH] Fixes ActiveRecord tests so they can be run by hand

Reported by: thechrisoshow Assigned to: core
Priority: normal Milestone: 2.x
Component: ActiveRecord Version: edge
Severity: normal Keywords: tiny
Cc:

Description

In activerecord/RUNNING_UNIT_TESTS it reads:

Unit tests are located in test/cases directory. 
If you only want to run a single test suite, you can do so with:
   rake test_mysql TEST=test/cases/base_test.rb

But running that command doesn't work. The base_test.rb has some missing 'requires' that prevent this from running stand alone.

This patch addresses that - and also ensures that a few other ActiveRecord tests can be run by hand.

Attachments

fixes_for_active_record_test_run_by_hand.diff (2.2 kB) - added by thechrisoshow on 03/25/08 21:18:46.
Fixes for activerecord tests so that they can be run with rake test_mysql TEST=blah
more_fixes_for_active_record_test_run_by_hand.diff (4.4 kB) - added by h-lame on 03/28/08 11:16:32.
More fixes to missing fixtures.

Change History

03/25/08 21:18:46 changed by thechrisoshow

  • attachment fixes_for_active_record_test_run_by_hand.diff added.

Fixes for activerecord tests so that they can be run with rake test_mysql TEST=blah

03/25/08 21:20:29 changed by thechrisoshow

  • keywords set to tiny.

03/28/08 11:15:38 changed by h-lame

This is great work, but I'm suspicious of renaming a test to get it to run individually. I've taken a look and it seems that it was an artefact of fixture caching from other test cases. So I've renamed the test back and put in some self.use_transactional_fixtures = false statements in the necessary tests to clear it up.

As well as this change, I've augmented your patch with a couple of extra fixes to missing fixtures for more individual test joy.

03/28/08 11:16:32 changed by h-lame

  • attachment more_fixes_for_active_record_test_run_by_hand.diff added.

More fixes to missing fixtures.

03/28/08 11:55:04 changed by pratik

  • status changed from new to closed.
  • resolution set to fixed.

(In [9109]) Make sure ActiveRecord tests can run individually. Closes #11425 [thechrisoshow, h-lame]

03/28/08 20:21:24 changed by bitsweat

(In [9118]) Fix some mistaken dependencies among AR unit tests. Closes #11425 [thechrisoshow]