Skip to content

Fix: bug when boolean false was extracted from var as nil #11

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

Merged
merged 4 commits into from
Mar 7, 2024

Conversation

savka2017
Copy link
Collaborator

Fixed bug when method #get_var_value extracts from boolean variable nil instead of false

@savka2017 savka2017 added the bug Something isn't working label Mar 7, 2024
let(:data) { { 'a' => true } }
let(:var_name) { 'a' }

it { is_expected.to be_truthy }
Copy link
Collaborator

@Teckden Teckden Mar 7, 2024

Choose a reason for hiding this comment

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

truthy is a bit vague, can you please set the exact expectation for the returned value?
It is recommended to: The be matcher is too generic, as it pass on everything that is not nil or false. If that is the exact intend, use be_truthy. In all other cases it’s better to specify what exactly is the expected value.
https://docs.rubocop.org/rubocop-rspec/cops_rspec.html#rspecbe

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fixed

@savka2017 savka2017 merged commit 8b37a4e into main Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants