require 'test/unit' require 'montybot' class TestMontyBot < Test::Unit::TestCase def setup @monty = MyAgent.new end def test_pos actual = @monty.send('subject: John ate an apple.') assert_match(/John/, actual) actual = @monty.send('Verb: John ate an apple.') assert_match(/ate/, actual) actual = @monty.send('object: "John ate an apple."') assert_match(/an apple/, actual) end end