Skip to content

rspec & bots - make bots testable #32

Open

Description

@davidmann4

@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...

Activity

  1. davidmann4 commented on Dec 18, 2016

    @davidmann4
    OwnerAuthor

    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"
  2. mraaroncruz commented on Dec 18, 2016

    @mraaroncruz
    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.

  3. davidmann4 commented on Dec 18, 2016

    @davidmann4
    OwnerAuthor

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

    for now I use webmock --> 18ea589

  4. mraaroncruz commented on Dec 25, 2016

    @mraaroncruz
    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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions