From c9f906f80325a12a6509633d87472bd3cbaf0364 Mon Sep 17 00:00:00 2001 From: Yanis Guenane Date: Mon, 15 Sep 2014 14:16:52 -0400 Subject: (MODULES-1329) Allow member function to look for array Currently, the member function allows one to only find if a variable is part of an array. Sometimes it is useful to find if an array is part of a bigger array for validation purpose. --- spec/functions/member_spec.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'spec') diff --git a/spec/functions/member_spec.rb b/spec/functions/member_spec.rb index cee6110..1a1d7c6 100755 --- a/spec/functions/member_spec.rb +++ b/spec/functions/member_spec.rb @@ -21,4 +21,14 @@ describe "the member function" do result = scope.function_member([["a","b","c"], "d"]) expect(result).to(eq(false)) end + + it "should return true if a member array is in an array" do + result = scope.function_member([["a","b","c"], ["a", "b"]]) + expect(result).to(eq(true)) + end + + it "should return false if a member array is not in an array" do + result = scope.function_member([["a","b","c"], ["d", "e"]]) + expect(result).to(eq(false)) + end end -- cgit v1.2.3