Sha256: 9393de411d43b83063e5c5426ffb48f7a3ec3f0ba5023ee3b4fc26f88a4dcfb0
Contents?: true
Size: 1.1 KB
Versions: 36
Compression:
Stored size: 1.1 KB
Contents
# encoding: utf-8 require 'spec_helper' describe Github::Validations::Format do let(:validator) { Class.new.extend(described_class) } context '#_validate_params_values' do let(:permitted) { { 'param_a' => ['a', 'b'], 'param_b' => /^github$/ } } it 'fails to accept unkown value for a given parameter key' do actual = { 'param_a' => 'x' } expect { validator.assert_valid_values(permitted, actual) }.to raise_error(Github::Error::UnknownValue) end it 'accepts known value for a given parameter key' do actual = { 'param_a' => 'a'} validator.assert_valid_values(permitted, actual) end it 'fails to match regex value for a given parameter key' do actual = { 'param_b' => 'xgithub' } expect { validator.assert_valid_values(permitted, actual) }.to raise_error(Github::Error::UnknownValue) end it 'matches regex value for a given parameter key' do actual = { 'param_b' => 'github'} validator.assert_valid_values(permitted, actual) end end end # Github::Validations::Format
Version data entries
36 entries across 36 versions & 1 rubygems