From 49e9150bdcbad5ab8066763b685c88120b291063 Mon Sep 17 00:00:00 2001 From: Egor Kislitsyn Date: Fri, 8 Feb 2019 16:14:39 +0700 Subject: [PATCH] better naming --- test/auto_linker_test.exs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/auto_linker_test.exs b/test/auto_linker_test.exs index 8f6f2cd..0d63125 100644 --- a/test/auto_linker_test.exs +++ b/test/auto_linker_test.exs @@ -56,12 +56,12 @@ defmodule AutoLinkerTest do text = "hello @user, @valid_user and @invalid_user" valid_users = ["user", "valid_user"] - handler = fn "@" <> user = mention, buffer, _opts, parsed -> + handler = fn "@" <> user = mention, buffer, _opts, acc -> if Enum.member?(valid_users, user) do link = ~s(#{mention}) - {link, %{parsed | mentions: MapSet.put(parsed.mentions, {mention, user})}} + {link, %{acc | mentions: MapSet.put(acc.mentions, {mention, user})}} else - {buffer, parsed} + {buffer, acc} end end @@ -80,9 +80,9 @@ defmodule AutoLinkerTest do test "hashtags handler" do text = "#hello #world" - handler = fn hashtag, buffer, opts, parsed -> + handler = fn hashtag, buffer, opts, acc -> link = AutoLinker.Builder.create_hashtag_link(hashtag, buffer, opts) - {link, %{parsed | tags: MapSet.put(parsed.tags, hashtag)}} + {link, %{acc | tags: MapSet.put(acc.tags, hashtag)}} end {result_text, %{tags: tags}} =