Skip to content

Array shuffle method should fail if prng is passed without being a named argument #6499

@jmalves

Description

@jmalves

Environment Information
Tested on Jruby 9.2.14.0

Expected Behavior

2.5.0 :001 > prng = Random.new(1000); (0..10).to_a.shuffle(prng)
Traceback (most recent call last):
3: from /Users/jalves/.rvm/rubies/ruby-2.5.0/bin/irb:11:in <main>' 2: from (irb):1 1: from (irb):1:in shuffle'

Actual Behavior

jruby-9.2.14.0 :004 > prng = Random.new(1000); (0..10).to_a.shuffle(prng)
=> [3, 10, 9, 6, 7, 2, 4, 5, 1, 0, 8]

So I would expect the shuffle method to throw an exception, which does not happen in the JRuby case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions