Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add additional option validation #50

Merged
merged 1 commit into from
Aug 19, 2020

Conversation

thestrabusiness
Copy link
Contributor

🧰 What's being changed?

This commit adds some additional validation around options. The new
validations verify the types of arguments being passed in.

🧪 Testing

Automated tests were added testing each initialization option

packages/ruby/lib/readme/metrics.rb Outdated Show resolved Hide resolved
packages/ruby/lib/readme/metrics.rb Outdated Show resolved Hide resolved
end
end

if options[:buffer_length] && !options[:buffer_length].is_a?(Integer)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since nil isn't an integer, I think you don't need the nil check

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need the nil check here because buffer_length is optional. It does have a default, but that is set when the RequestQueue class is initialized.

packages/ruby/lib/readme/metrics.rb Outdated Show resolved Hide resolved
packages/ruby/lib/readme/metrics.rb Outdated Show resolved Hide resolved
packages/ruby/spec/readme/metrics_spec.rb Outdated Show resolved Hide resolved
This commit adds some additional validation around options. The new
validations verify the types of arguments being passed in.
@thestrabusiness thestrabusiness force-pushed the am-add-additional-option-validation branch from d90add0 to 8b1a95b Compare August 19, 2020 18:52
@thestrabusiness thestrabusiness merged commit 8b1a95b into master Aug 19, 2020
@thestrabusiness thestrabusiness deleted the am-add-additional-option-validation branch August 19, 2020 18:53
djmango pushed a commit to djmango/metrics-sdks that referenced this pull request Sep 19, 2023
Bumps [nock](https://github.com/nock/nock) from 12.0.2 to 12.0.3.
- [Release notes](https://github.com/nock/nock/releases)
- [Changelog](https://github.com/nock/nock/blob/master/CHANGELOG.md)
- [Commits](nock/nock@v12.0.2...v12.0.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
@erunion erunion added ruby Issues related to our Ruby SDK and removed area:ruby labels Jul 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ruby Issues related to our Ruby SDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants