summaryrefslogtreecommitdiff
path: root/spec/ruby/language/regexp/interpolation_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/language/regexp/interpolation_spec.rb')
-rw-r--r--spec/ruby/language/regexp/interpolation_spec.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/spec/ruby/language/regexp/interpolation_spec.rb b/spec/ruby/language/regexp/interpolation_spec.rb
index 5536c718f1..f771d0a395 100644
--- a/spec/ruby/language/regexp/interpolation_spec.rb
+++ b/spec/ruby/language/regexp/interpolation_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 "Regexps with interpolation" do
@@ -36,14 +36,14 @@ describe "Regexps with interpolation" do
it "gives precedence to escape sequences over substitution" do
str = "J"
- /\c#{str}/.to_s.should == '(?-mix:\c#' + '{str})'
+ /\c#{str}/.to_s.should.include?('{str}')
end
it "throws RegexpError for malformed interpolation" do
s = ""
- lambda { /(#{s}/ }.should raise_error(RegexpError)
+ -> { /(#{s}/ }.should.raise(RegexpError)
s = "("
- lambda { /#{s}/ }.should raise_error(RegexpError)
+ -> { /#{s}/ }.should.raise(RegexpError)
end
it "allows interpolation in extended mode" do