Skip to content

Commit

Permalink
fix for :if => '${a}' when a like '456ab'
Browse files Browse the repository at this point in the history
(Thanks John Le)
  • Loading branch information
jmettraux committed Mar 23, 2011
1 parent c19f90c commit 64508da
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.txt
Expand Up @@ -4,6 +4,7 @@

== ruote - 2.2.1 not yet released

- fix for :if => '${a}' when a like '456ab' (Thanks John Le)
- StorageParticipant :count => true uniformization (Thanks Jan Topiński)
- StorageParticipant#by_fei (alias for #[])

Expand Down
6 changes: 5 additions & 1 deletion lib/ruote/exp/condition.rb
Expand Up @@ -103,7 +103,11 @@ def self.parse(conditional)
"/!\\ please upgrade your rufus-treechecker gem /!\\"
)

rescue => e
rescue SyntaxError => se

[ :str, conditional ]

rescue Exception => e

[ :false ]
end
Expand Down
20 changes: 20 additions & 0 deletions test/functional/ft_10_dollar.rb
Expand Up @@ -264,5 +264,25 @@ def test_literally_and_participant_params
{ 'b' => %w[ A B C ], 'ref' => 'alpha' },
r['workitem']['fields']['parameters'])
end

# Issue pointed out by John Le.
#
def test_not_a_number

pdef = Ruote.define do
echo 'a0', :if => '${a}'
echo 'a1', :if => '${a} is set'
echo 'b', :if => '${b}'
echo 'c'
end

wfid = @engine.launch(
pdef,
'a' => '0a')

@engine.wait_for(wfid)

assert_equal "a0\na1\nc", @tracer.to_s
end
end

0 comments on commit 64508da

Please sign in to comment.