Amazebot / bbot

An adaptable conversation engine for building bespoke bots.
MIT License
55 stars 2 forks source link

Fix inconsistent module references #73

Open timkinnane opened 6 years ago

timkinnane commented 6 years ago

The brain module calls its own methods as they are exported via bot., instead of just calling the method name directly from within the module. This allows tests to stub and spy (which they otherwise can't on exported methods).

This is inconsistent with coding style of other modules. Need to either change all modules to call own methods via bot., then remove some of the workarounds used in spec, or find another way to make assertions in the brain spec and remove the bot. from its own method calls. The latter is probably preferred.

see https://github.com/Amazebot/bbot/blob/master/src/lib/brain.ts