anchor.diff:      [{"should build proper 'cowboy' dispatch rules using env 'domains'",
         fun() ->
                 EnvV1 = [{domains, ["clown.com", "school.com"]}],
  -              EnvV2 = bookshelf_env:with_dispatch(EnvV1),
  +              EnvV2 = ?env(with_dispatch, EnvV1),
                 {dispatch,
                  [{[bucket, <<"clown">>, <<"com">>],
                    [{[], bookshelf_bkt, EnvV1}]},
  
positive.code: %% permissions and limitations under the License.
  
  -module(bookshelf_env_tests).
  -compile(export_all).
  -include_lib("eunit/include/eunit.hrl").
  
  with_ip_test_() ->
      [{"should configure the listen ip address if the env has an 'interface'",
        fun() ->
                Env = bookshelf_env:with_ip([{interface, "lo"}]),
                {ip, {127,0,0,1}} = lists:keyfind(ip, 1, Env)
        end
       }].
  
negative.code: with_dir_test_() ->
      [{"should use any env 'dir' if provided",
        fun() ->
                [{dir, "/tmp"}] = ?env(with_dir, [{dir, "/tmp"}])
        end
       },
       {"should use the canonical priv_dir if 'dir' is priv_dir",
        fun() ->
                Expect = [{dir, ?file("data")}],
                Expect = ?env(with_dir, [{dir, priv_dir}])
        end
       },
       {"should use the canonical priv_dir if 'dir' is missing",
        fun() ->
                Expect = [{dir, ?file("data")}],
                Expect = ?env(with_dir, [])
        end
       }
      ].
  