From c8246d1e6623bdb40230cc0c6183c1f6db208357 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Mon, 15 Mar 2021 10:29:32 +0100 Subject: [PATCH] Adjusted RBA tests --- testdata/ruby/tlTest.rb | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/testdata/ruby/tlTest.rb b/testdata/ruby/tlTest.rb index 082875981..e1ffbab16 100644 --- a/testdata/ruby/tlTest.rb +++ b/testdata/ruby/tlTest.rb @@ -262,17 +262,29 @@ class Tl_TestClass < TestBase end + class MyRecipeExecutable < RBA::Executable + + def initialize(params) + @params = params + end + + def execute + a = @params["A"] || 0 + b = @params["B"] || 0.0 + c = @params["C"] || 1.0 + b * a * c + end + + end + class MyRecipe < RBA::Recipe def initialize super("rba_test_recipe", "description") end - def execute(params) - a = params["A"] || 0 - b = params["B"] || 0.0 - c = params["C"] || 1.0 - b * a * c + def executable(params) + return MyRecipeExecutable::new(params) end end @@ -291,7 +303,7 @@ class Tl_TestClass < TestBase g = my_recipe.generator("A" => 6, "B" => 7.0) assert_equal(g, "rba_test_recipe: A=#6,B=##7") - assert_equal("%g" % RBA::Recipe::make(g).to_s, "42") + assert_equal("%g" % RBA::Recipe::make(g), "42") assert_equal("%g" % RBA::Recipe::make(g, "C" => 1.5).to_s, "63") my_recipe._destroy