Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add another failing specs for zsuper with keyword arguments
  • Loading branch information
ahmadsherif committed Jan 25, 2016
1 parent 991206b commit d0f82ef
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
6 changes: 6 additions & 0 deletions spec/ruby/language/fixtures/super.rb
Expand Up @@ -340,5 +340,11 @@ def foo(**)
super
end
end

class C < A
def foo(a:, b: 'b', **)
super
end
end
end
end
6 changes: 6 additions & 0 deletions spec/ruby/language/super_spec.rb
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions spec/tags/ruby/language/super_tags.txt
@@ -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.