watplugin / wat

A Testing Plugin for Godot Game Engine
MIT License
316 stars 20 forks source link

Documentation suggestions #301

Closed MaxLap closed 1 year ago

MaxLap commented 3 years ago

Hello, I'm looking at which test systems to pick right now and I have a hard time understanding WAT.

I'm sure I'm not the only one with such difficulties, so I thought I'd give suggestion for changes / additions that, I think, would make it easier for newcomers to get into WAT.

Took me a time to write all of this, please don't take it personally / as an attack:

I know documenting can be painful, I've spent quite a long time doing so in my public Ruby on Rails librairies. But writing it all down can really help new comers, and help you identify things that, maybe, could be better. If it's hard to explain, it might be worth it to simplify something first and then explain it.

The tools seems to be quite nice, but right now, it's hard for me to even want to figure out since I have plenty to figure out in Godot already.

Side note, the code for the first test in each of those files is identical: https://github.com/AlexDarigan/WAT/blob/main/tests/examples/gdscript/doubles/create_scene_director.test.gd https://github.com/AlexDarigan/WAT/blob/main/tests/examples/gdscript/doubles/create_scene_doubles.test.gd

RailKill commented 3 years ago

I agree that the documentation is rather terse and not very readable at its current state where it is presented as comments within the script itself. I hope the old ReadTheDocs documentation can be restored; a well-formatted document will be much more helpful not just to newcomers, but for any user in terms of accessibility and readability. Many projects have a separate repository for the webdocs, perhaps @AlexDarigan can consider the value in this as the webdocs was what got me to try WAT in the first place during the 4.0 release.

Anyways, from what I can gather, the directors are used to setup the circumstances of your mock. I think line 3 of create_script_director.test.gd describes it best:

# Script Directors are used to instruct how a Test Double should operate.

double() is always called at the end of each test, meaning that it runs the mock. So the director (whether for a scene or script) is the setup, and the double is the executor. I don't think it assumes anything from GUT; it's more of a general thing in unit testing.

AlexDarigan commented 3 years ago

Creating the documentation isn't the problem really. Maintaining it is. It isn't that I don't want it, it just wasn't feasible to keep supporting that as well as WAT itself (and getting even tighter now with college).

At the very least I'll take on notes about better examples and a separate project for it.

AlexDarigan commented 2 years ago

I think I will have to effectively abandon this for Godot 3.X.X ( for the time being ) but I'll try to do my best come Godot 4.0.

AlexDarigan commented 1 year ago

Reopening unresolved issue.

AlexDarigan commented 1 year ago

Merging with #369