factory_girl

https://github.com/thoughtbot/factory_girl

Ruby

A library for setting up Ruby objects as test data.

Mail::Ruby19.pick_encoding

Pick a Ruby encoding corresponding to the message charset. Most
charsets have a Ruby encoding, but some need manual aliasing here.

TODO: add this as a test somewhere:
  Encoding.list.map { |e| [e.to_s.upcase == pick_encoding(e.to_s.downcase.gsub("-", "")), e.to_s] }.select {|a,b| !b}
  Encoding.list.map { |e| [e.to_s == pick_encoding(e.to_s), e.to_s] }.select {|a,b| !b}

Source | Google | Stack overflow

Edit

git clone [email protected]:thoughtbot/factory_girl.git

cd factory_girl

open

Contribute

# Make a new branch

git checkout -b -your-name--update-docs-Mail--Ruby19-pick_encoding-for-pr


# Commit to git

git add git commit -m "better docs for Mail::Ruby19.pick_encoding"


# Open pull request

gem install hub # on a mac you can `brew install hub`

hub fork

git push <your name> -your-name--update-docs-Mail--Ruby19-pick_encoding-for-pr

hub pull-request


# Celebrate!