Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves #2049
A test that seems to be failing randomly. The test is:
faker/test/faker/music/test_faker_rush.rb
The error is: NoMethodError: undefined method 'match' for 2112:Integer
It comes from the fetch method in the Faker::Base, when it does:
sample(translate("faker.#{key}"))
where
translate("faker.#{key}")
returns:["Rush", "Fly by Night", "Caress of Steel", 2112, "A Farewell to Kings", "Hemispheres", "Permanent Waves", "Moving Pictures", "Signals", "Grace Under Pressure", "Power Windows", "Hold Your Fire", "Presto", "Roll the Bones", "Counterparts", "Test for Echo", "Vapor Trails", "Snakes & Arrows", "Clockwork Angels", "All the World's a Stage", "Exit...Stage Left", "A Show of Hands", "Different Stages"]
So when the sample is
2112
, it tries to do2112.match(%r{^/})
I solved this by changing the input of the YAML to a string. Another way of solving this could be in
the
fetch
method of faker make this change:add a
fetched.respond_to?(:match)
check in thefetch
method:I am open to any suggestions or changes