Loading
Fix raise ArgumentError missing comma in Ci::JobsFinder
What does this MR do and why
The type guard in the constructor is missing a comma:
raise ArgumentError 'type must be a subclass of Ci::Processable' unless type < ::Ci::ProcessableWithout it, Ruby parses ArgumentError 'string' as a method call named
ArgumentError, which does not exist, so the guard raises NoMethodError
with a message about an undefined method rather than the ArgumentError
it intends. Anyone passing a wrong type gets an error that points at the
wrong problem.
How to verify
raise ArgumentError 'x'
# => NoMethodError: undefined method `ArgumentError'
raise ArgumentError, 'x'
# => ArgumentError: xSpotted by itaruby(to be released), a Ruby type checker I'm working on.