Tests and Mocks in RSpec

Tests and Mocks A developer approaching TDD and BDD often feels flooded by new concepts and terminology that pop up in tutorials and blog posts. One such item is certainly mocking, referring to a specific class of testing framework functionality that allows for replacement of real objects with “stunt doubles”, composed of limited functionality and […]

Plugins in Adhearsion 2.0 – Part 2

Find Part 1 of this series here. In our exploration of a newly generated plugin, we have so far mostly looked at the facilities Adhearsion 2.0 provides to hook into the framework and your application. It is now time to actually build some new business logic, although it is entirely possible to have a plugin […]

Plugins in Adhearsion 2.0 – Part 1

The ability to easily add reusable functionality to a framework is one of the most important features. Plugins in Adhearsion 2.0 have been completely rebuilt to better suit the new structure and allow them to provide a wider variety of features. Controller methods, initializer code, specific configuration, rake tasks and included generators all are possible […]

Adhearsion 2: Call Controllers & Routing

In Adhearsion applications based on Adhearsion 1.x and earlier, the most popular way to write the meat of the application was directly in dialplan.rb, and applications would look something like this: adhearsion { case variables[:dnid] when /789/ +calls_to_the_top_secret_number else +everyone_else end } calls_to_the_top_secret_number { menu ‘choose-your-top-secret-operation’ do link.turn_off_the_lights 1 link.open_the_pod_bay_doors 2 end } turn_off_the_lights { […]