mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Update to ruby/spec@d419e74
This commit is contained in:
parent
26a9f80c82
commit
a2fac1d72c
44 changed files with 772 additions and 514 deletions
|
@ -38,6 +38,22 @@ ruby_version_is "2.6" do
|
|||
(f << g).lambda?.should == false
|
||||
end
|
||||
|
||||
it "is a Proc when other is lambda" do
|
||||
f = proc { |x| x * x }
|
||||
g = -> x { x + x }
|
||||
|
||||
(f << g).is_a?(Proc).should == true
|
||||
(f << g).lambda?.should == false
|
||||
end
|
||||
|
||||
it "is a lambda when self is lambda" do
|
||||
f = -> x { x * x }
|
||||
g = proc { |x| x + x }
|
||||
|
||||
(f << g).is_a?(Proc).should == true
|
||||
(f << g).lambda?.should == true
|
||||
end
|
||||
|
||||
it "may accept multiple arguments" do
|
||||
inc = proc { |n| n + 1 }
|
||||
mul = proc { |n, m| n * m }
|
||||
|
@ -91,6 +107,22 @@ ruby_version_is "2.6" do
|
|||
(f >> g).lambda?.should == false
|
||||
end
|
||||
|
||||
it "is a Proc when other is lambda" do
|
||||
f = proc { |x| x * x }
|
||||
g = -> x { x + x }
|
||||
|
||||
(f >> g).is_a?(Proc).should == true
|
||||
(f >> g).lambda?.should == false
|
||||
end
|
||||
|
||||
it "is a lambda when self is lambda" do
|
||||
f = -> x { x * x }
|
||||
g = proc { |x| x + x }
|
||||
|
||||
(f >> g).is_a?(Proc).should == true
|
||||
(f >> g).lambda?.should == true
|
||||
end
|
||||
|
||||
it "may accept multiple arguments" do
|
||||
inc = proc { |n| n + 1 }
|
||||
mul = proc { |n, m| n * m }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue