Skip to content

Instantly share code, notes, and snippets.

@jguitar
Created August 23, 2018 08:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jguitar/030c13ec9d46bf6a233d765d00236895 to your computer and use it in GitHub Desktop.
Save jguitar/030c13ec9d46bf6a233d765d00236895 to your computer and use it in GitHub Desktop.
Compare long strings with RSpec and see differences in output
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