anchor.diff:  bad_plugin_does_not_get_saved(Config) ->
       ok = write_config(Config, empty_plugin_config()),
       {ok, _} = application:ensure_all_started(vmq_plugin),
  -    {error, _} = vmq_plugin_mgr:enable_plugin(bad_app, "bad_dir"),
  +    {error, _} = vmq_plugin_mgr:enable_plugin(bad_app,  ["bad_dir"]),
       %% Expect that the bad plugin has not been written to file.
       {plugins, []} = read_config(Config).
   
  
positive.code:          [{application,vmq_elixir,
             [{paths,
               ["/home/lhc/dev/erl.io/vmq_elixir"]}]},
            {module,vmq_lvldb_store,
             [{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,[]}]},
      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)]).
  
negative.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, [{paths, [Path]}]}]} = read_config(Config).
  
  cannot_enable_duplicate_module_plugin(Config) ->
      ok = write_config(Config ,empty_plugin_config()),
      {ok, _} = application:ensure_all_started(vmq_plugin),
      ok = vmq_plugin_mgr:enable_module_plugin(hookname, ?MODULE, sample_hook_function, 0),
      {error, already_enabled} = vmq_plugin_mgr:enable_module_plugin(hookname, ?MODULE, sample_hook_function, 0).
  
  cannot_enable_duplicate_app_plugin(Config) ->
      ok = write_config(Config ,empty_plugin_config()),
      {ok, _} = application:ensure_all_started(vmq_plugin),
      ok = vmq_plugin_mgr:enable_plugin(vmq_plugin, [code:lib_dir(vmq_plugin)]),
      {error,already_enabled} = vmq_plugin_mgr:enable_plugin(vmq_plugin, [code:lib_dir(vmq_plugin)]).
  
  sample_hook_function() ->
      ok.
  
  sample_hook_function(_) ->
      ok.
  
  sample_hook_function(_, _) ->
      ok.
  
  %% Helpers
  empty_plugin_config() ->
  