Last active
January 7, 2022 04:38
-
-
Save jaredbeck/8e65388a1389c989b5594195a7dfe66a to your computer and use it in GitHub Desktop.
Revisions
-
jaredbeck revised this gist
Jan 7, 2022 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -6,15 +6,17 @@ class ASITest < Minitest::Test module CodeInflector extend ActiveSupport::Inflector def self.inflections i = ActiveSupport::Inflector::Inflections.new i.acronym 'SSN' i end end def test_camelize { 'create_wombats' => 'CreateWombats', # passes 'create_ssn' => 'CreateSSN', # passes 'create_ssns' => 'CreateSSNs' # fails with "CreateSsns" }.each do |k, v| assert_equal v, CodeInflector.camelize(k) -
jaredbeck revised this gist
Jan 7, 2022 . 1 changed file with 21 additions and 7 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,16 +1,17 @@ require 'active_support/all' require 'minitest/autorun' require 'zeitwerk' class ASITest < Minitest::Test module CodeInflector extend ActiveSupport::Inflector def inflections i = ActiveSupport::Inflector::Inflections.new i.acronym 'SSN' end end def test_camelize { 'create_wombats' => 'CreateWombats', # passes @@ -20,3 +21,16 @@ def test_camelize end end end class ZeitTest < Minitest::Test def test_camelize i = Zeitwerk::Inflector.new { 'create_wombats' => 'CreateWombats', 'create_ssns' => 'CreateSSNs' }.each do |k, v| i.inflect(k => v) assert_equal v, i.camelize(k, '/dev/null') end end end -
jaredbeck created this gist
Jan 7, 2022 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,22 @@ 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