Sha256: cbaaa5806b933da783290db1be42b78fe3d4be6909c2caf0ae01597ed7b6ed99

Contents?: true

Size: 602 Bytes

Versions: 6

Compression:

Stored size: 602 Bytes

Contents

require 'spec_helper'

describe 'EcmaReValidator::ModeModifiers' do
  it 'should fail if regexp has simple option' do
    re = '(?i)test'

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

  it 'should fail if regexp has multiple options' do
    re = '(?ism)test'

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

  it 'should fail if regexp has colon option' do
    re = '(?mix:abc)'

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

  it 'should fail if regexp has hyphen option' do
    re = 'te(?-i)st'

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

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ecma-re-validator-0.3.0 spec/mode_modifiers_spec.rb
ecma-re-validator-0.2.1 spec/mode_modifiers_spec.rb
ecma-re-validator-0.2.0 spec/mode_modifiers_spec.rb
ecma-re-validator-0.1.2 spec/mode_modifiers_spec.rb
ecma-re-validator-0.1.1 spec/mode_modifiers_spec.rb
ecma-re-validator-0.1.0 spec/mode_modifiers_spec.rb