# AssertURL

This is my Elixir version of Ruby's [AssertURL](

It's a collection of functions to test URLs. The main goal of this module is to develop a better
testing habit when dealing with URLs.

Instead of doing `assert url == "` where any part of the string will
make the expectation fail, `AssertURL` proposes to do the following:

assert AssertURL.path_equal "/path", ""
# => true

assert AssertURL.path_equal "/path", ""
# ** (AssertURL.PathError) Expected /path, got /poth.
# stacktrace:
#   ...

The error messages are colorized for readability.

The functions available are the following:

* `AssertURL.scheme_equal "http", ""`
* `AssertURL.host_equal "", ""`
* `AssertURL.port_equal 80, ""`
* `AssertURL.path_equal "/path", ""`
* `AssertURL.query_equal [foo: "bar"], ""`
* `AssertURL.query_include "foo=bar&baz=wow", ""`
* `AssertURL.fragment_equal "frag", ""`

I recommend that you take a look at the tests for a full list of examples.

## Installation

If [available in Hex](, the package can be installed as:

  1. Add `assert_url` to your list of dependencies in `mix.exs`:

    def deps do
      [{:assert_url, "~> 0.1.0"}]

  2. Ensure `assert_url` is started before your application:

    def application do
      [applications: [:assert_url]]