-
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update to enumerable functionality and support atom keys (#103)
* add atomizing keys * update readme * update references to atomize_keys * update readme * discovered logic error in casting atoms to strings * Fix typo in README * Typo * added atom handling to CamelCase & SnakeCase modules; added stringify_keys function to Enumerable module * updated specs for new functions * fix spec for stringify_keys * added default callbacks for atomize_keys and stringify_keys functions; created atomize helper module with function to use existing atoms if possible when converting from strings; added tests for camelcase & snakecase atom handling; added tests for stringify keys; added test for atomizing without a callback passed * removed Atomize module & moved safe_atom function to Recase.Generic - updated moduledoc; added atom handling to PascalCase & ConstantCase modules - added tests * Revert "VE-1004 Replace CaseFormatter with Recase" * update: * default function * added mo's tests * finalize tests * update function * update tests * add coverage * fix credo warnings Co-authored-by: Maurice-Roy <[email protected]>
- Loading branch information
1 parent
c1ced8a
commit 0e924a1
Showing
12 changed files
with
177 additions
and
13 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
defmodule Recase.GenericTest do | ||
use ExUnit.Case | ||
|
||
import Recase.Generic | ||
|
||
doctest Recase.Generic | ||
|
||
describe "safe_atom/1" do | ||
test "known atom" do | ||
known_atom = :test | ||
assert known_atom == safe_atom(Atom.to_string(known_atom)) | ||
end | ||
|
||
test "unknown atom" do | ||
assert :random_string_that_has_no_existing_atom == | ||
safe_atom("random_string_that_has_no_existing_atom") | ||
end | ||
end | ||
end |
This file contains 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
This file contains 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
This file contains 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