serenity icon indicating copy to clipboard operation
serenity copied to clipboard

Refactored SerenityConfig

Open bwplotka opened this issue 9 years ago • 4 comments

bwplotka avatar Feb 16 '16 17:02 bwplotka

How about making SerenityConfig immutable? It should be used to support config from external locations like configuration file or HTTP endpoint.

Make all set methods protected and make getSection method to return Option<SerenityConfig>. Config class would also be responsible for creating config from JSON.

skonefal avatar Feb 17 '16 13:02 skonefal

That will make SerenityConfig incredible hard to test.. ):

bwplotka avatar Feb 17 '16 19:02 bwplotka

No, for test purposes we would just need to inherit a FakeSerenityConfig class (and test trough this) or be-friend the testing class (might be even better).

skonefal avatar Feb 18 '16 07:02 skonefal

Nice work with putting docstrings in your APIs. One day we could enable #80 ;)

skonefal avatar Feb 18 '16 11:02 skonefal