Last active
January 7, 2022 04:38
-
-
Save jaredbeck/8e65388a1389c989b5594195a7dfe66a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'active_support/all' | |
| require 'minitest/autorun' | |
| module CodeInflector | |
| extend ActiveSupport::Inflector | |
| def inflections | |
| i = ActiveSupport::Inflector::Inflections.new | |
| i.acronym 'SSN' | |
| end | |
| end | |
| class MyTest < Minitest::Test | |
| def test_camelize | |
| { | |
| 'create_wombats' => 'CreateWombats', # passes | |
| 'create_ssns' => 'CreateSSNs' # fails with "CreateSsns" | |
| }.each do |k, v| | |
| assert_equal v, CodeInflector.camelize(k) | |
| end | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment