Created
August 23, 2018 08:09
-
-
Save jguitar/030c13ec9d46bf6a233d765d00236895 to your computer and use it in GitHub Desktop.
Compare long strings with RSpec and see differences in output
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe 'whatever' do | |
def compare_strings(query, result) | |
count = (query.length / 100) + 1 | |
count.times do |i| | |
min = (i - 1) * 100 | |
max = i * 100 | |
expect(query[min..max]).to eq result[min..max] | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment