hash_validator 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7a411f83813e65b6e88f8e71843fedec735ced2a
4
- data.tar.gz: bdfe6c8004a6fd92d7e844b5e21f0c8fc893a2ea
3
+ metadata.gz: d01484b5d387d49f0b2dcf62ca144f09fd5e6aa9
4
+ data.tar.gz: 50de42b9c7bdbc0369b771e40fa08bd08eb24522
5
5
  SHA512:
6
- metadata.gz: c7749ca2745434d37ca9b7cba13475c69d2fc40e9167b9b82cd1666782c324349f771030d78cd76f41a4880e1744360b4fcd5746769a5ccc34b0c813197673a6
7
- data.tar.gz: c4ce6d5789409e9ff8d6f1dd6c6fe55791a6f085f66deb735eb8b49a808396d4c42f346ba86ccf9b2f4885f8be54d0ef50622c0ffaec51794bd2b5e05264b468
6
+ metadata.gz: 5a96a9c75edfbc5818b408f6da927d4ac8bf0d3e833921f269961c55c49070eeaac2b5fe12291f66644b6838c83f6fcbd3493404928f812dcf6496739225747b
7
+ data.tar.gz: 3b08657aa451d38bcacef3a4bf940e228c5ba534045d486fe9813c5a87ed5ff16e9c31691e4dc3a8e5dca41e815d05c0b6daf0fed0d0d603a6008c9fdea4f3f0
data/.travis.yml CHANGED
@@ -4,4 +4,6 @@ rvm:
4
4
  - 1.9.3
5
5
  - 2.0.0
6
6
  - 2.1.0
7
+ - 2.2.0
8
+ - 2.3.0
7
9
  - jruby-19mode
data/README.md CHANGED
@@ -1,10 +1,10 @@
1
1
  # Hash Validator
2
2
 
3
- [![Gem Version](https://badge.fury.io/rb/hash_validator.png)](http://badge.fury.io/rb/hash_validator)
4
- [![Build Status](https://travis-ci.org/JamesBrooks/hash_validator.png)](https://travis-ci.org/JamesBrooks/hash_validator)
5
- [![Coverage Status](https://coveralls.io/repos/JamesBrooks/hash_validator/badge.png?branch=master)](https://coveralls.io/r/JamesBrooks/hash_validator)
6
- [![Code Climate](https://codeclimate.com/github/JamesBrooks/hash_validator.png)](https://codeclimate.com/github/JamesBrooks/hash_validator)
7
- [![Dependency Status](https://gemnasium.com/JamesBrooks/hash_validator.png)](https://gemnasium.com/JamesBrooks/hash_validator)
3
+ [![Gem Version](https://badge.fury.io/rb/hash_validator.svg)](http://badge.fury.io/rb/hash_validator)
4
+ [![Build Status](https://travis-ci.org/jamesbrooks/hash_validator.svg)](https://travis-ci.org/jamesbrooks/hash_validator)
5
+ [![Coverage Status](https://coveralls.io/repos/jamesbrooks/hash_validator/badge.svg?branch=master)](https://coveralls.io/r/jamesbrooks/hash_validator)
6
+ [![Code Climate](https://codeclimate.com/github/JamesBrooks/hash_validator.svg)](https://codeclimate.com/github/JamesBrooks/hash_validator)
7
+ [![Dependency Status](https://gemnasium.com/jamesbrooks/hash_validator.png)](https://gemnasium.com/jamesbrooks/hash_validator)
8
8
 
9
9
  Ruby library to validate hashes (Hash) against user-defined requirements
10
10
 
@@ -8,7 +8,7 @@ class HashValidator::Validator::PresenceValidator < HashValidator::Validator::Ba
8
8
  end
9
9
 
10
10
  def validate(key, value, validations, errors)
11
- unless value
11
+ if value.nil?
12
12
  errors[key] = presence_error_message
13
13
  end
14
14
  end
@@ -1,3 +1,3 @@
1
1
  module HashValidator
2
- VERSION = '0.4.0'
2
+ VERSION = '0.5.0'
3
3
  end
@@ -41,5 +41,11 @@ describe HashValidator::Validator::Base do
41
41
  expect(errors).not_to be_empty
42
42
  expect(errors).to eq({ key: 'is required' })
43
43
  end
44
+
45
+ it 'should validate false with true' do
46
+ validator.validate(:key, false, {}, errors)
47
+
48
+ expect(errors).to be_empty
49
+ end
44
50
  end
45
51
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hash_validator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Brooks
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-17 00:00:00.000000000 Z
11
+ date: 2016-05-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -133,7 +133,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
133
133
  version: '0'
134
134
  requirements: []
135
135
  rubyforge_project:
136
- rubygems_version: 2.4.6
136
+ rubygems_version: 2.5.1
137
137
  signing_key:
138
138
  specification_version: 4
139
139
  summary: Ruby library to validate hashes (Hash) against user-defined requirements