"${f:foo} is set" and "${f:foo} is not set"

0 views
Skip to first unread message

kiko

unread,
Nov 14, 2009, 12:09:13 PM11/14/09
to ruote
hi again sorry about the print question, stayed up too late and
confused myself, thanks for testcase feedback, now getting more
comfortable with the code.

This issue I actually repeat in a test case.

Below I added a line


echo 'e', :if => '${f:e} is set'

which shouldn't echo anything cause the e field has not been set, the
test case fails now. Wondering if I'm doing something wrong.

<code>
#
# Testing Ruote (OpenWFEru)
#
# Fri Jul 3 19:46:22 JST 2009
#

require File.join(File.dirname(__FILE__), 'base')


class FtConditionalTest < Test::Unit::TestCase
include FunctionalBase

def test_string_equality

pdef = Ruote.process_definition :name => 'test' do

set :f => 'd', :val => '2'

sequence do

echo '${f:d}'

echo 'a', :if => '${f:d}'
echo 'b', :if => '${f:d} == 2'
echo 'c', :if => "${f:d} == '2'"
echo 'd', :if => '${f:d} is set'
echo 'e', :if => '${f:e} is set'
end
end

assert_trace(pdef, %w[ 2 a b d ])
end

def test_string_equality_when_space

pdef = Ruote.process_definition :name => 'test' do

set :f => 'd', :val => 'some dude'

sequence do

echo '${f:d}'

echo 'a', :if => '${f:d}'
echo 'b', :if => '${f:d} == some dude'
echo 'c', :if => "${f:d} == 'some dude'"
echo 'd', :if => '${f:d} is set'
end
end

assert_trace(pdef, "some dude\na\nb\nd")
end
end
</code>

John Mettraux

unread,
Nov 14, 2009, 11:52:16 PM11/14/09
to openwfe...@googlegroups.com
On Sun, Nov 15, 2009 at 2:09 AM, kiko <cisco...@gmail.com> wrote:
>
>        echo 'e', :if => '${f:e} is set'
>
> which shouldn't echo anything cause the e field has not been set, the
> test case fails now.  Wondering if I'm doing something wrong.

Hello Francisco,

thanks for the bug report. I fixed it :

http://github.com/jmettraux/ruote/commit/97c27bc9cf1b29f8ab7c2c0133aca2da753591d0


Cheers,

--
John Mettraux - http://jmettraux.wordpress.com

Reply all
Reply to author
Forward
0 new messages