test_tube 3.0.0 → 4.0.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: 3a1dbc9ba1ec31cf75bfc230ce4eecd83b8fdaa948b0dbaa0787579d659ad7ba
4
- data.tar.gz: f007123f4496bec8617bbc12be65b8b436c61afbead33d9a1f410dd906fdf6ae
3
+ metadata.gz: a511d50711ff51b4ca13b4e6228f2e0d88dbfcb04b89ccb37619b1b2a3248073
4
+ data.tar.gz: 2eac86be8bdfc2733ed2fb11aa90bd4177c548e5319765549c04dd458dfd56e5
5
5
  SHA512:
6
- metadata.gz: e95aa4c56a4d7f4de41056584c76f3734068f406a19991cef9b03da1f256e3e743db4a2fe4651241778686f916f206190ccae29fa93bc6a74b48f0adc3a85481
7
- data.tar.gz: 815b44987f0e28b5930a27930d1b089218b33b33bc32d7e66d4dce147d159699584986f979c1ed218b449da4d5d07e4ffe812d3edacd44c03f01d8dd6fe08170
6
+ metadata.gz: 80032c8cfacc36e4e49b48ba74dfbf0f0f82d8198fc2c40d66e42046d331312eb15a05bd11db0aa92fb748d3e9c6856731d3643bb543d0a90d4d725d43de9fd5
7
+ data.tar.gz: 4948793c91f4f2842af624a91d791875542c0eca3855780d266d88bc2c9153cb14fea30daf4e3f4afcd0671e439a80bb006ffba760b9669a93e4c577e8c9e345
data/README.md CHANGED
@@ -43,7 +43,7 @@ the Universe, and Everything with the following matcher:
43
43
 
44
44
  ```ruby
45
45
  class BeTheAnswer
46
- def matches?
46
+ def match?
47
47
  42.equal?(yield)
48
48
  end
49
49
  end
@@ -78,7 +78,7 @@ experiment.got # => true
78
78
  ### __Matchi__ matchers
79
79
 
80
80
  To facilitate the addition of matchers, a collection is available via the
81
- [__Matchi__ project](https://github.com/fixrb/matchi/).
81
+ [Matchi project](https://github.com/fixrb/matchi/).
82
82
 
83
83
  Let's use a built-in __Matchi__ matcher:
84
84
 
@@ -146,11 +146,6 @@ __Test Tube__ follows [Semantic Versioning 2.0](https://semver.org/).
146
146
 
147
147
  The [gem](https://rubygems.org/gems/test_tube) is available as open source under the terms of the [MIT License](https://github.com/fixrb/test_tube/raw/main/LICENSE.md).
148
148
 
149
- ---
149
+ ## Sponsors
150
150
 
151
- <p>
152
- This project is sponsored by:<br />
153
- <a href="https://sashite.com/"><img
154
- src="https://github.com/fixrb/test_tube/raw/main/img/sashite.png"
155
- alt="Sashité" /></a>
156
- </p>
151
+ This project is sponsored by [Sashité](https://sashite.com/)
@@ -13,13 +13,13 @@ module TestTube
13
13
 
14
14
  # Class initializer.
15
15
  #
16
- # @param matcher [#matches?] A matcher.
16
+ # @param matcher [#match?] A matcher.
17
17
  # @param negate [Boolean] Invert the matcher or not.
18
18
  # @param input [Proc] The callable object to test.
19
19
  def initialize(matcher:, negate:, &input)
20
20
  super()
21
21
 
22
- @got = negate ^ matcher.matches? do
22
+ @got = negate ^ matcher.match? do
23
23
  value = send_call.to(input)
24
24
  @actual = value.object
25
25
  value.call
@@ -10,13 +10,13 @@ module TestTube
10
10
  # Class initializer.
11
11
  #
12
12
  # @param input [#object_id] The actual value to test.
13
- # @param matcher [#matches?] A matcher.
13
+ # @param matcher [#match?] A matcher.
14
14
  # @param negate [Boolean] Invert the matcher or not.
15
15
  def initialize(input, matcher:, negate:)
16
16
  super()
17
17
 
18
18
  @actual = input
19
- @got = negate ^ matcher.matches? { input }
19
+ @got = negate ^ matcher.match? { input }
20
20
  end
21
21
  end
22
22
  end
data/lib/test_tube.rb CHANGED
@@ -7,15 +7,15 @@ require_relative File.join("test_tube", "passer")
7
7
  #
8
8
  # @api public
9
9
  module TestTube
10
- # @param matcher [#matches?] A matcher.
11
- # @param negate [Boolean] Invert the matcher or not.
12
- # @param input [Proc] The callable object to test.
10
+ # Invokes a block for testing.
11
+ #
12
+ # @see TestTube::Invoker#initialize for parameter details
13
13
  #
14
14
  # @example
15
15
  # require "test_tube"
16
16
  #
17
17
  # class BeTheAnswer
18
- # def matches?
18
+ # def match?
19
19
  # 42.equal?(yield)
20
20
  # end
21
21
  # end
@@ -24,20 +24,20 @@ module TestTube
24
24
  # "101010".to_i(2)
25
25
  # end
26
26
  #
27
- # @return [Invoker] A software experiment.
28
- def self.invoke(matcher:, negate:, &input)
29
- Invoker.new(matcher:, negate:, &input)
27
+ # @return [TestTube::Invoker] A software experiment.
28
+ def self.invoke(...)
29
+ Invoker.new(...)
30
30
  end
31
31
 
32
- # @param input [#object_id] The actual value to test.
33
- # @param matcher [#matches?] A matcher.
34
- # @param negate [Boolean] Invert the matcher or not.
32
+ # Tests a value directly.
33
+ #
34
+ # @see TestTube::Passer#initialize for parameter details
35
35
  #
36
36
  # @example
37
37
  # require "test_tube"
38
38
  #
39
39
  # class BeTheAnswer
40
- # def matches?
40
+ # def match?
41
41
  # 42.equal?(yield)
42
42
  # end
43
43
  # end
@@ -47,8 +47,8 @@ module TestTube
47
47
  # negate: false
48
48
  # )
49
49
  #
50
- # @return [Passer] A software experiment.
51
- def self.pass(input, matcher:, negate:)
52
- Passer.new(input, matcher:, negate:)
50
+ # @return [TestTube::Passer] A software experiment.
51
+ def self.pass(...)
52
+ Passer.new(...)
53
53
  end
54
54
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: test_tube
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 4.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cyril Kato
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-01-25 00:00:00.000000000 Z
10
+ date: 2024-12-30 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: defi
@@ -41,7 +40,6 @@ licenses:
41
40
  - MIT
42
41
  metadata:
43
42
  rubygems_mfa_required: 'true'
44
- post_install_message:
45
43
  rdoc_options: []
46
44
  require_paths:
47
45
  - lib
@@ -56,8 +54,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
56
54
  - !ruby/object:Gem::Version
57
55
  version: '0'
58
56
  requirements: []
59
- rubygems_version: 3.4.19
60
- signing_key:
57
+ rubygems_version: 3.6.2
61
58
  specification_version: 4
62
59
  summary: "A test tube to conduct software experiments \U0001F9EA"
63
60
  test_files: []