From eee239942dca3bb9e99b670b2ebe02f86b8d5660 Mon Sep 17 00:00:00 2001 From: Cyril Kato Date: Mon, 30 Dec 2024 19:25:08 +0100 Subject: [PATCH] refactor: simplify method signatures using argument forwarding --- lib/test_tube.rb | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/test_tube.rb b/lib/test_tube.rb index 73ae466..1947c68 100644 --- a/lib/test_tube.rb +++ b/lib/test_tube.rb @@ -7,9 +7,9 @@ # # @api public module TestTube - # @param matcher [#match?] A matcher. - # @param negate [Boolean] Invert the matcher or not. - # @param input [Proc] The callable object to test. + # Invokes a block for testing. + # + # @see TestTube::Invoker#initialize for parameter details # # @example # require "test_tube" @@ -24,14 +24,14 @@ module TestTube # "101010".to_i(2) # end # - # @return [Invoker] A software experiment. - def self.invoke(matcher:, negate:, &input) - Invoker.new(matcher:, negate:, &input) + # @return [TestTube::Invoker] A software experiment. + def self.invoke(...) + Invoker.new(...) end - # @param input [#object_id] The actual value to test. - # @param matcher [#match?] A matcher. - # @param negate [Boolean] Invert the matcher or not. + # Tests a value directly. + # + # @see TestTube::Passer#initialize for parameter details # # @example # require "test_tube" @@ -47,8 +47,8 @@ def self.invoke(matcher:, negate:, &input) # negate: false # ) # - # @return [Passer] A software experiment. - def self.pass(input, matcher:, negate:) - Passer.new(input, matcher:, negate:) + # @return [TestTube::Passer] A software experiment. + def self.pass(...) + Passer.new(...) end end