Refactor formatter_spec.rb