probatio 1.0.0 → 1.1.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: cf6d07083021c42a5695d160c5de95cb18cef70ed2cf58fb958498cbc33a3c9c
4
- data.tar.gz: 9c9a5c712f92568e05e1986be11e505b3fd3863023cc2d797b0a964a7e5da2e5
3
+ metadata.gz: 341afa67e0fa27ef98742a21d8e5842b132ba812cb9fc702d37793ea702fbeb7
4
+ data.tar.gz: fdf5c8a7baface7d2fa2d95ceb2b201364ce0a2c98f5926c5659617a8402cbc2
5
5
  SHA512:
6
- metadata.gz: a4521e7b2c50ddcdc08fe1a064e8aea1580a01a623fe666933892ee8f099b8bf9f6f90bfc18231e00b669f9b6b0be630ada8f413084bd93d7f0daf25c92cde1d
7
- data.tar.gz: 0e9f61a0222ceb65692a17ce532bb8e2684f7b31c49cb918894a02923a23aab51954001d186905423ba30e6e2ce2c7225a335d42c7f6bfd061f988dc033c382b
6
+ metadata.gz: 0ec333e78a402d7c77e518bc212c3cb47b40b26e82c807692d924c5d0755d7b460801a527966f0621b06934e66f1961d1db84896b174633bf995135f0c9cca69
7
+ data.tar.gz: c8293d3a2d05b726618ab9965ce970841fe82c14d7d35312ce650a8676aaeba873e221bf19dd7a528c690a1575b1558218995ee7ec802359e2fee4092ce541bb
data/CHANGELOG.md CHANGED
@@ -2,6 +2,11 @@
2
2
  # CHANGELOG.md
3
3
 
4
4
 
5
+ ## proba 1.1.0 released 2025-04-16
6
+
7
+ * Introduce `assert_no_error { do_this_or_that() }`
8
+
9
+
5
10
  ## proba 1.0.0 released 2025-02-08
6
11
 
7
12
  * Initial release
data/README.md CHANGED
@@ -170,6 +170,12 @@ group 'core' do
170
170
  # checks that the given Proc raises an ArgumentError and
171
171
  # the error message == "bad"
172
172
 
173
+ assert_no_error { do_this_or_that() }
174
+ assert_no_error lambda { do_this_or_that() }
175
+ assert_not_error { do_this_or_that() }
176
+ assert_not_error lambda { do_this_or_that() }
177
+ # checks that the block or Proc does not raise an error
178
+
173
179
  assert_hashy(
174
180
  this_thing => 1,
175
181
  that_thing => 'two')
@@ -158,6 +158,19 @@ class Probatio::Context
158
158
  true
159
159
  end
160
160
 
161
+ def assert_not_error(*as, &block)
162
+
163
+ block = block || as.find { |a| a.is_a?(Proc) }
164
+
165
+ err = nil;
166
+ begin; block.call; rescue => err; end
167
+
168
+ return "no error expected but returned #{err.class} #{err.name}" if err
169
+
170
+ true
171
+ end
172
+ alias assert_no_error assert_not_error
173
+
161
174
  # Checks whether its "_assert_something", if that's the case,
162
175
  # just flags the assertion as :pending an moves on
163
176
  #
data/lib/probatio.rb CHANGED
@@ -15,7 +15,7 @@ require 'probatio/more'
15
15
 
16
16
  module Probatio
17
17
 
18
- VERSION = '1.0.0'
18
+ VERSION = '1.1.0'
19
19
 
20
20
  class << self
21
21
 
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.0.0
4
+ version: 1.1.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-02-08 00:00:00.000000000 Z
11
+ date: 2025-04-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colorato