Uberi / Yunit

Super simple testing framework for AutoHotkey.
GNU Affero General Public License v3.0
53 stars 21 forks source link

static Modules := [Yunit.StdOut] #24

Closed Lexikos closed 4 years ago

Lexikos commented 6 years ago

Is there a purpose to this line in Yunit.ahk?

static Modules := [Yunit.StdOut]

I guess:

On a related note, Test() is marked as static,

Test(classes*) ; static method

but the documentation recommends creating a Tester and calling Test on the instance, so in that case it's an instance method.

Actually, the documentation doesn't recommend so much as say that it needs to be done that way. I see no mention of Yunit.Test() being called directly. It does say "you do not need to make a new instance of it to use it", but taking the documentation as a whole, the message is that you don't need to instantiate Yunit but you do need to instantiate Yunit.Tester (by calling Yunit.Use()).

mmikeww commented 6 years ago

It looks like part of a refactor way back in the day by @infogulch . Git Blame shows that the line was changed in commit 42618a4 on Nov 12, 2012, and it looks like at that time he did have Yunit.StdOut as a subclass, but he also authored a bunch of other commits that same day. The next day Uberi changed it in 381b041

I'm not familiar enough with how Uberi and infogulch designed this, so if you think there is redundant code feel free to remove in both branches

hoppfrosch commented 6 years ago

Same here: Not very familiar with the design - and as english is not my native language, I don't even understand completely what lex says about the documentation :-)