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

Version Path
rhodes-2.0.0.beta11 spec/framework_spec/app/spec/core/regexp/inspect_spec.rb
rhodes-2.0.0.beta10 spec/framework_spec/app/spec/core/regexp/inspect_spec.rb
rhodes-2.0.0.beta9 spec/framework_spec/app/spec/core/regexp/inspect_spec.rb
rhodes-2.0.0.beta8 spec/framework_spec/app/spec/core/regexp/inspect_spec.rb
rhodes-2.0.0.beta7 spec/framework_spec/app/spec/core/regexp/inspect_spec.rb
rhodes-2.0.0.beta6 spec/framework_spec/app/spec/core/regexp/inspect_spec.rb
rhodes-2.0.0.beta4 spec/framework_spec/app/spec/core/regexp/inspect_spec.rb
rhodes-2.0.0.beta3 spec/framework_spec/app/spec/core/regexp/inspect_spec.rb
rhodes-1.5.5 spec/framework_spec/app/spec/core/regexp/inspect_spec.rb
rhodes-2.0.0.beta2 spec/framework_spec/app/spec/core/regexp/inspect_spec.rb
rhodes-2.0.0.beta1 spec/framework_spec/app/spec/core/regexp/inspect_spec.rb
rhodes-1.5.4 spec/framework_spec/app/spec/core/regexp/inspect_spec.rb
rhodes-1.5.3 spec/framework_spec/app/spec/core/regexp/inspect_spec.rb
rhodes-1.5.2 spec/framework_spec/app/spec/core/regexp/inspect_spec.rb
rhodes-1.5.1 spec/framework_spec/app/spec/core/regexp/inspect_spec.rb
rhodes-1.5.0 spec/framework_spec/app/spec/core/regexp/inspect_spec.rb
rhodes-1.4.2 spec/framework_spec/app/spec/core/regexp/inspect_spec.rb
rhodes-1.4.1 spec/framework_spec/app/spec/core/regexp/inspect_spec.rb
rhodes-1.4.0 spec/framework_spec/app/spec/core/regexp/inspect_spec.rb