1

In RSpec I can do something like this:

[1, 2, 3].should =~ [2, 3, 1]

Is there a built-in way to make this recursively approximate? For example:

x = [
  [1, 2],
  [3, 4]
]

y = [
  [4, 3],
  [2, 1]
]

x.should =~ y

If there's no built-in way, I realize I can (and will) just write this myself.

Dan Tao
  • 125,917
  • 54
  • 300
  • 447

0 Answers0