JMongol/twilio-test-toolkit — pull request #10 by pgib (2014-01-13 08:10:50+00:00)
Title: Dynamic methods in call scope

Take advantage of Ruby's dynamic nature to make future additions for TwiML nouns and verbs tests a little easier. Calling `#has_foo?` or `#has_foo?("bar")` will work for any foo will now just work. When passed "bar", the default behaviour is to do a substring match on the element's `.inner_text` property. If an exact match is needed as the case was/is with `#has_play?`, a class call to `#has_element` will be necessary. e.g.:

has_element "Foo", :exact_inner_match => true

This will create `#has_foo?(inner)` using an exact match.

There is also a `has_bar_on_foo?(bat)` pattern where bar can either be the equivalent of TwiML-style lowercase camelCase attributes, or a Ruby snake_case. The following two calls are same:

has_finishOnKey_on_record?("#")
has_finish_on_key_on_record("#")

... which will check for: