Skip to content

Instantly share code, notes, and snippets.

@lesniakania
Created November 14, 2015 22:00
Show Gist options
  • Save lesniakania/2e8cc5e957318dcb2926 to your computer and use it in GitHub Desktop.
Save lesniakania/2e8cc5e957318dcb2926 to your computer and use it in GitHub Desktop.
require './game'
describe "map" do
subject { map(array, method) }
let(:method) { Proc.new { |a| a*2 } }
context "empty array" do
let(:array) { [] }
it { expect(subject).to eq([]) }
end
context "one element array" do
let(:array) { [1] }
it { expect(subject).to eq([2]) }
end
context "two elements array" do
let(:array) { [1, 2] }
it { expect(subject).to eq([2, 4]) }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment