test write ref: http://qiita.com/items/628e6a502816bb49d402