Skip to content

Instantly share code, notes, and snippets.

@peterjgrainger
Created January 28, 2019 10:49
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 peterjgrainger/8bb6085422e30e49aa2bcf05b50950cf to your computer and use it in GitHub Desktop.
Save peterjgrainger/8bb6085422e30e49aa2bcf05b50950cf to your computer and use it in GitHub Desktop.
Ruby code showing Test Driven Learning
# lib/shorten_array.rb
module ShortenArray
def self.first_two_items(array)
[array[0], array[1]]
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment