-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dredd::Rack should allow to write Dredd hooks in Ruby #7
Comments
The Apiary team did a great work on this! See the newly released Ruby Hook Handlers and the corresponding Dredd feature! :D This Dredd::Rack feature should definitely be built on the |
Hey @gonzalo-bulnes any news on this ? Do you have any starting point I can look at ? |
Hi @gottfrois, News: the Dredd Hooks gem is pretty much ready to be used as a library (it was primarily built to provide a CLI). Which means that Dredd::Rack can depend on it to manage the communication with Dredd and provide hooks support. The API of the # So far the Dredd Hooks library is only used by the Dredd Hooks CLI.
require 'dredd_hooks'
out = STDOUT
error = STDERR
# Load the hook files
DreddHooks::FileLoader.load(hook_files)
# Run the server
out.puts 'Starting Ruby Dredd Hooks Worker...'
server = DreddHooks::Server.new(error, out)
server.run Some context to get started I've been gathering a few thoughts and a first attempt of raodmap on a Trello card. Reflecting on that, I should probably have gathered them in this issue instead - they would have been publicly accessible. Anyway, I'm reproducing them here (chronological order): Ideas
Roadmap
Out of that, I think it's worth first defining how Dredd::Rack would be used once it supports running hooks, what the directories layout would look like (default values) - in a README-driven development spirit - so that we can then write specs and test-drive it easily. Does it make sense to you? That could be done in this issue, I think, or editing the By the way, it is worth mentioning that I don't have a schedule on this, so no pressure. I'm happy to spend more time on it if you're interested though. : ) Let me know! |
Thanks for the detailed answer! I'll be happy to help you get to speed on that project. I'm using is in the company I work for and for now the main bottleneck is the lack of hooks support for creating objects in databases based on our Rails models. Today I cheat by doing the following:
And create some object before test suits in As I said, I'll be glad to help define standards that make sense to both of us. Maybe you could create a github "project" for that repository with your trello like cards? |
Hi @gottfrois, I'm glad to hear that! :D I'm exploring the Projects documentation... I'm not sure there is need for that much, but I created a first project to see how it goes. First question: can you see it, use it? I didn't find any way to add collaborators to the project itself, but I expect it to behave like the wiki. To discuss how Dredd::Rack should behave / be used once support for Dredd hooks is implemented, I think an issue is probably enough. However, I'm adding The idea is making the upcoming changes visible while we make progress on the implementation. See #38. Comments welcome of course. Next step I'll start moving the ideas I mentioned in my previous comment to the draft README ( What do you think about directory names, the helper name? I'm following the RSpec pattern here, I can explain the idea a bit further if you want.
|
Regarding folder names, I like the following
I can imagine the following structure:
Of course I would strongly advice an option in |
I just started using Dredd and quickly realized I was going to need to use hooks. After getting everything running I stumbled across this project this morning. I guess my question is what am I missing with using |
As a developer
In order to be able to take profit of my habitual testing tools (e.g. FactoryGirl) to setup documentation and testing scenarios
I want to be able to write Dredd hooks in Ruby
See also: the original discussions and this proof of concept.
The text was updated successfully, but these errors were encountered: