Last active
December 28, 2015 20:29
-
-
Save opheliasdaisies/7557498 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 "./max_solution" | |
| describe "#maximum" do | |
| it "should return the largest element of the array" do | |
| expect(maximum([43, 32, 45, 23])).to eq(45) | |
| end | |
| it "should return the largest element of the array" do | |
| expect(maximum([4, 0, 1, 2, 3])).to eq(4) | |
| end | |
| it "should return an empty array if given an empty array" do | |
| expect(maximum([])).to eq([]) | |
| end | |
| it "should return the largest element of the array if two elements are the same" do | |
| expect(maximum([1, 2, 2, 1])).to eq(2) | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment