choosy 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
data/lib/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.1
1
+ 0.2.2
@@ -8,6 +8,7 @@ module Choosy
8
8
  required?(option, result)
9
9
  populate!(option, result)
10
10
  convert!(option, result)
11
+ restricted?(option, result)
11
12
  validate!(option, result)
12
13
  end
13
14
 
@@ -41,6 +41,14 @@ module Choosy
41
41
  v.verify!(@res)
42
42
  }.should_not raise_error
43
43
  end
44
+
45
+ it "should fail when an enum is not valid" do
46
+ b.enum :enum, [:a, :b], "An enum"
47
+ @res.options[:enum] = :c
48
+ attempting {
49
+ v.verify!(@res)
50
+ }.should raise_error(Choosy::ValidationError, /unrecognized value/)
51
+ end
44
52
  end
45
53
 
46
54
  describe :required? do
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 2
8
- - 1
9
- version: 0.2.1
8
+ - 2
9
+ version: 0.2.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Gabe McArthur