Sha256: 4edf6e93171df16176c73a01155ae310ce272cb3cc85bc9c88240045f99cf6b3

Contents?: true

Size: 598 Bytes

Versions: 11

Compression:

Stored size: 598 Bytes

Contents

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

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
fathom-0.3.7 spec/fathom/simulation_spec.rb
fathom-0.3.6 spec/fathom/simulation_spec.rb
fathom-0.3.4 spec/fathom/simulation_spec.rb
fathom-0.3.3 spec/fathom/simulation_spec.rb
fathom-0.3.2 spec/fathom/simulation_spec.rb
fathom-0.3.1 spec/fathom/simulation_spec.rb
fathom-0.3.0 spec/fathom/simulation_spec.rb
fathom-0.2.3 spec/fathom/simulation_spec.rb
fathom-0.2.2 spec/fathom/simulation_spec.rb
fathom-0.2.1 spec/fathom/simulation_spec.rb
fathom-0.2.0 spec/fathom/simulation_spec.rb