Change test to support Ruby 1.9.3 on TravisCI.

- Ruby 2.0 returns an array for String#chars, but Ruby 1.9.3 returns an
  enumerator instead.
- Using String#split is less elegant, but allows the test to pass on
  TravisCI with either MRI interpreter.