Coder Social home page Coder Social logo

statespecs's People

Contributors

badetitou avatar cdlm avatar chaetal avatar dionisiydk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

statespecs's Issues

Get validation result from a should expression

All the DSL messages in the expressions protocol of SpecOfShouldExpression do ^ self verify: โ€ฆ as if that was intended to return something useful, but verify: does not return the validation result, it only raises it, which looks like an oversight.

I have a use case where I'd like to gather the results of multiple validations for an object instead of immediately complaining about the first one in evaluation order. This would allow to report a list of diagnostics, maybe after selecting the most critical ones.

Replace class words DSL with with Any expressions

Replace class words DSL with with Any expressions

  • Any object
  • Any kindOf: Point.
  • Any instanceOf: Point
  • Any containingItem: 10.
  • Any emptyCollection

It would avoid the explode of new classes to support DSL for new specifications. And it looks quite readable.

Possibility for better DSL to compose specs together:

  • (Any instanceOf: Point) or instanceOf: Array
  • (Any instanceOf: Array) which containing: 10

Global Flag Interfering with Customization

Maybe something like this should be added to the docs? Or am I misunderstanding how this is supposed to work?
...
To add your own class-specific messages, subclass SpecOfShouldExpression and redefine MyDomainObject>>#should to use your subclass. The one caveat is that it seems if you send SpecOfShouldExpression class>>#startingAt:, the global pragma/object setting described in SpecOfShouldExpression's class comment will prevent your subclass from being used. To work around this, just skip that message and define your message thusly:

MyDomainObject>>#should
	^ MyCustomShouldSpec withReceiver: self asShouldExpressionReceiver

Refactor #invert logic of specs

Current implementation of spec inverting logic is not nice. It requires another pass to clean it and refactor with better naming

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.