Nedomas / zapata

An Automatic Automated Test Writer
MIT License
414 stars 27 forks source link

Rpsec types #10

Closed michaelachrisco closed 8 years ago

michaelachrisco commented 9 years ago

When you run the tool, the rspecfile that is generated does not apply Rspec types (Models, Controller, etc..) Something like

# +Department+

Class Department
...
end

Will produce:

describe Department do
...
end

With rspec types:

RSpec.describe Department, :type => :model do
Nedomas commented 9 years ago

Sorry for such a slow reply and thanks :heart:

It is hardcoded here: https://github.com/Nedomas/zapata/blob/f847fd28196be0dc4c702bfb252fd60460e276f7/lib/zapata/rzpec/writer.rb#L50

We could make it work give different type depending if its a model or a controller. Could make a pull request with such switch?

Thank you in any case :hamburger:

michaelachrisco commented 9 years ago

I can probably pop something out this weekend if someone else does not get to it and time permits. The above should change the behavior depending on what the ruby file is describing (Model,View,Controller, Interactor, etc...)

I wanted to use the gem on an undocumented project I inherited. Thanks for the gem either way, it helped with a convoluted Model schema I worked with. I think that would make a killer feature for the future :)

Nedomas commented 9 years ago

Hey, Michael.

I'm running into it myself too. How did it go for you?

michaelachrisco commented 9 years ago

Sorry never got around to this feature. And I just got put on another huge project.... When I get free time, ill revisit.

Nedomas commented 8 years ago

Let me know if you're still interested in it.