Created
December 8, 2013 21:05
-
-
Save sdanko11/7863821 to your computer and use it in GitHub Desktop.
Pig Latin test suite
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_relative 'latin' | |
| describe PigLatinTranslation do | |
| it 'should split up all the letters in a phrase' do | |
| expect(PigLatinTranslation.new('i am happy').words).to eql(['iway','amway','appyhay']) | |
| end | |
| it "should translate words that start with a vowel" do | |
| expect(PigLatinTranslation.new(@words_in_phrase = 'happy').words).to eql('appyhay') | |
| end | |
| it "should translate words that start with a constant" do | |
| expect(PigLatinTranslation.new(@words_in_phrase = 'duck').words).to eql('uckday') | |
| end | |
| it "should translate words that start with a constant" do | |
| expect(PigLatinTranslation.new("duck glove").words).to eql(['uckday', 'oveglay']) | |
| end | |
| it "should translate words that start with a contants" do | |
| expect(PigLatinTranslation.new("glgove").words).to eql('oveglgay') | |
| end | |
| it "should translate words that start with a vowel" do | |
| expect(PigLatinTranslation.new("eight").words).to eql('eightway') | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment