test/misctest.rb in openwferu-0.9.0 vs test/misctest.rb in openwferu-0.9.1

- old
+ new

@@ -6,10 +6,11 @@ # # Sun Oct 29 16:18:25 JST 2006 # require 'test/unit' +require 'utils' require 'ru/ruutils' require 'ru/expressionmap' require 'ru/fe_define' # @@ -40,7 +41,36 @@ "class of 'process-definition' should be DefineExpression" assert \ em.is_definition?('process-definition'), "process-definition should be considered as a definition" end + + def test_dup + a0 = A.new + a0.a = 1 + a0.b = 2 + a1 = OpenWFE::dup(a0) + + #puts a0 + #puts a1 + + assert \ + a0.equals(a1), + "dup() utility not working" + end + + private + + class A + attr_accessor :a, :b + + def equals (other) + return false if not other.kind_of?(A) + return (self.a == other.a and self.b == other.b) + end + + def to_s + "A : a='#{a}', b='#{b}'" + end + end end