test.rb: write to file