Created
November 14, 2015 22:00
-
-
Save lesniakania/2e8cc5e957318dcb2926 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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