bryton-lite 1.0 → 1.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/README.md +8 -1
- data/lib/bryton/lite.rb +22 -1
- 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: a3d29d3f8b85befaa9bd1b9d78d969abf0738ffb7709f223de35d00c0c66dd15
|
4
|
+
data.tar.gz: 31b913bff6ca5fecf9800d5b6946266d7f47f89b420a7fc84ffdada04df6a7e5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2c1fdd396013d99cf3e5f82e8e6cf030eaedcf2db76f4716a14f1102f71f89bfdb2f4d73193ed53943b7737d64428b8b6b115417e1be72667f92cdaeb6268bf1
|
7
|
+
data.tar.gz: 382129cb42c7d75bafc8eec210b4dd3a5e800724ad7ba251900ef06b2b5368c7cc0eff6f6019373c3903de97bb220d2f5b3d8baa56e38424e5c8351d0d53e619
|
data/README.md
CHANGED
@@ -293,4 +293,11 @@ I've added some here for clarity.
|
|
293
293
|
}
|
294
294
|
]
|
295
295
|
}
|
296
|
-
```
|
296
|
+
```
|
297
|
+
|
298
|
+
## History
|
299
|
+
|
300
|
+
| date | version | notes |
|
301
|
+
|--------------|---------|---------------------------------------------|
|
302
|
+
| May 22, 2023 | 1.0 | Initial upload |
|
303
|
+
| May 22, 2023 | 1.1 | Added refute, assert_equal and refute_equal |
|
data/lib/bryton/lite.rb
CHANGED
@@ -360,13 +360,34 @@ module Bryton::Lite::Tests
|
|
360
360
|
return JSON.generate(@hsh)
|
361
361
|
end
|
362
362
|
|
363
|
-
#
|
363
|
+
# Asserts a condition as true. Fails if condition is not true
|
364
364
|
def self.assert(bool, id=nil, level=0, &block)
|
365
365
|
if not bool
|
366
366
|
fail id, 1, &block
|
367
367
|
end
|
368
368
|
end
|
369
369
|
|
370
|
+
# Asserts a condition as false. Fails if condition is true.
|
371
|
+
def self.refute(bool, id=nil, level=0, &block)
|
372
|
+
if bool
|
373
|
+
fail id, 1, &block
|
374
|
+
end
|
375
|
+
end
|
376
|
+
|
377
|
+
# Asserts that two objects are equal according to ==. Fails if they are not.
|
378
|
+
def self.assert_equal(expected, actual, id=nil, level=0, &block)
|
379
|
+
if not (expected == actual)
|
380
|
+
fail id, 1, &block
|
381
|
+
end
|
382
|
+
end
|
383
|
+
|
384
|
+
# Asserts that two objects are not equal according to ==. Fails if they are.
|
385
|
+
def self.refute_equal(expected, actual, id=nil, level=0, &block)
|
386
|
+
if (expected == actual)
|
387
|
+
fail id, 1, &block
|
388
|
+
end
|
389
|
+
end
|
390
|
+
|
370
391
|
# Mark the test as failed.
|
371
392
|
def self.fail(id=nil, level=0, &block)
|
372
393
|
loc = caller_locations[level]
|