require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') include Fathom describe Simulation do before do @da = DemoAgent.new @s = Simulation.new(@da) end it "should initialize with a list of agents" do s = Simulation.new(1,2,3) s.agents.should eql([1,2,3]) end it "should register agent callbacks for simpler execution" do @da.should_receive(:on_tick).and_return(true) @s.tick end it "should publish agent subscription to various callbacks to facilitate agent-to-agent communication" do @s.agents_using_tick.should eql([@da]) end end