test/place_test.rb in y_petri-2.2.4 vs test/place_test.rb in y_petri-2.3.2
- old
+ new
@@ -1,8 +1,9 @@
#! /usr/bin/ruby
# encoding: utf-8
+gem 'minitest'
require 'minitest/autorun'
require_relative '../lib/y_petri' # tested component itself
# require 'y_petri'
# require 'sy'
@@ -13,35 +14,38 @@
marking: 1.1,
quantum: 0.1,
name: "P1"
p.namespace.must_equal YPetri::Place
p.name.must_equal :P1
- p.inspect[0..7].must_equal "#<Place:"
- p.to_s[0..2].must_equal 'P1['
+ p.inspect[0..7].must_equal "P1"
+ p.to_s[0..1].must_equal 'P1'
p.marking.must_equal 1.1 # Attention, #marking overloaded with guard setup!
p.quantum.must_equal 0.1
p.add 1
p.value.must_equal 2.1 # near-alias of #marking (no guard setup)
p.subtract 0.5
- p.m.must_equal 1.6 # alias of #value
+ p.marking.must_equal 1.6 # alias of #value
p.reset_marking
p.marking.must_equal 3.2
p.marking = 42
- p.m.must_equal 42
- p.m = 43
- p.m.must_equal 43
+ p.marking.must_equal 42
+ p.marking = 43
+ p.marking.must_equal 43
p.value = 44
- p.m.must_equal 44
+ p.marking.must_equal 44
p.upstream_arcs.must_equal []
p.upstream_transitions.must_equal [] # alias of #upstream_arcs
p.ϝ.must_equal [] # alias of #upstream_arcs
p.downstream_arcs.must_equal []
p.downstream_transitions.must_equal [] # alias of #downstream_arcs
p.arcs.must_equal [] # all arcs
p.precedents.must_equal []
p.upstream_places.must_equal [] # alias for #precedents
p.dependents.must_equal []
p.downstream_places.must_equal [] # alias for #dependents
+ p.upstream_net.places.must_equal []
+ p.downstream_net.places.must_equal []
+ p.local_net.places.must_equal []
# fire methods
assert_respond_to p, :fire_upstream
assert_respond_to p, :fire_upstream!
assert_respond_to p, :fire_downstream
assert_respond_to p, :fire_downstream!