rooibos-roku 5.15.3 → 5.15.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -593,7 +593,7 @@ namespace rooibos
593
593
  return false
594
594
  end if
595
595
 
596
- if not aa.DoesExist(key)
596
+ if not aa.ifAssociativeArray.DoesExist(key)
597
597
  if msg = ""
598
598
  actual = rooibos.common.asMultilineString(aa, true)
599
599
  msg = `expected "${rooibos.common.truncateString(actual)}" to have property "${key}"`
@@ -635,7 +635,7 @@ namespace rooibos
635
635
  return false
636
636
  end if
637
637
 
638
- if aa.DoesExist(key)
638
+ if aa.ifAssociativeArray.DoesExist(key)
639
639
  if msg = ""
640
640
  actual = rooibos.common.asMultilineString(aa, true)
641
641
  msg = `expected "${rooibos.common.truncateString(actual)}" to not have property "${key}"`
@@ -688,7 +688,7 @@ namespace rooibos
688
688
  foundKeys = []
689
689
  missingKeys = []
690
690
  for each key in keys
691
- if not aa.DoesExist(key)
691
+ if not aa.ifAssociativeArray.DoesExist(key)
692
692
  missingKeys.push(key)
693
693
  else
694
694
  foundKeys.push(key)
@@ -747,7 +747,7 @@ namespace rooibos
747
747
 
748
748
  foundKeys = []
749
749
  for each key in keys
750
- if aa.DoesExist(key)
750
+ if aa.ifAssociativeArray.DoesExist(key)
751
751
  foundKeys.push(formatJson(key))
752
752
  end if
753
753
  end for
@@ -1121,11 +1121,17 @@ namespace rooibos
1121
1121
  return false
1122
1122
  end if
1123
1123
 
1124
- if array.count() <> count
1124
+ if rooibos.common.isAssociativeArray(array)
1125
+ actualCount = array.ifAssociativeArray.count()
1126
+ else
1127
+ actualCount = array.count()
1128
+ end if
1129
+
1130
+ if actualCount <> count
1125
1131
  if msg = ""
1126
- msg = `expected count "${array.Count()}" to be "${count}"`
1132
+ msg = `expected count "${actualCount}" to be "${count}"`
1127
1133
  end if
1128
- m.currentResult.fail(msg, m.currentAssertLineNumber, rooibos.common.asMultilineString(array.count(), true), rooibos.common.asMultilineString(count, true))
1134
+ m.currentResult.fail(msg, m.currentAssertLineNumber, rooibos.common.asMultilineString(actualCount, true), rooibos.common.asMultilineString(count, true))
1129
1135
  return false
1130
1136
  end if
1131
1137
  return true
@@ -1169,9 +1175,15 @@ namespace rooibos
1169
1175
  return false
1170
1176
  end if
1171
1177
 
1172
- if array.count() = count
1178
+ if rooibos.common.isAssociativeArray(array)
1179
+ actualCount = array.ifAssociativeArray.count()
1180
+ else
1181
+ actualCount = array.count()
1182
+ end if
1183
+
1184
+ if actualCount = count
1173
1185
  if msg = ""
1174
- msg = `expected count "${array.count()}" to not be "${count}"`
1186
+ msg = `expected count "${actualCount}" to not be "${count}"`
1175
1187
  end if
1176
1188
  m.currentResult.fail(msg, m.currentAssertLineNumber)
1177
1189
  return false
@@ -1927,7 +1939,7 @@ namespace rooibos
1927
1939
  end if
1928
1940
  end for
1929
1941
 
1930
- if foundValues.count() <> filteredSubset.count()
1942
+ if foundValues.ifAssociativeArray.count() <> filteredSubset.ifAssociativeArray.count()
1931
1943
  actual = rooibos.common.asMultilineString(foundValues, true)
1932
1944
  expected = rooibos.common.asMultilineString(filteredSubset, true)
1933
1945
  if msg = ""
@@ -1997,7 +2009,7 @@ namespace rooibos
1997
2009
  end if
1998
2010
  end for
1999
2011
 
2000
- if foundValues.count() > 0
2012
+ if foundValues.ifAssociativeArray.count() > 0
2001
2013
  actual = rooibos.common.asMultilineString(foundValues, true)
2002
2014
  expected = rooibos.common.asMultilineString({}, true)
2003
2015
  if msg = ""
@@ -2082,7 +2094,7 @@ namespace rooibos
2082
2094
  end if
2083
2095
  end for
2084
2096
 
2085
- if foundValues.count() <> filteredSubset.count()
2097
+ if foundValues.ifAssociativeArray.count() <> filteredSubset.ifAssociativeArray.count()
2086
2098
  actual = rooibos.common.asMultilineString(foundValues, true)
2087
2099
  expected = rooibos.common.asMultilineString(filteredSubset, true)
2088
2100
  if msg = ""
@@ -2528,7 +2540,7 @@ namespace rooibos
2528
2540
  throw m.errorToThrow
2529
2541
  end if
2530
2542
  'bs:disable-next-line
2531
- if type(m.returnValue) = "roAssociativeArray" and m.returnValue.doesExist("multiResult")
2543
+ if type(m.returnValue) = "roAssociativeArray" and m.returnValue.ifAssociativeArray.doesExist("multiResult")
2532
2544
  'bs:disable-next-line
2533
2545
  returnValues = m.returnValue["multiResult"]
2534
2546
  'bs:disable-next-line
@@ -2561,7 +2573,7 @@ namespace rooibos
2561
2573
  function combineFakes(fake, otherFake)
2562
2574
  'add on the expected invoked args
2563
2575
  lineNumber = m.currentAssertLineNumber
2564
- if type(fake.expectedArgs) <> "roAssociativeArray" or not fake.expectedArgs.doesExist("multiInvoke")
2576
+ if type(fake.expectedArgs) <> "roAssociativeArray" or not fake.expectedArgs.ifAssociativeArray.doesExist("multiInvoke")
2565
2577
  currentExpectedArgsArgs = fake.expectedArgs
2566
2578
  fake.expectedArgs = {
2567
2579
  "multiInvoke": [currentExpectedArgsArgs]
@@ -2572,7 +2584,7 @@ namespace rooibos
2572
2584
  end for
2573
2585
 
2574
2586
  'add on the expected return values
2575
- if type(fake.returnValue) <> "roAssociativeArray" or not fake.returnValue.doesExist("multiResult")
2587
+ if type(fake.returnValue) <> "roAssociativeArray" or not fake.returnValue.ifAssociativeArray.doesExist("multiResult")
2576
2588
  currentReturnValue = fake.returnValue
2577
2589
  fake.returnValue = {
2578
2590
  "multiResult": [currentReturnValue]
@@ -2613,7 +2625,14 @@ namespace rooibos
2613
2625
  else
2614
2626
  expectedArgs = mock.expectedArgs
2615
2627
  end if
2616
- for i = 0 to expectedArgs.count() - 1
2628
+
2629
+ if rooibos.common.isAssociativeArray(expectedArgs)
2630
+ expectedArgsCount = expectedArgs.ifAssociativeArray.count()
2631
+ else
2632
+ expectedArgsCount = expectedArgs.count()
2633
+ end if
2634
+
2635
+ for i = 0 to expectedArgsCount - 1
2617
2636
  value = invokedArgs[i]
2618
2637
  expected = expectedArgs[i]
2619
2638
  didNotExpectArg = rooibos.common.isString(expected) and expected = m.invalidValue
@@ -336,7 +336,7 @@ namespace rooibos.common
336
336
  end if
337
337
 
338
338
  text = "{" + chr(10)
339
- keys = input.keys()
339
+ keys = input.ifAssociativeArray.keys()
340
340
  keys.sort()
341
341
  for each key in keys
342
342
  if rooibos.common.canSafelyIterateAAKey(input, key)
@@ -413,7 +413,7 @@ namespace rooibos.common
413
413
  'bs:disable-next-line
414
414
  isFirst = false
415
415
  end if
416
- keys = input.keys()
416
+ keys = input.ifAssociativeArray.keys()
417
417
  keys.sort()
418
418
  for each key in keys
419
419
  if rooibos.common.canSafelyIterateAAKey(input, key)
@@ -614,7 +614,7 @@ namespace rooibos.common
614
614
  compareValue = array[i]
615
615
 
616
616
  if compareAttribute <> invalid and rooibos.common.isAssociativeArray(compareValue)
617
- compareValue = compareValue.lookupCI(compareAttribute)
617
+ compareValue = compareValue.ifAssociativeArray.lookupCI(compareAttribute)
618
618
  end if
619
619
 
620
620
  if rooibos.common.eqValues(compareValue, value, callCount + 1)
@@ -862,14 +862,14 @@ namespace rooibos.common
862
862
  if not rooibos.common.isAssociativeArray(Value1) or not rooibos.common.isAssociativeArray(Value2)
863
863
  return false
864
864
  end if
865
- l1 = Value1.Count()
866
- l2 = Value2.Count()
865
+ l1 = Value1.ifAssociativeArray.Count()
866
+ l2 = Value2.ifAssociativeArray.Count()
867
867
 
868
868
  if not l1 = l2
869
869
  return false
870
870
  else
871
871
  for each k in Value1
872
- if not Value2.DoesExist(k)
872
+ if not Value2.ifAssociativeArray.DoesExist(k)
873
873
  return false
874
874
  else
875
875
  if rooibos.common.canSafelyIterateAAKey(Value1, k) and rooibos.common.canSafelyIterateAAKey(Value2, k)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rooibos-roku",
3
- "version": "5.15.3",
3
+ "version": "5.15.4",
4
4
  "description": "simple, flexible, fun brightscript test framework for roku scenegraph apps - roku brighterscript plugin",
5
5
  "scripts": {
6
6
  "preversion": "npm run build && npm run lint && npm run test",