Skip to content
Permalink
Browse files
Added failing specs for zsuper with rest kwargs
  • Loading branch information
YorickPeterse committed Jan 22, 2016
1 parent 7489a07 commit 9da9d6ab841c8174b1621133693d68f8b35c89b7
Showing with 29 additions and 0 deletions.
  1. +14 −0 spec/ruby/language/fixtures/super.rb
  2. +14 −0 spec/ruby/language/super_spec.rb
  3. +1 −0 spec/tags/ruby/language/super_tags.txt
@@ -327,4 +327,18 @@ class AnonymousModuleIncludedTwice < AnonymousModuleIncludedTwiceBase
whatever
whatever
end

module KeywordArguments
class A
def foo(**args)
args
end
end

class B < A
def foo(**)
super
end
end
end
end
@@ -158,4 +158,18 @@ def a(arg)
it "invokes methods from a chain of anonymous modules" do
Super::AnonymousModuleIncludedTwice.new.a([]).should == ["anon", "anon", "non-anon"]
end

describe 'when using keyword arguments' do
it 'passes any given keyword arguments to the parent' do
b = Super::KeywordArguments::B.new

b.foo(:number => 10).should == {:number => 10}
end

it 'does not pass any keyword arguments to the parent when none are given' do
b = Super::KeywordArguments::B.new

b.foo.should == {}
end
end
end
@@ -1,2 +1,3 @@
fails:The super keyword raises a RuntimeError when called with implicit arguments from a method defined with define_method
fails:The super keyword invokes methods from a chain of anonymous modules
fails:The super keyword when using keyword arguments does not pass any keyword arguments to the parent when none are given

0 comments on commit 9da9d6a

Please sign in to comment.