summaryrefslogtreecommitdiff
path: root/spec/ruby/core/kernel/loop_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/kernel/loop_spec.rb')
-rw-r--r--spec/ruby/core/kernel/loop_spec.rb22
1 files changed, 10 insertions, 12 deletions
diff --git a/spec/ruby/core/kernel/loop_spec.rb b/spec/ruby/core/kernel/loop_spec.rb
index f23e3afb02..7c76c7d28e 100644
--- a/spec/ruby/core/kernel/loop_spec.rb
+++ b/spec/ruby/core/kernel/loop_spec.rb
@@ -1,5 +1,5 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
+require_relative '../../spec_helper'
+require_relative 'fixtures/classes'
describe "Kernel.loop" do
it "is a private method" do
@@ -55,18 +55,16 @@ describe "Kernel.loop" do
end
it "does not rescue other errors" do
- lambda{ loop do raise StandardError end }.should raise_error( StandardError )
+ ->{ loop do raise StandardError end }.should raise_error( StandardError )
end
- ruby_version_is "2.3" do
- it "returns StopIteration#result, the result value of a finished iterator" do
- e = Enumerator.new { |y|
- y << 1
- y << 2
- :stopped
- }
- loop { e.next }.should == :stopped
- end
+ it "returns StopIteration#result, the result value of a finished iterator" do
+ e = Enumerator.new { |y|
+ y << 1
+ y << 2
+ :stopped
+ }
+ loop { e.next }.should == :stopped
end
describe "when no block is given" do