#
# Testing OpenWFEru
#
# John Mettraux at openwfe.org
#
require 'flowtestbase'
require 'pending'
require 'openwfe/def'
class FlowTest57 < Test::Unit::TestCase
include FlowTestBase
#def setup
#end
#def teardown
#end
#
# Test 0
#
class Test0 < OpenWFE::ProcessDefinition
sequence do
_set :field => "list" do
_a """
a
b
c
"""
end
_print "${r:wi.list.join('|')}"
_print "-"
_set :field => "list" do
_attribute """
---
- a
- b
- 3
"""
end
_print "${r:wi.list.join('|')}"
end
end
def test_0
dotest(
Test0,
"""
a|b|c||true
-
a|b|3
""".strip)
end
def test_1
dotest(
"""
---
- c
- d
- e
${r:wi.list.join('|')}
""",
"c|d|e")
end
def test_2
dotest(
"""
a
2
c
${r:wi.list.join('|').strip}
""",
"a|2|c|false")
end
#
# Test 3
#
class Test3 < OpenWFE::ProcessDefinition
sequence do
_set :field => "other" do
reval { "77" }
end
_print "${f:other}"
end
end
def test_3
dotest Test3, "77"
end
#
# Test 4
#
class Test4 < OpenWFE::ProcessDefinition
sequence do
set :field => "other" do
a '[1,2,3,false,"toto"]'
end
_print "${f:other}"
end
end
def test_4
dotest Test4, "123falsetoto"
end
end