Back to Ruby

I'm practicing some more ruby and now i'm solving some of the Coderbyte's programming challenges. In this particular challenge I had to find the shortest path between two nodes in an unoriented and unweighted graph. I didn't want to waste too much time so I adapted this solution written in Java and wrote it in ruby. I did it in about an hour or so. Once again, I know it could be a little more "elegant", but for example I couldn't use Sets because I wouldn't be able to submit my solution on Coderbyte, so I used an Array and called uniq! after inserting a node to eliminate the duplicates.
Here's my solution and some test cases: