probatio 1.4.2 → 1.5.0
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/CHANGELOG.md +7 -0
- data/LICENSE.txt +1 -1
- data/lib/probatio/assertions.rb +9 -0
- data/lib/probatio/helpers.rb +18 -0
- data/lib/probatio.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5afa6aef3d22540ead334ee7074be169452a44fedc2fe108f1bbad73ceed428e
|
|
4
|
+
data.tar.gz: ee04395a9682d0a3565f3cc531caf78fbee33878b90ea7578cd3101fadda0803
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 94f56b66f3a4e464a4b89df1fcd621f24bf7e8c6b6934b1d5abb254cbd1aad5ddd2dde5d897b287f477b0544414a935604509c084b68810f08debfa09eb36abb
|
|
7
|
+
data.tar.gz: 7fe7a7322ea1c881ed3dc04535054074c86ffc029e857e268ecee84bc730dfed6c4580a63ec2d30efe296f1d5bd8e089f8ae2038486ccb54bbd133ef2f3ad18c
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
# CHANGELOG.md
|
|
3
3
|
|
|
4
4
|
|
|
5
|
+
## probatio 1.5.0 released 2026-01-28
|
|
6
|
+
|
|
7
|
+
* Introduce `assert_not_match`
|
|
8
|
+
* Introduce `time do; end` helper
|
|
9
|
+
* Alias `assert_class` to `assert_instance_of`
|
|
10
|
+
|
|
11
|
+
|
|
5
12
|
## probatio 1.4.2 released 2025-11-26
|
|
6
13
|
|
|
7
14
|
* Allow pointing at a group with a line number between tests
|
data/LICENSE.txt
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
Copyright (c) 2024-
|
|
2
|
+
Copyright (c) 2024-2026, John Mettraux, jmettraux+flor@gmail.com
|
|
3
3
|
|
|
4
4
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
5
|
of this software and associated documentation files (the "Software"), to deal
|
data/lib/probatio/assertions.rb
CHANGED
|
@@ -86,6 +86,14 @@ class Probatio::Context
|
|
|
86
86
|
a.end_with?(sta) }
|
|
87
87
|
end
|
|
88
88
|
|
|
89
|
+
def assert_not_match(*as)
|
|
90
|
+
|
|
91
|
+
strings, others = as.partition { |a| a.is_a?(String) }
|
|
92
|
+
rex = others.find { |o| o.is_a?(Regexp) } || strings.pop
|
|
93
|
+
|
|
94
|
+
do_assert(strings, 'not matched') { |s| ! s.match?(rex) }
|
|
95
|
+
end
|
|
96
|
+
|
|
89
97
|
def assert_include(*as)
|
|
90
98
|
|
|
91
99
|
ai =
|
|
@@ -124,6 +132,7 @@ class Probatio::Context
|
|
|
124
132
|
do_assert(as, 'instance of') { |e| e.is_a?(moc) }
|
|
125
133
|
end
|
|
126
134
|
alias assert_is_a assert_instance_of
|
|
135
|
+
alias assert_class assert_instance_of
|
|
127
136
|
|
|
128
137
|
def assert_error(*as, &block)
|
|
129
138
|
|
data/lib/probatio/helpers.rb
CHANGED
|
@@ -18,6 +18,24 @@ module Probatio::Helpers
|
|
|
18
18
|
|
|
19
19
|
Gem.win_platform?
|
|
20
20
|
end
|
|
21
|
+
|
|
22
|
+
def time(&block)
|
|
23
|
+
|
|
24
|
+
t0 = Probatio.monow
|
|
25
|
+
|
|
26
|
+
block.call
|
|
27
|
+
|
|
28
|
+
d = Probatio.monow - t0
|
|
29
|
+
ds = Probatio.to_time_s(d)
|
|
30
|
+
|
|
31
|
+
s, l = block.source_location
|
|
32
|
+
|
|
33
|
+
puts(
|
|
34
|
+
"\n" +
|
|
35
|
+
Probatio.c.dark_grey +
|
|
36
|
+
"time block at #{s}:#{l} took #{ds}" +
|
|
37
|
+
Probatio.c.reset)
|
|
38
|
+
end
|
|
21
39
|
end
|
|
22
40
|
|
|
23
41
|
|
data/lib/probatio.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: probatio
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.5.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- John Mettraux
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2026-01-28 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: stringio
|