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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cb5913d7a89604bdcb77a726382d5b50c333df3be906872e1484d540f04d162b
4
- data.tar.gz: 176cd56812b6aee807da7fedce98243e9a0bbc8e1a2b835a251dc406e4b4920d
3
+ metadata.gz: 5afa6aef3d22540ead334ee7074be169452a44fedc2fe108f1bbad73ceed428e
4
+ data.tar.gz: ee04395a9682d0a3565f3cc531caf78fbee33878b90ea7578cd3101fadda0803
5
5
  SHA512:
6
- metadata.gz: 857a906c0174eb4501b641db7da24ca8685c4b6062c5d7366db1287118228a2371731781d818a4edcf33f3333f8dd5a781193ccd8c42cffc5dbb3bb612aa1c17
7
- data.tar.gz: 15650e10842cbcfd0b81747ba46bd222a4d4b9a42720ade1b25cdb8ee6972b1c4d5fd09a73b49778f8a1311c4b0245e5bc345be66527c0cdc49528815ca81d99
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-2025, John Mettraux, jmettraux+flor@gmail.com
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
@@ -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
 
@@ -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
@@ -18,7 +18,7 @@ require 'probatio/more'
18
18
 
19
19
  module Probatio
20
20
 
21
- VERSION = '1.4.2'
21
+ VERSION = '1.5.0'
22
22
 
23
23
  class << self
24
24
 
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.2
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: 2025-11-26 00:00:00.000000000 Z
11
+ date: 2026-01-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: stringio