midas-touch 1.0.2 → 1.1.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: df3d7086ad726575633c4a839b5d4678615d1489
4
- data.tar.gz: 6c8280a9b675d4bb89d09145e8c55e070583a457
3
+ metadata.gz: c527fea408df2919892f89e30efe5017c6b94a0a
4
+ data.tar.gz: 296c1566ff48d6dbb3fb2cb71c4565a3bf7bfe09
5
5
  SHA512:
6
- metadata.gz: 1b3eb71dcb143074e26706a909fba71234eba6bb14e0bf1dc5c653da6311a4e4e34b355af8b11c334917cbf59c7c37c76b49c4eb48dce357e6b868d586531f5a
7
- data.tar.gz: 985226227c4c9a3a6f9efd23358cab858a2be59b10eee77908aa3f813ac4c5b9d1f60ba46fab9e1f51a71b4bab3f195955dfe6c39c11d986436297952553de36
6
+ metadata.gz: 8e39f918f786e9efd6ac74e58f04c3503ca4b224a5874ed21fe2594f156da8f128fde2a34919116de5b172a92fb6e847efb3e5f68faee590cd32062e862652ac
7
+ data.tar.gz: 701cc5f2ab467878e6c87b75db04f1ef83738221284ed3732f6c5b6978682ec610fcff488652726225f02e78a8f8d431dd61b095e20e63e72d2066ff3042b185
@@ -20,6 +20,13 @@ Feature: Handling collections of input
20
20
  When it is validated
21
21
  Then all inputs are validated
22
22
 
23
+ Scenario: Invalidating inputs
24
+ Given I have an InputGroup
25
+ And it has inputs
26
+ When it is validated
27
+ And I invalidate an input
28
+ Then the input is invalid
29
+
23
30
  Scenario: Enumerate over values
24
31
  Given I have an InputGroup
25
32
  And it has inputs
@@ -66,3 +66,12 @@ Then(/^I can iterate over the names and values$/) do
66
66
  exp = { :foo => "foo", :bar => "bar" }
67
67
  assert_equal(exp, act)
68
68
  end
69
+
70
+ And(/^I invalidate an input$/) do
71
+ @group.invalidate_input(:bar)
72
+ end
73
+
74
+ Then(/^the input is invalid$/) do
75
+ refute(@group.input(:bar).valid?)
76
+ refute(@group.valid?)
77
+ end
@@ -55,6 +55,12 @@ module MidasTouch
55
55
  @failures.include?(input(name))
56
56
  end
57
57
 
58
+ def invalidate_input(input_name)
59
+ input = input(input_name)
60
+ input.invalidate!
61
+ @failures << input
62
+ end
63
+
58
64
  def to_h
59
65
  Hash[@inputs.map { |input| [input.name, input.value] }]
60
66
  end
@@ -1,3 +1,3 @@
1
1
  module MidasTouch
2
- VERSION = "1.0.2"
2
+ VERSION = "1.1.0"
3
3
  end
@@ -5,8 +5,8 @@ require 'midas-touch/version'
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "midas-touch"
7
7
  spec.version = MidasTouch::VERSION
8
- spec.authors = ["Darren Coxall"]
9
- spec.email = ["darren@simplybusiness.co.uk"]
8
+ spec.authors = ["Darren Coxall", "Martin Laine"]
9
+ spec.email = ["darren@simplybusiness.co.uk", "martin.laine@simplybusiness.co.uk"]
10
10
  spec.summary = %q{Turn all your inputs to Gold.}
11
11
  spec.description = %q{Clean and validate your inputs from forms or other areas of your application.}
12
12
  spec.license = "MIT"
metadata CHANGED
@@ -1,14 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: midas-touch
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Darren Coxall
8
+ - Martin Laine
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2014-06-26 00:00:00.000000000 Z
12
+ date: 2014-06-27 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: bundler
@@ -97,6 +98,7 @@ dependencies:
97
98
  description: Clean and validate your inputs from forms or other areas of your application.
98
99
  email:
99
100
  - darren@simplybusiness.co.uk
101
+ - martin.laine@simplybusiness.co.uk
100
102
  executables: []
101
103
  extensions: []
102
104
  extra_rdoc_files: []