I have just encountered a funny situation. I have a number of functional and unit cases that are all written with the notation: def ---- #test case end I just created a new model and controller with test cases written in a similar format. When I run the test cases, no test are actually run (i see, "0 tests, 0 assertions, 0 failures, 0 errors"). If I convert to the format: test "----" do end It works. All my old test cases work as expected. As far as I can tell everything is set up the same way. Any idea why this might be happening?
Jeffrey L. Taylor
2009-Sep-24 16:28 UTC
Re: Testing: ''test "..." do'' works but not ''def test...''
Quoting drewB <dbatshaw-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:> > I have just encountered a funny situation. I have a number of > functional and unit cases that are all written with the notation: > > def ---- > > #test case > > end > > I just created a new model and controller with test cases written in a > similar format. When I run the test cases, no test are actually run > (i see, "0 tests, 0 assertions, 0 failures, 0 errors"). If I convert > to the format: > > test "----" do > > end >Just to clarify, the first case is actually def test_--- #test case end Methods with the "test_" prefix are run, others are assumed to be supporting code. Jeffrey
That was it. I didn''t know you had to start with "test." Thanks so much! On Sep 24, 9:28 am, "Jeffrey L. Taylor" <r...-f/t7CGFWhwGcvWdFBKKxig@public.gmane.org> wrote:> Quoting drewB <dbats...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>: > > > > > I have just encountered a funny situation. I have a number of > > functional and unit cases that are all written with the notation: > > > def ---- > > > #test case > > > end > > > I just created a new model and controller with test cases written in a > > similar format. When I run the test cases, no test are actually run > > (i see, "0 tests, 0 assertions, 0 failures, 0 errors"). If I convert > > to the format: > > > test "----" do > > > end > > Just to clarify, the first case is actually > > def test_--- > #test case > end > > Methods with the "test_" prefix are run, others are assumed to be supporting > code. > > Jeffrey