diff options
Diffstat (limited to 'spec/ruby/core/proc/compose_spec.rb')
-rw-r--r-- | spec/ruby/core/proc/compose_spec.rb | 46 |
1 files changed, 13 insertions, 33 deletions
diff --git a/spec/ruby/core/proc/compose_spec.rb b/spec/ruby/core/proc/compose_spec.rb index 94814d11bc..9e9b57e06f 100644 --- a/spec/ruby/core/proc/compose_spec.rb +++ b/spec/ruby/core/proc/compose_spec.rb @@ -37,42 +37,22 @@ describe "Proc#<<" do (f << g).should_not.lambda? end - ruby_version_is(''...'3.0') do - 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).should_not.lambda? - 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).should.lambda? - end - end - - ruby_version_is('3.0') do - it "is a lambda when parameter is lambda" do - f = -> x { x * x } - g = proc { |x| x + x } - lambda_proc = -> x { x } + it "is a lambda when parameter is lambda" do + f = -> x { x * x } + g = proc { |x| x + x } + lambda_proc = -> x { x } - # lambda << proc - (f << g).is_a?(Proc).should == true - (f << g).should_not.lambda? + # lambda << proc + (f << g).is_a?(Proc).should == true + (f << g).should_not.lambda? - # lambda << lambda - (f << lambda_proc).is_a?(Proc).should == true - (f << lambda_proc).should.lambda? + # lambda << lambda + (f << lambda_proc).is_a?(Proc).should == true + (f << lambda_proc).should.lambda? - # proc << lambda - (g << f).is_a?(Proc).should == true - (g << f).should.lambda? - end + # proc << lambda + (g << f).is_a?(Proc).should == true + (g << f).should.lambda? end it "may accept multiple arguments" do |