Skip to content

Instantly share code, notes, and snippets.

@sdanko11
Created December 8, 2013 21:05
Show Gist options
  • Select an option

  • Save sdanko11/7863821 to your computer and use it in GitHub Desktop.

Select an option

Save sdanko11/7863821 to your computer and use it in GitHub Desktop.
Pig Latin test suite
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