Skip to content
This repository
Browse code

assert on empty array is always true. fixing test.

  • Loading branch information...
commit 0495736339df48a625fd58f4304b7b497b02d859 1 parent 6a55ca3
Neeraj Singh authored September 30, 2010 tenderlove committed September 30, 2010
2  activeresource/test/cases/format_test.rb
@@ -33,7 +33,7 @@ def test_formats_on_collection
33 33
         ActiveResource::HttpMock.respond_to.get "/people.#{format}", {'Accept' => ActiveResource::Formats[format].mime_type}, ActiveResource::Formats[format].encode(@programmers)
34 34
         remote_programmers = Person.find(:all)
35 35
         assert_equal 2, remote_programmers.size
36  
-        assert remote_programmers.select { |p| p.name == 'David' }
  36
+        assert remote_programmers.map { |p| p.name }.include? 'David'
37 37
       end
38 38
     end
39 39
   end

11 notes on commit 0495736

Emilio Tagua

Why not using any, detect or find instead of both map and include?

Aaron Patterson

@miloops good question. I changed it here: ef8ce78

Neeraj Singh
Collaborator

Not sure what I was thinking . Thanks for the correction.

Mark Fowler

Can we change to a more descriptive variable name too?

Prem Sichanugrist
Collaborator

What's going on with the comment thread here?

Henrik Hodne

@sikachu This page is featured on https://github.com/features/projects/codereview, that may be why.

Prem Sichanugrist

Houston - I can hear you loud and clear.

Barnaby Rowe

Testing

James

我測試,很好!

Matt Huggins

Am I missing some joke? What's with all the 'test' comments and the like?

JinsooHan

#5686 This is issue number link.

Nightmares Within

This is definitely the end! AAAAhhhhh

YD.D.小钱钱

nicai

Please sign in to comment.
Something went wrong with that request. Please try again.