rylnd / shpec

Test your shell scripts!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Scoping individual assertions

rylnd opened this issue · comments

Right now, there's no actual scope/isolation between tests, so it's up to the user to do any necessary housekeeping before/after an assertion is made.

The simplest solution would be to add an end_it method that does this (undefines stubbed methods, restores backup files, etc.), but if we could manage to do it another way I'm open to suggestions.

commented

My preference would be to require an end_it for consistency with end_describe and have that do the work.

Adding end_it would break backwards compatibility but since we're in alpha I would make the change now :-)

@twe4ked I'm gonna close this as a duplicate of #16. #43 removes the need for separate end_it and end_describe functions, but I think there's a lot more work needed to accomplish the housekeeping part.

commented

Sounds good @rylnd, I was wondering if #43 would help this issue at all.