I just recently started unit testing my ruby stuff, works wonder. But,
how do I test my Adhearsion dial plans? If someone could share a
simple test or so, to get me started.
Thanks,
Harry
for most applications all you are doing is sending in keys and
listening to sounds right? Why not mock something that instead of
playing a wave file just returns the path to the wave file. The test
can be some like.
s = sendkey 1
assert_equals s, '/var/lib/sounds/en/you_pressed_the_wrong_key'
s= sendkey 2
assert_equals s, '/var/lib/asterisk/sounds/en/you_pressed_the_right_key
Anyway you get the idea.