Skip to content

Commit

Permalink
Add a spec for zsuper passing splat and keyword arguments together
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmadsherif committed Apr 30, 2016
1 parent 18d2f10 commit 558c7c1
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
14 changes: 14 additions & 0 deletions spec/ruby/language/fixtures/super.rb
Expand Up @@ -347,4 +347,18 @@ def foo(a:, b: 'b', **)
end
end
end

module SplatAndKeyword
class A
def foo(*args, **options)
[args, options]
end
end

class B < A
def foo(*args, **options)
super
end
end
end
end
8 changes: 8 additions & 0 deletions spec/ruby/language/super_spec.rb
Expand Up @@ -177,5 +177,13 @@ def a(arg)

b.foo.should == {}
end

describe 'when using splat arguments' do
it 'passes splat arguments and keyword arguments to the parent' do
b = Super::SplatAndKeyword::B.new

b.foo('bar', baz: true).should == [['bar'], {baz: true}]
end
end
end
end

0 comments on commit 558c7c1

Please sign in to comment.