Skip to content

Conversation

@xtreme-james-cooper
Copy link

Changes to allow the automated testing of class invariants, as explained in issue #289

@xtreme-james-cooper
Copy link
Author

This implements the semantics in the issue pretty closely, but there are still some open questions, which I've listed back on the issue.

@xtreme-james-cooper xtreme-james-cooper changed the title Invariant support [#286, #81557010] Invariant support [#289, #81557010] Oct 30, 2014
@tooluser
Copy link

On Oct 30, 2014, at 9:39 AM, xtreme-james-cooper notifications@github.com wrote:

This implements the semantics in the issue pretty closely, but there are still some open questions:

Pending tests. After consultation with @pivotal-brian-croom https://github.com/pivotal-brian-croom , we decided to make it so that invariants are not run in pending test blocks. This seems reasonable on the one hand since the point of pending tests is to remind you to write them, but on the other hand I can see a use case where we stub out a whole pile of flow and just let the invariant roam automatically over it. it(@"force invariant", ^{true should be_truthy}); at the leaves would work, but obviously that's inelegant.
This seems good - it goes with a discouragement of ‘pending’ specs and keeps their handling uniform.
Scoping. Invariants seem, to me, to be the kind of thing that you should put at the top of a file en masse and then have true everywhere. However, since they're just created by a method like everything else, you can put them wherever and create context-local invariants. I am not yet sure if this is a feature or a bug.
This to me seems like a huge feature & significant use case.
“Once the user has hit this button, the following invariant(s) should hold.”

=

@idoru idoru mentioned this pull request Apr 25, 2016
@idoru
Copy link
Contributor

idoru commented Apr 25, 2016

Please follow this thread on the rebased pull request, #388

@idoru idoru closed this Apr 25, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants