assay 0.5.0 → 0.5.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.
- checksums.yaml +4 -4
- data/HISTORY.md +8 -0
- data/lib/assay/ae/assertor.rb +1 -3
- data/lib/assay/equal_assay.rb +1 -2
- data/lib/assay/unequal_assay.rb +1 -2
- data/lib/assay/version.rb +1 -1
- data/lib/assay.rb +14 -0
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c35151f3b2a465e249b0700fe61389803993e32bd5803e46ae9951145836c392
|
|
4
|
+
data.tar.gz: 4c250ff84fb21cb015d915c5e3b29586f66c398b12f406df1fe83f4cac21c95d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c8cdd4af975c2ca97bf3369ab6f25ac4290d26f70cdc8074c685f24f875f41aaf4e2f64d116050ee9ebb913161f69bdfed6eb24ad0d5741cfb01f52122d69c18
|
|
7
|
+
data.tar.gz: 10f2e587dbe381a251389ce957178a30068b1dc212b3c44d2f19f0a6c7b817be0d94da68963a374ca85e6b57999a5549b3e86badb81457647add22e4423dc3d7
|
data/HISTORY.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# HISTORY
|
|
2
2
|
|
|
3
|
+
## 0.5.1 | 2026-11-24
|
|
4
|
+
|
|
5
|
+
* Fix a `NameError` (`uninitialized constant ANSI::Diff`) raised in
|
|
6
|
+
place of a failed comparison when the values are long and color is
|
|
7
|
+
on but was not turned on with `Assay.color = true`. That is the usual
|
|
8
|
+
case under Rubytest, since the ANSI gem turns color on when it loads.
|
|
9
|
+
It affected `EqualAssay`, `UnequalAssay` and the AE notation.
|
|
10
|
+
|
|
3
11
|
## 0.5.0 | 2026-11-23
|
|
4
12
|
|
|
5
13
|
Assay is one library again. The notations that were spun off as separate
|
data/lib/assay/ae/assertor.rb
CHANGED
|
@@ -417,9 +417,7 @@ module Assay::AE
|
|
|
417
417
|
operator = COMPARISON_OPERATORS[operator] if @negated
|
|
418
418
|
if a.size > 13 or b.size > 13
|
|
419
419
|
if defined?($ansi) && $ansi && a.size * b.size <= DIFF_LIMIT
|
|
420
|
-
|
|
421
|
-
a = diff.diff1
|
|
422
|
-
b = diff.diff2
|
|
420
|
+
a, b = ::Assay.color_diff(a, b)
|
|
423
421
|
end
|
|
424
422
|
"a #{operator} b\na) " + a + "\nb) " + b
|
|
425
423
|
else
|
data/lib/assay/equal_assay.rb
CHANGED
data/lib/assay/unequal_assay.rb
CHANGED
data/lib/assay/version.rb
CHANGED
data/lib/assay.rb
CHANGED
|
@@ -34,6 +34,20 @@ module Assay
|
|
|
34
34
|
end
|
|
35
35
|
end
|
|
36
36
|
|
|
37
|
+
#
|
|
38
|
+
# Two inspected values with the differences between them colored, for
|
|
39
|
+
# failure messages when color is on. Color can be turned on from
|
|
40
|
+
# outside Assay (the ANSI gem sets `$ansi` when it loads), so the diff
|
|
41
|
+
# library is loaded here, where it is used.
|
|
42
|
+
#
|
|
43
|
+
# @return [Array<String>] the two values, colored
|
|
44
|
+
#
|
|
45
|
+
def self.color_diff(a, b)
|
|
46
|
+
require 'ansi/diff'
|
|
47
|
+
diff = ::ANSI::Diff.new(a, b)
|
|
48
|
+
return diff.diff1, diff.diff2
|
|
49
|
+
end
|
|
50
|
+
|
|
37
51
|
#
|
|
38
52
|
# Lookup assay class by operator or name.
|
|
39
53
|
#
|