Sha256: a9216114aa1f06ea933c58c01443990330ab2a0c3b1f1c4de892d2657c7701e4
Contents?: true
Size: 582 Bytes
Versions: 19
Compression:
Stored size: 582 Bytes
Contents
require File.dirname(File.join(__rhoGetCurrentDir(), __FILE__)) + '/../../spec_helper' describe "Regexp#inspect" do it "returns a formatted string that would eval to the same regexp" do /ab+c/ix.inspect.should == "/ab+c/ix" /a(.)+s/n.inspect.should =~ %r|/a(.)+s/n?| # Default 'n' may not appear /a(.)+s/u.inspect.should == "/a(.)+s/u" # But a specified one does end it "correctly escapes forward slashes /" do Regexp.new("/foo/bar").inspect.should == "/\\/foo\\/bar/" Regexp.new("/foo/bar[/]").inspect.should == "/\\/foo\\/bar[\\/]/" end end
Version data entries
19 entries across 19 versions & 1 rubygems