Sha256: 7daca6acd6a8cd1a0ee261d3fa0e7ac12de76df0963353eada4b0af255c399f0

Contents?: true

Size: 328 Bytes

Versions: 10

Compression:

Stored size: 328 Bytes

Contents

require 'spec_helper'

describe Spectifly::Xsd::Field do
  describe '#regex' do
    it 'formats regex to xsd-compatible pattern restriction' do
      field = Spectifly::Xsd::Field.new('some field', {
        'Validations' => 'Must match regex "^[0-9]{4}"'
      })
      field.regex.should == '[0-9]{4}[\s\S]*'
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
spectifly-0.0.10 spec/spectifly/xsd/field_spec.rb
spectifly-0.0.9 spec/spectifly/xsd/field_spec.rb
spectifly-0.0.8 spec/spectifly/xsd/field_spec.rb
spectifly-0.0.7 spec/spectifly/xsd/field_spec.rb
spectifly-0.0.6 spec/spectifly/xsd/field_spec.rb
spectifly-0.0.5 spec/spectifly/xsd/field_spec.rb
spectifly-0.0.4 spec/spectifly/xsd/field_spec.rb
spectifly-0.0.3 spec/spectifly/xsd/field_spec.rb
spectifly-0.0.2 spec/spectifly/xsd/field_spec.rb
spectifly-0.0.1 spec/spectifly/xsd/field_spec.rb