File: named_capture_groups_spec.rb

package info (click to toggle)
ruby-ecma-re-validator 0.2.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 180 kB
  • sloc: ruby: 301; makefile: 4; sh: 3
file content (15 lines) | stat: -rw-r--r-- 384 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
require 'spec_helper'

describe 'EcmaReValidator::NamedCaptureGroups' do
  it 'should fail if regexp has named capture group using ?<>' do
    re = /(?<name>group)/

    expect(EcmaReValidator.valid?(re)).to eql(false)
  end

  it 'should fail if regexp has named capture group using ?\'\'' do
    re = /(?'name'group)/

    expect(EcmaReValidator.valid?(re)).to eql(false)
  end
end