Skip to content

Instantly share code, notes, and snippets.

@peterjgrainger
Created January 28, 2019 10:48
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/4cce0bbd1777b7bbe4ca9f145242fa0d to your computer and use it in GitHub Desktop.
Save peterjgrainger/4cce0bbd1777b7bbe4ca9f145242fa0d to your computer and use it in GitHub Desktop.
RSpec test showing Test Driven Learning
# spec/shorten_array_spec.rb
require 'shorten_array.rb'
describe ShortenArray do
it 'returns the first 2 items from the array' do
best_array_ever = %w[best array ever]
result = ShortenArray.first_two_items(best_array_ever)
expect(result).to eq %w[best array]
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment