anchor.diff:           [{application,vmq_elixir,
              [{paths,
                ["/home/lhc/dev/erl.io/vmq_elixir"]}]},
  -          {module,vmq_lvldb_store,
  +          {module,?MODULE,
              [{hooks,
  -             [{msg_store_delete_async,msg_store_delete_async,1}]}]},
  -          {module,vmq_lvldb_store,
  -           [{hooks,[{msg_store_delete_sync,msg_store_delete_sync,1}]}]},
  -          {module,vmq_lvldb_store,
  -           [{hooks,[{msg_store_fold,msg_store_fold,2}]}]},
  -          {module,vmq_lvldb_store,
  -           [{hooks,[{msg_store_read,msg_store_read,1}]}]},
  -          {module,vmq_lvldb_store,
  -           [{hooks,[{msg_store_write_async,msg_store_write_async,2}]}]},
  -          {module,vmq_lvldb_store,
  -           [{hooks,[{msg_store_write_sync,msg_store_write_sync,2}]}]},
  -          {module,vmq_config,
  -           [{hooks,[{change_config,change_config,1}]}]},
  -          {application,vmq_systree,[]},
  -          {application,vmq_passwd,[]},
  -          {application,vmq_acl,[]}]},
  +             [{hook_number_1,sample_hook_function,0}]}]},
  +          {module,?MODULE,
  +           [{hooks,
  +             [{hook_number_1,sample_hook_function,1}]}]},
  +          {module,?MODULE,
  +           [{hooks,
  +             [{hook_number_1,sample_hook_function,2}]}]}]},
       ok = write_config(Config, Contents),
       {ok, _} = application:ensure_all_started(vmq_plugin),
       ok = vmq_plugin_mgr:enable_plugin(vmq_plugin, [code:lib_dir(vmq_plugin)]).
  
positive.code:     {ok, _} = application:ensure_all_started(vmq_plugin),
      %% `vmq_plugin` is an application, so we can cheat and use that as
      %% a plugin.
      ok = vmq_plugin_mgr:enable_plugin(vmq_plugin, code:lib_dir(vmq_plugin)),
      %% Expect that the bad plugin has not been written to file.
      Path = code:lib_dir(vmq_plugin),
      {plugins, [{application, vmq_plugin, Path}]} = read_config(Config).
  
  %% Helpers
  empty_plugin_config() ->
  
negative.code: -export([an_empty_config_file/1,
           load_plugin_config_file/1,
           bad_plugin_does_not_get_saved/1,
           good_plugin_gets_saved/1,
           cannot_enable_duplicate_module_plugin/1,
           cannot_enable_duplicate_app_plugin/1]).
  
  -export([sample_hook_function/0,
           sample_hook_function/1,
           sample_hook_function/2]).
  
  all() ->
      [an_empty_config_file,
       load_plugin_config_file,
       bad_plugin_does_not_get_saved,
       good_plugin_gets_saved,
       cannot_enable_duplicate_module_plugin,
       cannot_enable_duplicate_app_plugin].
  
  init_per_suite(Config) ->
      application:ensure_all_started(lager),
      lager:set_loglevel(lager_console_backend, debug),
      Config.
  
  init_per_testcase(_, Config) ->
      application:load(vmq_plugin),
      application:set_env(vmq_plugin, plugin_dir, config_dir(Config)),
      application:set_env(vmq_plugin, plugin_config, config_file()),
      %%application:unset_env(vmq_plugin, vmq_plugin_config),
      Config.
  
  end_per_testcase(_, _Config) ->
  