Skip to content
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

rspec & bots - make bots testable #32

Open
davidmann4 opened this issue Dec 18, 2016 · 4 comments
Open

rspec & bots - make bots testable #32

davidmann4 opened this issue Dec 18, 2016 · 4 comments

Comments

@davidmann4
Copy link
Owner

davidmann4 commented Dec 18, 2016

@pferdefleisch @ramonh
cc: @tosh

played around with rspec to make it possible to make tests.. now I wonder how we want to do this :)

https://github.com/davidmann4/botstack/blob/master/spec/bot_spec_helper.rb
https://github.com/davidmann4/botstack/blob/master/spec/lib/basic_functionality_spec.rb

I guess we want to be able to test whole conversations?
But on the other hand rspec maybe should just cover botstack mechanics?

really curious about your opinion...

@davidmann4
Copy link
Owner Author

davidmann4 commented Dec 18, 2016

maybe something like

send_and_expect_answer "Hi bot!", "Hi Human!"
#or
send_text_expect_text "Hi bot!", "Hi Human!"
send_text_expect_image "Hi bot!", "http://host.com/img.png"
send_audio_expect_audio "http://host.com/img.mp3", "http://host.com/img.mp3"

@mraaroncruz
Copy link
Contributor

I like that API.

There's also this for acceptance tests.
It's an external server that runs your specs (written in javascript) and stands in as a fake Facebook to receive your outgoing messages. Pretty interesting route.

@davidmann4
Copy link
Owner Author

davidmann4 commented Dec 18, 2016

hmm interesting - could it be auto started with bundle exec rspec ?

for now I use webmock --> 18ea589

@mraaroncruz
Copy link
Contributor

You could write a wrapper or do something in the spec_helper to help it bootstrap, but that's not really the use case. The use case is that you write all your tests with that test library, in JavaScript. So it's likely not that interesting if you want to stick to Ruby (which you likely do and should).

Your solution fits more into the project. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants