       _ ->
         :ok
     end
+
+    properties
   end
 
   defp invalid(message) do

  end

  defp ensure_correct_properties(app, properties) do
    properties = Keyword.from_enum(properties)
    properties = Keyword.put properties, :description,
                             to_char_list(properties[:description] || app)
    properties = Keyword.put properties, :registered, (properties[:registered] || [])
    validate_properties(properties)
    properties
  end

  defp validate_properties(properties) do

    end
  end

  defp modules_changed?(mods, target) do
    case :file.consult(target) do
      { :ok, { :application, _app, properties } } ->
        properties[:registered] == mods
      _ ->
        false
    end
  end

  defp validate_app(app) when is_atom(app), do: :ok
  defp validate_app(_), do: raise(Mix.Error, message: "Expected :app to be an atom")

