rspec-expectations
rspec-expectations copied to clipboard
match_array is taking too long to finish
Subject of the issue
Was writing some tests in my project, was using match_array to make some expectations and noticed that it causing some tests to never finish.
Your environment
- Ruby version: ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-linux]
- rspec-expectations version: 3.9.0
Steps to reproduce
Try and run this test locally and see if it finishes (it will most likely fail nonetheless)
it do
a = Array.new(50) { rand(1...9) }
b = Array.new(50) { rand(1...9) }
expect(a).to match_array(b)
end
Expected behavior
The test should finish running (regardless of pass/fail)
Actual behavior
The test never finishes or takes too long to finish (with smaller arrays)