test/lookup_vf_test.rb in ruote-0.9.18 vs test/lookup_vf_test.rb in ruote-0.9.19
- old
+ new
@@ -14,81 +14,81 @@
require 'openwfe/expressions/expressionmap'
class LookupVfTest < Test::Unit::TestCase
- #def setup
- #end
+ #def setup
+ #end
- #def teardown
- #end
+ #def teardown
+ #end
- def test_0
+ def test_0
- fexp = new_exp({
- "on-value" => "toto"
- })
- wi = new_wi({
- "toto" => "whatever"
- })
+ fexp = new_exp({
+ "on-value" => "toto"
+ })
+ wi = new_wi({
+ "toto" => "whatever"
+ })
- assert_equal(
- "toto",
- fexp.lookup_vf_attribute(wi, "value", :prefix => "on"))
+ assert_equal(
+ "toto",
+ fexp.lookup_vf_attribute(wi, "value", :prefix => "on"))
- fexp = new_exp({ "on-variable-value" => "toto" }, { "toto" => "surf" })
+ fexp = new_exp({ "on-variable-value" => "toto" }, { "toto" => "surf" })
- assert_equal(
- "surf",
- fexp.lookup_vf_attribute(wi, "value", :prefix => "on"))
+ assert_equal(
+ "surf",
+ fexp.lookup_vf_attribute(wi, "value", :prefix => "on"))
- fexp = new_exp({ "on-field-value" => "toto" })
+ fexp = new_exp({ "on-field-value" => "toto" })
- assert_equal(
- "whatever",
- fexp.lookup_vf_attribute(wi, "value", :prefix => "on"))
- end
+ assert_equal(
+ "whatever",
+ fexp.lookup_vf_attribute(wi, "value", :prefix => "on"))
+ end
- def test_1
+ def test_1
- fexp = new_exp({
- "on" => "surf"
- })
- wi = new_wi
+ fexp = new_exp({
+ "on" => "surf"
+ })
+ wi = new_wi
- assert_equal(
- "surf",
- fexp.lookup_vf_attribute(wi, "", :prefix => "on"))
+ assert_equal(
+ "surf",
+ fexp.lookup_vf_attribute(wi, "", :prefix => "on"))
- assert_equal(
- "surf",
- fexp.lookup_vf_attribute(wi, "", :prefix => :on))
- end
+ assert_equal(
+ "surf",
+ fexp.lookup_vf_attribute(wi, "", :prefix => :on))
+ end
- protected
+ protected
- def new_exp (atts, vars={})
+ def new_exp (atts, vars={})
- fexp = OpenWFE::ParticipantExpression.new
- fexp.attributes = atts
+ fexp = OpenWFE::ParticipantExpression.new
+ fexp.attributes = atts
- fexp.instance_variable_set :@vars, vars
+ fexp.instance_variable_set :@vars, vars
- class << fexp
- def lookup_variable (var_name)
- @vars[var_name]
- end
- end
-
- fexp
+ class << fexp
+ def lookup_variable (var_name)
+ @vars[var_name]
end
+ end
- def new_wi (atts={})
+ fexp
+ end
- wi = OpenWFE::InFlowWorkItem.new
- wi.attributes = atts
- wi
- end
+ def new_wi (atts={})
+
+ wi = OpenWFE::InFlowWorkItem.new
+ wi.attributes = atts
+ wi
+ end
end