[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

ZenTest/autotest - Problem with controller modules?

Joe Ruby

10/10/2006 12:35:00 AM

Using rake, my tests all passed. And using autotest they all passed,
until I implemented this test:

def test_vote
count = Item.find(1).vote_count

get :vote, :id=>1, :vote=>5

@item = Item.find(1)

assert_equal @item.vote_count, count+1
assert_equal @item.vote_average, 5
assert_equal @item.vote_total, 1
assert_redirected_to item_url(:action=>:show, :id=>1)
end

Now, autotest displays this:

multiple files matched class ItemsControllerTest
["test/functional/members/items_controller_test.rb",
"test/functional/items_controller_test.rb",
"test/functional/admin/items_controller_test.rb"].
/opt/local/bin/ruby -I.:lib:test -rtest/unit -e
"%w[test/functional/items_controller_test.rb].each { |f| load f }" |
unit_diff -u
Loaded suite -e
Started
...F
Finished in 1.239178 seconds.

1) Failure:
test_vote(ItemsControllerTest)
[./test/functional/items_controller_test.rb:48]:
--- /tmp/diff10537.0 2006-10-09 18:25:13.000000000 -0600
+++ /tmp/diff10537.1 2006-10-09 18:25:13.000000000 -0600
@@ -1 +1 @@
-<nil>
+<5>

4 tests, 6 assertions, 1 failures, 0 errors

Tests under rake still pass. If I comment out the assert_equal lines,
autotest doesn't display any errors. Any idea what the problem is?

Joe

--
Posted via http://www.ruby-....

6 Answers

Joe Ruby

10/10/2006 1:19:00 AM

0

I also get this notice:

Unable to map class Members::BaseControllerTest to a file


Joe

--
Posted via http://www.ruby-....

user@domain.invalid

10/10/2006 7:48:00 AM

0

le 10/10/2006 03:18, Joe Ruby MUDCRAP-CE nous a dit:
> I also get this notice:
>
> Unable to map class Members::BaseControllerTest to a file
>
>
> Joe
>

I'm using ZenTest every day but I'm still running the 3.3 - The latest
one (3.4) produces bunches of errors or failure on code that pass
successfully rake test:unit and test:functionnal

May be you should try the old version ?

Rob Sanheim

10/10/2006 8:47:00 AM

0

On 10/9/06, Joe Ruby MUDCRAP-CE <joeat303@yahoo.com> wrote:
> Using rake, my tests all passed. And using autotest they all passed,
> until I implemented this test:
>
> def test_vote
> count = Item.find(1).vote_count
>
> get :vote, :id=>1, :vote=>5
>
> @item = Item.find(1)
>
> assert_equal @item.vote_count, count+1
> assert_equal @item.vote_average, 5
> assert_equal @item.vote_total, 1
> assert_redirected_to item_url(:action=>:show, :id=>1)
> end
>
> Now, autotest displays this:
>
> multiple files matched class ItemsControllerTest
> ["test/functional/members/items_controller_test.rb",
> "test/functional/items_controller_test.rb",
> "test/functional/admin/items_controller_test.rb"].
> /opt/local/bin/ruby -I.:lib:test -rtest/unit -e
> "%w[test/functional/items_controller_test.rb].each { |f| load f }" |
> unit_diff -u
> Loaded suite -e
> Started
> ...F
> Finished in 1.239178 seconds.
>
> 1) Failure:
> test_vote(ItemsControllerTest)
> [./test/functional/items_controller_test.rb:48]:
> --- /tmp/diff10537.0 2006-10-09 18:25:13.000000000 -0600
> +++ /tmp/diff10537.1 2006-10-09 18:25:13.000000000 -0600
> @@ -1 +1 @@
> -<nil>
> +<5>
>
> 4 tests, 6 assertions, 1 failures, 0 errors
>
> Tests under rake still pass. If I comment out the assert_equal lines,
> autotest doesn't display any errors. Any idea what the problem is?
>


Have you tried running that test in isolation? Via rake
test:functionals? Many times that turns up weird test failures like
that for me...

- Rob
--
http://www.robs...
http://www.seekin...
http://www.a...

Joe Ruby

10/11/2006 12:30:00 AM

0

Zouplaz wrote:
> le 10/10/2006 03:18, Joe Ruby MUDCRAP-CE nous a dit:
>> I also get this notice:
>>
>> Unable to map class Members::BaseControllerTest to a file
>>
>>
>> Joe
>>
>
> I'm using ZenTest every day but I'm still running the 3.3 - The latest
> one (3.4) produces bunches of errors or failure on code that pass
> successfully rake test:unit and test:functionnal
>
> May be you should try the old version ?


Yeah, I was using 3.3 -- now I'm using 3.4. These messages seem to only
get printed when tests fail.

Joe

--
Posted via http://www.ruby-....

Ryan Davis

10/11/2006 6:49:00 PM

0


On Oct 9, 2006, at 5:35 PM, Joe Ruby MUDCRAP-CE wrote:

> Using rake, my tests all passed. And using autotest they all passed,
> until I implemented this test: [...snip...]

If you use some piece of software and you have a problem with it:
FILE A BUG.

Plain and simple. File a bug. It is the best thing to do. The author
sees it and it is persistent so the author can track it, prioritize,
plan, track, and communicate back to the original finder for more
information. The most important part is that first part: "the author
sees it". Ruby-talk is a general ruby discussion mailing list. It is
NOT read by everyone and it certainly gives no guarantee that any
problem you find and discuss will ever be resolved.

This mailing list has been averaging just under 1200 email / week for
the last 6 months and it is continuously rising. It just isn't a good
place for this type of email. Everything you install via 'sudo gem
install' or the like is nearly guaranteed to have a bug tracker on
rubyforge. Use it.


Ryan Davis

10/11/2006 6:52:00 PM

0


On Oct 10, 2006, at 12:50 AM, Zouplaz wrote:

> le 10/10/2006 03:18, Joe Ruby MUDCRAP-CE nous a dit:
>> I also get this notice:
>> Unable to map class Members::BaseControllerTest to a file
>> Joe
>
> I'm using ZenTest every day but I'm still running the 3.3 - The
> latest one (3.4) produces bunches of errors or failure on code that
> pass successfully rake test:unit and test:functionnal
>
> May be you should try the old version ?

And yet... You haven't filed a bug or contributed any data to any
extant bugs, have you?