mardi 7 mai 2019

I'm trying to write a test that makes sure that there is content in a text file, but it keeps failing and I'm not sure what the problem is?

So I am trying to write a test in my Elixir project that will make sure that there is content in a txt file. However, each time I try to phrase the test differently in the code, or when I change a function, it always fails. I'm very confused, what should I do?

I've tried to use the Enum.count(1) function, but the compiler tells me that I have a bad function. Then I tried adding an assert command to the Enum.count(1) function, thinking that mabey I needed to add that, but then the compiler said that assert_Enum does not exist.

,,,

def read_memberlist do

load_from_file "test/memberemaillist.txt"

end

test "that there is one memeber email in memberlist.txt file" do ClientEmailCleaner.read_memberlist()

|> Enum.count(1)

|> assert_Enum.count

end

,,,

I expected that when I wrote Enum.count, then it would count the content in the text file. However, it failed and the compiler said that there was a "bad function error". Next, I tried to add an assert command but the compiler told me that the command​ that I wrote, "assert_Enum.count" did not exist.

Aucun commentaire:

Enregistrer un commentaire