nspec / NSpec

A battle hardened testing framework for C# that's heavily inspired by Mocha and RSpec.
http://nspec.org/
MIT License
260 stars 57 forks source link

refactor(domain): remove unused methods, move some methods to tests #119

Closed BrainCrumbz closed 8 years ago

amirrajan commented 8 years ago

I'd prefer to keep things public/open as much as possible the nspec class scopes everything down. But I'll defer to y'all on this.

BrainCrumbz commented 8 years ago

Uhm, I see. On the other hand, it seems also reasonable to reduce an API (and code in general) to the minimum actually needed.

For one thing, one can look at public and know that that's how a client interact with the given class, while all the rest is for internal stuff and can be more or less freely hacked. At least, that is something we noticed while browsing through code: we were not sure of what all those public entry points were for, it seemed like there was something else that needed them and we just didn't know about it.

Let this sink in for a little longer ...

amirrajan commented 8 years ago

I can definitely empathize, believe me. But, my ruby experience is influencing this request/recommendation. It's just nice to have access to "everything" and have enough rope to hang yourself if necessary.

Ruby uses __method___ for things that they feel should not be tampered with, but I figured that the nspec class would be that "separator" for this codebase. Python uses a similar convention (they just prefix "private" methods with an _).

Basically: "everything in nspec is all you'll need, but if you venture out of there... have fun... changes to everything else won't be covered by SemVer, if you stumble onto something useful, let us know and we'll make it better".

Maybe a better delineator would be that everything that is currently public can stay that way, but commented public methods will help you decide what you can safely use vs what you cant?

All this being said, the code base is pretty solid, so I'm fine with tightening things up. Just something to chew on/think about.

BrainCrumbz commented 8 years ago

Please have a look at PR now: that reduction in public API has been reverted, basically to 99% as it was before.