array_logic 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -113,7 +113,7 @@ module ArrayLogic
113
113
 
114
114
  # examples: a1, a2, a33, t1
115
115
  def thing_id_pattern
116
- /\w\d+/
116
+ /[a-zA-Z]\d+/
117
117
  end
118
118
 
119
119
  def ids_include_this_id
@@ -1,10 +1,16 @@
1
1
  module ArrayLogic
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
3
3
  end
4
4
 
5
5
  # History
6
6
  # =======
7
7
  #
8
+ # Version 0.2.3
9
+ # -------------
10
+ # Bug fix: Identification of ids in rule would see a number preceded by a number
11
+ # as a valid id. So 51 would be seen as 1, and 34 as 4. Updated id pattern to
12
+ # only return numbers that are preceded by a letter.
13
+ #
8
14
  # Version 0.2.2
9
15
  # -------------
10
16
  # Refactor to allow functions to be more flexible. That's is, to handle unexpected
@@ -414,11 +414,21 @@ module ArrayLogic
414
414
  assert_equal([1, 2, 3, 4], @rule.object_ids_used)
415
415
  end
416
416
 
417
- def test_object_ids_user_does_not_return_duplicates
417
+ def test_object_ids_used_does_not_return_duplicates
418
418
  @rule.rule = 't1 and t2 and (2 in t1 t2)'
419
419
  assert_equal([1, 2], @rule.object_ids_used)
420
420
  end
421
421
 
422
+ def test_object_ids_used_with_function
423
+ @rule.rule = 'sum(:cope_index) > 10'
424
+ assert_equal([], @rule.object_ids_used)
425
+ end
426
+
427
+ def test_object_ids_used_with_function_and_valid_ids
428
+ @rule.rule = 't1 and t2 and (sum(:cope_index) > 10)'
429
+ assert_equal([1, 2], @rule.object_ids_used)
430
+ end
431
+
422
432
  def test_matching_combinations
423
433
  @rule.rule = 't1 or t2'
424
434
  assert_equal([[1], [2], [1,2]], @rule.matching_combinations)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: array_logic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: