require 'test/unit' require 'isrbot' class TestISRBot < Test::Unit::TestCase def setup @bot = ISRBot.new end def test_user_commands actual, s = @bot.send("isragent: loud") assert_match(/My thresh(?:h)?old is now 0/, actual) actual, s = @bot.send("isrbot: quiet") assert_match(/My thresh(?:h)?old is now 1/, actual) actual, s = @bot.send("isr: what is your threshhold?") assert_match(/My thresh(?:h)?old is (?:currently )?1/, actual) actual, s = @bot.send("srbot: set safe level to high") assert_match(/safe level/, actual) actual, s = @bot.send("sragent: what is your safe level?") assert_match(/on/, actual) actual, s = @bot.send("sr: turn off the safety level please") assert_match(/off/, actual) end def test_sr actual, s = @bot.send("!sr In California, you can always find a party.") assert_match(/the party can always find YOU/, actual) actual, s = @bot.send("In California, you can always find a party.") assert_match(/the party can always find YOU/, actual) end end # class