Skip to content
Permalink
Browse files
Merge remote-tracking branch 'origin' into kernel
  • Loading branch information
brixen committed Jan 26, 2016
2 parents 5bf7a88 + c5dcaf0 commit 719f02c3bd2dc6af1dbfa2cc009837d0a4a05199
Showing with 22 additions and 4 deletions.
  1. +1 −1 configure
  2. +2 −3 kernel/array.rb
  3. +6 −0 spec/ruby/core/array/product_spec.rb
  4. +6 −0 spec/ruby/language/fixtures/super.rb
  5. +6 −0 spec/ruby/language/super_spec.rb
  6. +1 −0 spec/tags/ruby/language/super_tags.txt
@@ -163,7 +163,7 @@ class Configure
@vendored_libdir = File.join(root, "/vendor")

# Ruby compatibility version
@ruby_version = "2.2.0"
@ruby_version = "2.2.2"
@ruby_libversion = @ruby_version.split(/\./)[0..1].join.to_i

# Configure settings
@@ -1273,9 +1273,8 @@ def product(*args)
outer_lambda.call([])

if block_given?
block_result = self
result.each { |v| block_result << yield(v) }
block_result
result.each { |v| yield(v) }
self
else
result
end
@@ -41,6 +41,12 @@
acc.should be_empty
end

it "returns self" do
a = [1, 2, 3].freeze

a.product([1, 2]) { |p| p.first }.should == a
end

it "will ignore unreasonable numbers of products and yield anyway" do
a = (0..100).to_a
lambda do
@@ -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 719f02c

Please sign in to comment.