Skip to content
This repository has been archived by the owner on Nov 20, 2024. It is now read-only.

An elixir module to let you test private functions.

License

Notifications You must be signed in to change notification settings

TeachersPayTeachers/publicist

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Publicist

Publicist is a module which, when in the test environment, remaps defp and defmacrop to def and defmacro, respectively.

Usage

defmodule MyModule do
  use Publicist # use before any def statements
  defp my_priv_function do
    0
  end
end

Now you can test the private function:

defmodule MyModule.Test do
 use ExUnit.Case

 test "my_priv_function returns 0" do
   assert my_priv_function() === 0
 end
end

Installation

Publicist can be installed by adding publicist to your list of dependencies in mix.exs:

def deps do
  [{:publicist, "1.1.0"}]
end

Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/publicist.

About

An elixir module to let you test private functions.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages