Refactor spec/trema/error_spec.rb