Symptom and impact
BazaRb#push documents data as a String, but it does not validate that type before calling String-only methods. Passing a different value raises a raw NoMethodError instead of the client's normal argument-validation error. The fake client has the same gap, so tests can fail with a different low-level exception rather than a clear input error.
Steps to reproduce
client = BazaRb.new('example.org', 443, 'token')
client.push('valid-job', 42, [])
The call fails before making an HTTP request: push reaches data.empty? with an Integer. The same input to BazaRb::Fake.new.push('valid-job', 42, []) also reaches data.empty? without a type check.
Actual result
Both clients leak NoMethodError for Integer#empty?. Callers do not get an error identifying data as the invalid argument.
Expected result
The real and fake clients should reject non-String data with a clear validation error before starting upload work, consistent with the documented String parameter and the validation of nil and empty data.
Technical evidence
lib/baza-rb.rb checks only nil and emptiness for data before passing it to File.binwrite; lib/baza-rb/fake.rb performs the same nil and emptiness checks. Neither path verifies data.is_a?(String). Existing tests cover nil and empty data but not other types.
Symptom and impact
BazaRb#pushdocumentsdataas aString, but it does not validate that type before calling String-only methods. Passing a different value raises a rawNoMethodErrorinstead of the client's normal argument-validation error. The fake client has the same gap, so tests can fail with a different low-level exception rather than a clear input error.Steps to reproduce
The call fails before making an HTTP request:
pushreachesdata.empty?with an Integer. The same input toBazaRb::Fake.new.push('valid-job', 42, [])also reachesdata.empty?without a type check.Actual result
Both clients leak
NoMethodErrorforInteger#empty?. Callers do not get an error identifyingdataas the invalid argument.Expected result
The real and fake clients should reject non-String data with a clear validation error before starting upload work, consistent with the documented
Stringparameter and the validation of nil and empty data.Technical evidence
lib/baza-rb.rbchecks only nil and emptiness fordatabefore passing it toFile.binwrite;lib/baza-rb/fake.rbperforms the same nil and emptiness checks. Neither path verifiesdata.is_a?(String). Existing tests cover nil and empty data but not other types.