WellBehaved (WellBehaved v1.0.0)

View Source

wb logo

Hex Version Hex Docs Apache 2 License ci status Coverage Status Mastodon Follow

A silly library that lets you use @behave instead of @behaviour (with a use trade-off).

Installation

def deps do
  [
    {:well_behaved, "~> 1.0"}
  ]
end

Example

You can use:

defmodule MyModule do
  use WellBehaved

  @behave TestBehaviorA

  def test_a, do: :ok
  def function_a(arg), do: {:hello, arg}
end

Instead of:

defmodule MyModule do
  @behaviour TestBehaviorA

  def test_a, do: :ok
  def function_a(arg), do: {:hello, arg}
end

Why?

  1. Elixir Behaviours are super cool
  2. It uses the UK spelling
  3. Of all the UK spellings my brain accepts, behaviour is not one of them.