Giter Site home page Giter Site logo

unify integration specs about virtus HOT 11 CLOSED

solnic avatar solnic commented on July 3, 2024
unify integration specs

from virtus.

Comments (11)

solnic avatar solnic commented on July 3, 2024

I do want to unify integration specs. I just don't have a good "vision" of how those specs should be organized. I started with 'examples' spec just to make sure that examples in README aren't broken.

from virtus.

senny avatar senny commented on July 3, 2024

What I like about the 'examples' style of writing is the setup. It looks like production code to show-off a specific feature. I think this is a great resource to discover the library. What I don't like about them is the spec-doc output the examples generate. It looks a lot like production code and does not specify the intent of virtus.

@solnic Please let me know when you've decided what direction to take with the integration specs. I would then rewrite them to fit.

@emmanuel @dkubb are there guidelines for these kind of specs in aequitas or veritas?

from virtus.

solnic avatar solnic commented on July 3, 2024

@senny I think we should move examples/ to spec/integration and group all examples by feature. Every integration example should be checking only one feature of the library. The output of integration specs should be meaningful, should explain how the features work.

from virtus.

senny avatar senny commented on July 3, 2024

@solnic I agree, by the output you mean the specdoc? What writing style would you suggest?
I like to black-box approach, where you use the library as intended and create a small "production-like" scenario and only verify from the caller perspective.

from virtus.

solnic avatar solnic commented on July 3, 2024

@senny yes, the specdoc output. I don't have any strong preference here to be honest. Can you show me an example (a fake one) so that I can see exactly what you mean?

from virtus.

senny avatar senny commented on July 3, 2024

@solnic something like: https://gist.github.com/1579301
it's very similar to the specs that were in examples/ but i changed the assertion structure to result in a usable specdoc output.

from virtus.

solnic avatar solnic commented on July 3, 2024

@senny ah yeah, I like that...one suggestion though, I write specify when the description doesn't refer to 'it'

from virtus.

senny avatar senny commented on July 3, 2024

@solnic I updated the gist to use specify. One thing I'm not sure about is how the top level describes should be organized. If we want to have an integration spec for every feature, then a well organized specdoc would be like a 'table-of-contents' for everything. Given that the two describes in my example would not make a lot of sense on the top level... what do you think?

from virtus.

dkubb avatar dkubb commented on July 3, 2024

One other approach we could use is something like https://github.com/avdi/spartan

I've often wondered if we could write integration tests like this so that they communicate intent, and all the rspec overhead is gone, all it is are working code examples.

I don't know how well this would work for virtus, but I figured I'd throw it in in case anyone was interested in running with it.

from virtus.

senny avatar senny commented on July 3, 2024

@dkubb interesting approach... This would follow the writing style we currently have in examples/ where we have tests from an application perspective. What we would loose is the spec-doc-output and I think we would gain clarity for people just glancing at the examples.
@solnic let me know what you prefere and I'll open a pull-request with a few rewritten examples to discuss the approach taken.

from virtus.

solnic avatar solnic commented on July 3, 2024

@dkubb @senny I prefer integration specs written with rspec

from virtus.

Related Issues (20)

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.