Sha256: d1ba03f1b992ddb53c21457154880545c03cbc9b61c6641ff45b1a5bba85f24f

Contents?: true

Size: 453 Bytes

Versions: 4

Compression:

Stored size: 453 Bytes

Contents

require 'spec_helper'

describe Rosebud::Validations::RegexValidator do
  it 'should raise an error if value does not match regex pattern' do
    expect { Rosebud::Validations::RegexValidator.new.validate_param(:param, 'A', /\d/) }.to raise_error(Errawr::Error)
  end
  
  it 'should not raise an error if does match regex pattern' do
    expect { Rosebud::Validations::RegexValidator.new.validate_param(:param, '1', /\d/) }.not_to raise_error
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rosebud-0.2.0 spec/regex_validator_spec.rb
rosebud-0.1.2 spec/regex_validator_spec.rb
rosebud-0.1.1 spec/regex_validator_spec.rb
rosebud-0.1.0 spec/regex_validator_spec.rb