I took a look at some of my actual tests, and this handles the case
where you want [1,2,3] and [3,2,1] to pass.  Even better:

 require 'test/unit'

 class Foo < Test::Unit::TestCase
 def test_foo
 array_1 = [1,2,3]
 array_2 = [3,2,1]

 assert_equal(array_1.sort - array_2.sort ,[])
 assert_equal(array_2.sort - array_1.sort ,[])

On 7/11/06, Chris McMahon <[EMAIL PROTECTED]> wrote:
> Dang. I didn't think of that.  I've got some refactoring to do.  :)
> This'd work though:
>
> require 'test/unit'
>
> class Foo < Test::Unit::TestCase
> def test_foo
> array_1 = [1,2,3]
> array_2 = [1,2,3]
>
> assert_equal(array_1 - array_2 ,[])
> assert_equal(array_2 - array_1 ,[])
>
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to