Skip to content
Permalink
Browse files
Add another failing specs for zsuper with keyword arguments
  • Loading branch information
ahmadsherif committed Jan 25, 2016
1 parent 991206b commit d0f82efa3946e8984f96d3a01cb79a37b70d4d2e
Showing with 13 additions and 0 deletions.
  1. +6 −0 spec/ruby/language/fixtures/super.rb
  2. +6 −0 spec/ruby/language/super_spec.rb
  3. +1 −0 spec/tags/ruby/language/super_tags.txt
@@ -340,5 +340,11 @@ def foo(**)
super
end
end

class C < A
def foo(a:, b: 'b', **)
super
end
end
end
end
@@ -166,6 +166,12 @@ def a(arg)
b.foo(:number => 10).should == {:number => 10}
end

it "passes any given keyword arguments including optional and required ones to the parent" do
c = Super::KeywordArguments::C.new

c.foo(a: 'a', c: 'c').should == {a: 'a', b: 'b', c: 'c'}
end

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

@@ -1,3 +1,4 @@
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
fails:The super keyword when using keyword arguments passes any given keyword arguments including optional and required ones to the parent

0 comments on commit d0f82ef

Please sign in to comment.