Faker::Boolean:boolean not working as described in the markdown #2118
Comments
|
If you are using v1.8.4 then right way to call boolean is cc: @koic |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
When using Faker::Boolean:boolean in codewars to create a new kata it works without true_ratio being specified, but when specifying true_ratio I needed to use the syntax 'Faker::Boolean:boolean(true_ratio = 0.8)' rather than 'Faker::Boolean:boolean(true_ratio: 0.8)' which is in the boolean.md doc.
To Reproduce
The error when using "true_ratio: 0.8" was:
"Log
An error occurred while loading ./main.rb.
Failure/Error: (rand < true_ratio)
ArgumentError:
comparison of Float with Hash failed
/usr/local/bundle/gems/faker-1.8.4/lib/faker/boolean.rb:5:in `<'
/usr/local/bundle/gems/faker-1.8.4/lib/faker/boolean.rb:5:in `boolean'
./spec.rb:19:in `block in <top (required)>'
./spec.rb:18:in `times'
./spec.rb:18:in `<top (required)>'
./main.rb:2:in `<top (required)>'
No examples found."
It worked with "true_ratio = 0.8"
Expected behavior
The working code should match the boolean.md examples (in this case "true_ratio: 0.8" should not cause an error
Additional context
I am very new to Ruby and new to codewars kata creation so I do not know if this is a feature of the setup or an actual bug.
The text was updated successfully, but these errors were encountered: