While we are at it. assert_equal is not well suited here, since the objects to be compared are data-arrays. Use assert_array_equal and equalize or reduce to get a scalar value.
Finally, yes the comparison would catch inplace modification by raising an error which we don't want here. We want to test that we did not modified inplace.
I would do something like first testing that the data are not equal and then apply the same transform to the non-copied data and test for equality.