[Ruby] ZenTest and Ruby on Rails

Eric Hodel drbrain at segment7.net
Wed Feb 7 12:23:35 PST 2007


On Feb 4, 2007, at 15:20, James Moore wrote:
> I've finally started using ZenTest on a Rails project.  Couple  
> questions -
>
> ** It produces suggested tests for the ActiveRecord has_one/many style
> methods - test_remove_blah_with_deprecation, etc.  Any elegant way to
> suppress these?  (Or am I being foolish, and the right way to  
> suppress these
> is to create actual tests?)
>
> ** Why does it do the def foo! <==> test_foo_bang conversion?  Why not
> test_foo!?  I'm wondering if I'm missing something about the use of
> punctuation in method names.  Is this esthetics, is there a Test::Unit
> restriction on things like exclamation points, or something else?  (My
> assumption is that test_foo! would imply that test_foo! would  
> change the
> test object itself, rather than just being a test.)

test_foo_bang, test_foo_eh, test_foo_equals allow you to add edge cases:

class TestString
   def test_sub_bang
   def test_sub_bang_no_changes



More information about the Ruby mailing list