test/simulation_test.rb in y_petri-2.1.7 vs test/simulation_test.rb in y_petri-2.1.9
- old
+ new
@@ -11,22 +11,22 @@
before do
@w = YPetri::World.new
end
it "should allow for creation of an empty simulation" do
- net = @w.Net.new
+ net = @w.Net.send :new
sim = net.simulation
sim.pp.must_equal []
sim.pp( *[] ).must_equal []
sim.tt.must_equal( [] )
sim.tt( *[] ).must_equal []
end
describe "simulation setup" do
before do
- @p = @w.Place.new name: :A, default_marking: 1
- @q = @w.Place.new name: :B, default_marking: 2
+ @p = @w.Place.send :new, name: :A, default_marking: 1
+ @q = @w.Place.send :new, name: :B, default_marking: 2
@net = @w.Net.of @p, @q
end
it "should allow to set up a simplistic simulation instance" do
@net.simulation
@@ -78,13 +78,13 @@
end
end # describe simulation step
describe "transition representation aspects" do
before do
- @ts = @w.Transition.new name: "T_ts", codomain: :A, action: -> { 1 }
- @tS = @w.Transition.new name: "T_tS", s: { B: -1, A: 1 }, action: proc { 1 }
- @Ts = @w.Transition.new name: "T_Ts", codomain: :A, rate: -> { 1 }
- @TS = @w.Transition.new name: "T_TS", s: { B: -1, A: 1 }, rate: proc { 1 }
+ @ts = @w.Transition.send :new, name: "T_ts", codomain: :A, action: -> { 1 }
+ @tS = @w.Transition.send :new, name: "T_tS", s: { B: -1, A: 1 }, action: proc { 1 }
+ @Ts = @w.Transition.send :new, name: "T_Ts", codomain: :A, rate: -> { 1 }
+ @TS = @w.Transition.send :new, name: "T_TS", s: { B: -1, A: 1 }, rate: proc { 1 }
end
it "should be what intended" do
@ts.type.must_equal :ts
@ts.domain.must_equal []