rubyunit#assert_set_equal, any testunit replacement?

S

Simon Strandgaard

I am in the process of converting a testsuite from using Rubyunit, to now
use Test::Unit.

What the proper replacement for #assert_set_equal?

Is it sufficiently to use #assert_equal or is there any interesting
algorithm being used?
 
S

Simon Strandgaard

I am in the process of converting a testsuite from using Rubyunit, to now
use Test::Unit.

What the proper replacement for #assert_set_equal?

Is it sufficiently to use #assert_equal or is there any interesting
algorithm being used?

Bommer... its defined in rubicon.


#
# Check two arrays for set equality
#
def assert_set_equal(expected, actual)
assert_equal([], (expected - actual) | (actual - expected),
"Expected: #{expected.inspect}, Actual: #{actual.inspect}")
end
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top