Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Method#parameters for a method generated by respond_to_missing? #4561

merged 1 commit into from Apr 18, 2017


Copy link

@etehtsea etehtsea commented Apr 16, 2017

Not sure that this is the proper way to fix this issue, but it seems to work and fixes actual issue I've got using rspec-mocks.

require 'diplomat'

RSpec.configure do |c|
    c.mock_with :rspec do |mocks|
    mocks.verify_partial_doubles = true

RSpec.describe 'jruby issue' do
  specify do
    allow(Diplomat::Kv).to receive(:get)
                             .with('key', recurse: true, decode_values: true)

    expect(Diplomat::Kv.get('key', recurse: true, decode_values: true)).to eq('mocked')

  1) jruby issue
     Failure/Error: allow(Diplomat::Kv).to receive(:get)
       Wrong number of arguments. Expected 0, got 2.
     # ./demo2.rb:11:in `block in (root)'

Finished in 0.02773 seconds (files took 0.55134 seconds to load)
1 example, 1 failure

Failed examples:

rspec ./demo2.rb:10 # jruby issue

Relates to #2816

@enebo enebo added this to the JRuby milestone Apr 18, 2017
@enebo enebo merged commit e70cf66 into jruby:master Apr 18, 2017
1 check failed
1 check failed
continuous-integration/travis-ci/pr The Travis CI build failed
@etehtsea etehtsea deleted the etehtsea:fix-method-params branch Apr 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants