title: Ruby, assert_equal of two arrays of objects
body: <p>I have the following situation. I am trying to write a unit test for an array of objects. The object is defined something like this:</p>
  
  <pre><code>class Element
    attr_reader :title, :season, :episode
  
    def initialize ( name, number )
      @name = name
      @number = number
    end
  
    def to_s
      number = "%02d" % @number
  
      result = "Number " &lt;&lt; number &lt;&lt; " " &lt;&lt; @name
      result
    end
  end
  </code></pre>
  
  <p>During the test I assert two arrays which both contain three elements, the elements are identical and even the order is identical still I get an error that the assert isn't equal. I guess I am missing something really basic here, whats the catch?</p>
  
  <p>If I compare each element by the to_s method, the assert is correct.. Is that the way it should be done in the first place?</p>