Move and enhance test.rb