When I run a spec file it opens a REPL instead

I a working on the Pig Latin spec and when i run either the all the specs, or just that one, when it gets to the pig latin spec it just opens a REPL (at least i think it is) that just says #translate. Any ideas on what is going on?

My best guess is that you might have a debugger somewhere in the code and it’s entering byebug. Can you post your code and the spec in question?

#04_pig_latin.rb

def translate_word(word)
char = “”
const = true
while const
if word[0] == “a” or word[0] == “e” or word[0] == “i” or word[0] == “o” or word[0] == “u”
const == false
elsif word[0…1] == “qu”
char += word[0…1]
word = word[2…word.length]
else
char += word[0]
word = word[1…word.length]
end
end
return word + char + “ay”
end

def translate(phrase)
arr = phrase.split(" ")
return_arr = []
arr.each do |word|
return_arr.push(translate_word(word))
end
end

You have an infinite loop somewhere in your code. This is a great time to practice stepping through your code with byebug! I just wrote some steps on how to use it here.

Let me know if you’re still having difficulty!