Skip to content

Commit 1f8714e

Browse files
committed
Add Regexp.quote substring spec
1 parent ec834e2 commit 1f8714e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

spec/ruby/core/regexp/shared/quote.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@
1212
Regexp.send(@method, :symbol).should == 'symbol'
1313
end
1414

15+
it "works with substrings" do
16+
str = ".+[]()"[1...-1]
17+
Regexp.send(@method, str).should == '\+\[\]\('
18+
end
19+
1520
it "sets the encoding of the result to US-ASCII if there are only US-ASCII characters present in the input String" do
1621
str = "abc".force_encoding("euc-jp")
1722
Regexp.send(@method, str).encoding.should == Encoding::US_ASCII

0 commit comments

Comments
 (0)