Skip to content

Commit

Permalink
Add failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
shioyama committed May 26, 2020
1 parent b6bdc8b commit fdaf7b0
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions spec/mobility/plugins/fallthrough_accessors_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,22 @@ def method_missing(method_name, *_args, **options, &block)
options = { some: 'params' }
expect(instance.foo(**options)).to eq(options)
end

it 'does not pass on empty keyword options hash to super' do
mod = Module.new do
def method_missing(method_name, *args, &block)
method_name == :bar ? args : super
end
end

klass = Class.new
klass.include mod
klass.include described_class.new

instance = klass.new

expect(instance.bar).to eq([])
end
end

describe ".apply" do
Expand Down

0 comments on commit fdaf7b0

Please sign in to comment.