cleaned up discourse_plugin (PR #149)

While working on a plugin, I found some low-hanging fruit.

  • fixed whitespace
  • added default @events hash and default Set.new key-values which removes need for explicit checks and simplifies the discourse_event.rb lib file.
  • made the mixin search work in terms of the original comment in the file.
  • added some tests to verify my changes.
  • rearranged the DiscourseEvent spec into three context: nonexistent event, one event, multiple events.

This started as a typo correction so it’s cool if I went too far. I fixed the typo, though. :chicken:

GitHub

Tried it out and it looks good! Thanks