-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Test adapter #714
Test adapter #714
Conversation
describe "The Hubot Script", () -> | ||
robot = null | ||
beforeEach () -> | ||
robot = new Robot testAdapter, "test", false, "hubot" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line is actually a lie. I don't know how to specify the path here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this only worked because hubot-deploy had this in a directory somewhere 😓
bin/hubot
is the thing that actually determines this path: https://github.com/github/hubot/blob/master/bin/hubot#L73-L75
omg thank you 💖 Also worth noting that https://github.com/blalor/hubot-mock-adapter is a thing. Not sure how it differs yet. |
it "displays the version", () -> | ||
robot.adapter.receiveText("hubot deploy:version") | ||
expected = "hubot-deploy v#{Version}/hubot v2.7.5/node v0.10.21" | ||
assert.equal expected, robot.adapter.history |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
robot.adapter.history
is an array, right?
I found this and I'm digging it. |
It doesn't actually depend on hubot, so maybe we can actually use that internally. But maybe that'd be weird? |
Hwhoops, was reading dev dependencies, and it does depend on hubot. It'd still be nice to internal for testing still. |
Feel free to run with this. I'll let you guys decide. 😃 |
Maybe we pull in the changes in the repo I linked to? I'm using it and kinda like it. |
Heyo! So... is the consensus that hubot-test-helper is better than hubot-mock-adapter? Have used the latter, but not the former. Was going to add some tests to a repo, and then submit the change to generator-hubot-scripts if it seemed simpler. |
I'm pretty happy with it, personally. |
Rockin. Don't suppose you've had a chance to test notifier scripts using the router? If you have and could point me to a reference, that'd be grand. But otherwise, I'll figure it out and doc it afterward |
This is useful for testing standalone scripts. It has a simple array to capture responses availables as
#history
.It looks like this in your tests.