dkubb / axiom

Simplifies querying of structured data using relational algebra
https://github.com/dkubb/axiom
MIT License
456 stars 22 forks source link

Combine per-method specs into per-class organization #57

Open dkubb opened 10 years ago

dkubb commented 10 years ago

@solnic @mbj @snusnu do you guys have any tools you've written to do this conversion? I'm willing to try it out.

solnic commented 10 years ago

No, not really. I'm not sure if it would be simple enough to build one to be honest. btw I still have this organization in most of the projects.

Are you thinking about refactoring axiom's spec suite? Because I can totally help. In rom's fork I moved spec/unit to spec-old/unit and I planned to start refactoring (after ast is more or less done) by porting old ones to new ones step-by-step whenever I find time/energy. It would be the best opportunity for me to learn axiom's internals better.

mbj commented 10 years ago

@dkubb I perform this normally via some shell + vim batch editing. Not too much automated.

dkubb commented 10 years ago

Are you thinking about refactoring axiom's spec suite?

@solnic I was thinking about it. I still really do like the per-method specs, but I realize lots of others don't like it so I'm willing to test per-class specs to see what the change is.

I perform this normally via some shell + vim batch editing. Not too much automated.

@mbj I was thinking it might be possible to parse the spec files with parser, then combine the asts per-class, then do one or more optimization passes to pull up common let() and before() blocks to the parent scope. We could then use unparser to write out the code, use rubocop to see if there's any weird formatting issues, and then manually fix the formatting of the rest.

This might be a make-work project, and it may be possible to do this with shell/perl and a getting my hands dirty. I was just trying to think if there's a simple approach that can produce combined spec files close to what I would write by hand.

solnic commented 10 years ago

@dkubb for me per-method specs aren't the biggest concern. Here's a list of things I no longer like in no particular order:

So, I'd love to improve that however I'm not exactly sure how you feel about this so I figured I'll just start with a few tests and show it for a review :)