Skip to content

Commit

Permalink
Merge pull request #2443 from sudeeptarlekar/2309-truffleruby-errors
Browse files Browse the repository at this point in the history
[2309] Fixed error for random in markdown
  • Loading branch information
koic authored Mar 10, 2022
2 parents 9f1c0ba + d00e83f commit e4a90c3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/faker/default/markdown.rb
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def table
def random(*args)
method_list = available_methods
args&.each { |ex| method_list.delete_if { |meth| meth == ex.to_sym } }
send(method_list[rand(0..method_list.length - 1)])
send(method_list[Faker::Config.random.rand(0..method_list.length - 1)])
end

##
Expand Down Expand Up @@ -168,7 +168,7 @@ def sandwich(legacy_sentences = NOT_GIVEN, legacy_repeat = NOT_GIVEN, sentences:
private

def available_methods
Markdown.public_methods(false) - Base.methods
(Markdown.public_methods(false) - Base.methods).sort
end
end
end
Expand Down

0 comments on commit e4a90c3

Please sign in to comment.