Skip to content

UnboundMethod#parameters for an assignment method wrongly returns blank array #2816

@myronmarston

Description

@myronmarston
➜  rspec-mocks git:(master) ✗ chruby 2.1
➜  rspec-mocks git:(master) ✗ ruby -v -e 'puts Class.new { attr_accessor :foo }.instance_method(:foo=).parameters.inspect'
ruby 2.1.5p273 (2014-11-13 revision 48405) [x86_64-darwin12.0]
[[:req]]
➜  rspec-mocks git:(master) ✗ chruby jruby
➜  rspec-mocks git:(master) ✗ ruby -v -e 'puts Class.new { attr_accessor :foo }.instance_method(:foo=).parameters.inspect'
jruby 1.7.8 (1.9.3p392) 2013-11-14 0ce429e on Java HotSpot(TM) 64-Bit Server VM 1.6.0_65-b14-462-11M4609 [darwin-x86_64]
[]

rspec-mocks relies upon parameters for verifying doubles to ensure the method signature of the real object supports the provided arguments, and it's not working properly for assignment methods on JRuby due to this bug (see rspec/rspec-mocks#919).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions