diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 8a694350..299addc6 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -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 #[]) diff --git a/lib/ruote/exp/condition.rb b/lib/ruote/exp/condition.rb index 340ce2a2..7c7140e5 100644 --- a/lib/ruote/exp/condition.rb +++ b/lib/ruote/exp/condition.rb @@ -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 diff --git a/test/functional/ft_10_dollar.rb b/test/functional/ft_10_dollar.rb index d5174c10..6d25695f 100644 --- a/test/functional/ft_10_dollar.rb +++ b/test/functional/ft_10_dollar.rb @@ -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