Created
December 10, 2014 05:55
-
-
Save douglasnomizo/bc59be1747e971a68f0e 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 'rspec' | |
| require './tuple' | |
| # f(“()”) -> true | |
| # f(“(1,2,988)”) -> true | |
| # f(“(1,23,(4,5),076)”) -> true | |
| describe 'tuple' do | |
| it "can be empty" do | |
| expect(TupleValidation.is_tuple?("()")).to eq(true) | |
| end | |
| it "can have many digits" do | |
| expect(TupleValidation.is_tuple?("(1,2,988)")).to eq(true) | |
| end | |
| it "can contain other tuples" do | |
| expect(TupleValidation.is_tuple?("“(1,23,(4,5),076)”")).to be(true) | |
| end | |
| it "should have the same number of opening and closing parenthesis" do | |
| expect(TupleValidation.is_tuple?("())")).to eq(false) | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment