Skip to content

Commit

Permalink
refactor: simplify method signatures using argument forwarding
Browse files Browse the repository at this point in the history
  • Loading branch information
cyril committed Dec 30, 2024
1 parent 4b8e4ae commit eee2399
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions lib/test_tube.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand All @@ -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

0 comments on commit eee2399

Please sign in to comment.