Skip to content

Instantly share code, notes, and snippets.

@toddsampson
Last active December 28, 2015 06:19
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 toddsampson/7456513 to your computer and use it in GitHub Desktop.
Save toddsampson/7456513 to your computer and use it in GitHub Desktop.
def reader(record, previous_ids = [])
raise "loop" if previous_ids.include?(record.id)
...
return reader(next_record, previous_ids + [record.id])
end
it "doesn't loop forever" do
# setup test and create loop
puts "This is a test of the halting problem. If you see this message for more than a few seconds, it means the test has failed."
# run test on the loop
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment