Permalink
Browse files

This reverts an earlier commit which had unintended side-effects and …

…provides a cleaner alternative.

With test/unit being required rails apps trying to run ./script/runner would also
attempt to erroneously run the test suite, and could result in failure of cron jobs
that used the script/runner and specified an environment to run in.

It is better instead to:

  include Test::Unit::ActsAsDeleted

in your test helper.

This reverts my earlier commit : 69910d8

Signed-off-by: Andy Hartford <hartforda@gmail.com>
  • Loading branch information...
1 parent dbea7e3 commit 925c11de2e981bdc8d961be242fd216952c5a412 @grempe grempe committed with ajh Apr 28, 2009
Showing with 5 additions and 2 deletions.
  1. +5 −0 README
  2. +0 −2 lib/unit_test_helper.rb
View
5 README
@@ -122,6 +122,11 @@ A model's soft delete capabilities can be easily unit tested by using this provi
assert_model_soft_deletes( items(:radar_detector) )
end
+Note : You may need to put the following in your test_helper.rb file if you see an error like 'NoMethodError: undefined method 'assert_model_soft_deletes'' when running your unit tests:
+
+ require 'test/unit'
+ include Test::Unit::ActsAsDeleted
+
This was developed with Test::Unit in mind. Not sure how well it works with rspec.
=== Thanks
View
2 lib/unit_test_helper.rb
@@ -1,5 +1,3 @@
-require 'test/unit'
-
module Test #:nodoc:
module Unit #:nodoc:
# This module is included into Test::Unit::TestCase and in that way is available in your test cases.

0 comments on commit 925c11d

Please sign in to comment.