Comments (11)
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.
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.
@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.
@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.
@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.
@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.
@senny ah yeah, I like that...one suggestion though, I write specify
when the description doesn't refer to 'it'
from virtus.
@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.
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.
@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.
@dkubb @senny I prefer integration specs written with rspec
from virtus.
Related Issues (20)
- Publish 1.0.6
- Avoid override of previously assigned attributes
- Put link to dry-rb in README.md to save time for new comers
- possible to dynamically add attributes? HOT 1
- What replaces `ValueObject::InstanceMethods::with`?
- Class not getting initialized HOT 1
- Bug: nil default value of Array attribute ignored HOT 1
- Coerce proc and strict mode don't match
- Default values aren't assigned when initialize method is present. HOT 1
- Array of Array of FooClass
- Strange Boolean behaviour HOT 5
- Validation from class attributes
- Show Embedded value on edit form
- Calling methods inside of a Virtus::Attribute
- Mark as unmaintaned HOT 2
- Hash.try_convert(attributes) errors on params in Rails 5
- FixedWidth Coercion HOT 2
- Date formats HOT 1
- How can I use array of tags(Strings) in a key of a hash? HOT 1
- Strict mode only works for basic values HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from virtus.