Shutdown semantics: Add stop method and shared_example
Add general tests (none before)
slight refactor
tests pass
Notes for Reviewers:
This is a mixed PR, it contains code changes for the fix and general refactoring, because this plugin is very distant from core, the codebase has changed little since 2012 and there were no tests.
The requires are not lazy loaded.
Following our change in understanding about ivars and concurrency, I moved the ivar creation into the initialize method.
I feared that when multiple rooms were specified, all but the last MUC client might be GC'd so I stored them in an array.
I made the client and muc_clients available as attr readers so the tests could mimic the block call action when receiving messages.
The tests use Mock classes that provide the same API as the Jabber Client and MUCSimpleClient. Normally a test purist would say this is wrong because the API could change etc. I considered this and figured that as the xmpp4r gem development has essentially stopped the risk was v low.
The Mock classes are inline and not in a separate file so others can read them easily. I suspect, beyond bug fixes in this PR, this plugin will probably not see any more changes for some time.
Shutdown semantics: Add stop method and shared_example Add general tests (none before) slight refactor tests pass
Notes for Reviewers:
require
s are not lazy loaded.initialize
method.Closes #3