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
merged 1 commit into from
Apr 18, 2017

Conversation

etehtsea
Copy link
Contributor

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
  end
end

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

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

  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 9.1.9.0 milestone Apr 18, 2017
@enebo enebo merged commit e70cf66 into jruby:master Apr 18, 2017
@etehtsea etehtsea deleted the fix-method-params branch April 18, 2017 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants