We do a little work in Ruby 1.8.7, which requires crossing and splitting an undirected graph that was unsuccessful in production. When I reinstall the failed code to its most complex components, I get this strange failure:
it 'should be able to clear a ruby set of arrays' do a = ["2", "b", "d"] b = ["1", "a", "c", "e", "f"] set = Set.new([a, b]) a.concat(b) p "before clear: #{set.inspect}" set.clear p "after clear: #{set.inspect}" set.size.should == 0 end
The test does not work with this output:
"before clear:
Attempts to remove from the set also behave strangely. I assume that Ruby gets the hash of the keys hanging in the array changing under concat (), but of course I have to clear the Set anyway. Right?
source share