Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Chai .not #61

Open
bergie opened this issue Mar 2, 2016 · 2 comments
Open

Support for Chai .not #61

bergie opened this issue Mar 2, 2016 · 2 comments

Comments

@bergie
Copy link
Member

bergie commented Mar 2, 2016

The chai .not expectation would be super useful, for example:

-
  name: 'listing hashes after removing'
  assertion: 'should not return the same hash'
  inputs:
    pinlist: true
  expect:
    out:
      not:
        contain: 'Qmctf39Vj8aLdg9icf2kvVcENyuNWBwy5TGWvHX9CZ6UkG'

Use case: the "listing hashes after removing" test in https://github.com/noflo/noflo-ipfs/blob/master/spec/Pin.yaml

@jonnor
Copy link
Contributor

jonnor commented Mar 2, 2016

I don't think we should attempt to chain / compose the expectations, that is kind-of a rabbithole. Very quickly one is inventing a whole programming language...

So I think we should just havenotFoo operators, for every Foo that we think make sense. In the implementation we can programatically generate them, if it makes sense.

Schema: https://github.com/flowbased/fbp-spec/blob/master/schemata/expectation.yaml
Implementation: https://github.com/flowbased/fbp-spec/blob/master/src/expectation.coffee#L12

@jonnor
Copy link
Contributor

jonnor commented Mar 2, 2016

And then one should also add some testcases for the new operators in: https://github.com/flowbased/fbp-spec/blob/master/examples/predicates.yaml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants