hybridgroup/artoo — pull request #29 by deadprogram (2013-05-19 02:27:13+00:00)
Title: Test-driven robotics

You can now write your robots using Test Driven Development aka Test Driven Robotics.

Here is an example from https://gist.github.com/deadprogram/5605359 that uses MiniTest and Mocha:

```ruby
require File.expand_path(File.dirname(__FILE__) + "/test_helper")

describe 'sphero' do
let(:robot) { Artoo::MainRobot.new }

it 'has work to do every 3 seconds' do
robot.work

robot.has_work?(:every, 3.seconds).wont_be_nil
end

it 'must roll every 3 seconds' do
robot.sphero.expects(:roll).twice

robot.work
sleep 6.1
end

it 'receives collision event' do
robot.expects(:contact)

robot.work
robot.sphero.publish("collision", "clunk")
sleep 0.1
end
end
```

You should be able to use any test and mocking frameworks you want, as long as they work with Celluloid.