rooibos-roku 5.2.0 → 5.2.1
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.
|
@@ -1121,23 +1121,26 @@ namespace rooibos
|
|
|
1121
1121
|
|
|
1122
1122
|
end function
|
|
1123
1123
|
|
|
1124
|
-
function assertClass(value,
|
|
1124
|
+
function assertClass(value, func, msg = "") as dynamic
|
|
1125
1125
|
if m.currentResult.isFail
|
|
1126
1126
|
return false
|
|
1127
1127
|
end if
|
|
1128
|
+
if rooibos.Common.isFunction(func)
|
|
1129
|
+
func = value.toStr().mid(10).replace("_", ".")
|
|
1130
|
+
end if
|
|
1128
1131
|
try
|
|
1129
1132
|
if not Rooibos.Common.isAssociativeArray(value)
|
|
1130
1133
|
if msg = ""
|
|
1131
1134
|
expr_as_string = Rooibos.Common.asString(value)
|
|
1132
|
-
msg = expr_as_string + " was not an aa, so could not match Class " +
|
|
1135
|
+
msg = expr_as_string + " was not an aa, so could not match Class " + func
|
|
1133
1136
|
end if
|
|
1134
1137
|
m.currentResult.fail(msg, m.currentAssertLineNumber)
|
|
1135
1138
|
return false
|
|
1136
1139
|
end if
|
|
1137
1140
|
className = `${value.__classname}`
|
|
1138
|
-
if className <>
|
|
1141
|
+
if className <> func
|
|
1139
1142
|
if msg = ""
|
|
1140
|
-
msg = `Expected class: ${
|
|
1143
|
+
msg = `Expected class: ${func} got ${className}`
|
|
1141
1144
|
end if
|
|
1142
1145
|
m.currentResult.fail(msg, m.currentAssertLineNumber)
|
|
1143
1146
|
return false
|