multiparameter_date_time 0.1.0 → 0.1.1

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: a1d5bf1e19ef662fcef74a5542b2f6046dce1493
4
- data.tar.gz: e8f92e002abf4866f473a5bdcada8df620e66881
3
+ metadata.gz: 2d717719290be36be6c8d1fb0ff2741e93bb338a
4
+ data.tar.gz: 5c2fda8d5e8ecd689d617b19915a9e4e2575a8f8
5
5
  SHA512:
6
- metadata.gz: 498c0ffc96a2e09c3aa0bb84d504bc8f8f7c1cd472eaa59e2501712efacb396887bd1c47d85fc3383bfd95c8b47e3aa19ccde29b6a2b0fe33370d39502112d17
7
- data.tar.gz: 6ef9b29279656b63bbc42bb03961114c773d4e84f5a7874f5553b7888ff95d82a8d9000462eeeadd61687ac4a01691c12c253d8f12d616e530cc306bfb6b8683
6
+ metadata.gz: 7aa475440b63e652a9f1fe34dc15e4f6adf957ce297c6b1ba98a03edca3001e77583d49259e019fc33c89ea4b28b2105e4290f4a041a122e98589eb757352d46
7
+ data.tar.gz: 14361fd03a3053ad5ab0b61361ea0e199d82e6ebb14d5c8baee46afc36a42ac2ca56a1484d5c91f48e6df694ba3be7832b5ff13d0edc6cc3321980d1b3f1e2f0
@@ -4,8 +4,7 @@ require 'is_valid_multiparameter_date_time_validator'
4
4
 
5
5
  module MultiparameterDateTime
6
6
  extend ActiveSupport::Concern
7
-
8
- VALID_DATE_FORMAT = /\A((\d{1,2}[\/\-.]\d{1,2}[\/\-.]\d{2,4})|(\d{4}-\d{1,2}-\d{1,2}))/
7
+ VALID_DATE_FORMAT = /\A((\d{1,2}[\/\-.]\d{1,2}[\/\-.]\d{2,4})\z|(\d{4}-\d{1,2}-\d{1,2})\z)/
9
8
  VALID_STANDARD_TIME_FORMAT = /\A[0]*([1-9]|1[0-2]):\d{2}(:\d{2})?\s*([apAP][mM])?\s*([A-Z]{3,5})?\Z/
10
9
  VALID_MILITARY_TIME_FORMAT = /\A[0]*([0-9]|1[0-9]|2[0-3]):\d{2}(:\d{2})?\s*([A-Z]{3,5})?\Z/
11
10
 
@@ -1,3 +1,3 @@
1
1
  module MultiparameterDateTime
2
- VERSION = '0.1.0'
2
+ VERSION = '0.1.1'
3
3
  end
@@ -156,6 +156,36 @@ describe IsValidMultiparameterDateTimeValidator do
156
156
  end
157
157
  end
158
158
 
159
+ context "with a date that has invalid format" do
160
+ context "with year has 5 digits" do
161
+ let(:date_string) { '1/1/12012' }
162
+ let(:time_string) { '12:31pm' }
163
+
164
+ it_should_behave_like "a badly formatted date or time"
165
+ end
166
+
167
+ context "with year has 1 digit" do
168
+ let(:date_string) { '1/1/2' }
169
+ let(:time_string) { '12:31pm' }
170
+
171
+ it_should_behave_like "a badly formatted date or time"
172
+ end
173
+
174
+ context "with month has 3 digits" do
175
+ let(:date_string) { '100/1/2012' }
176
+ let(:time_string) { '12:31pm' }
177
+
178
+ it_should_behave_like "a badly formatted date or time"
179
+ end
180
+
181
+ context "with day has 3 digits" do
182
+ let(:date_string) { '10/100/2012' }
183
+ let(:time_string) { '12:31pm' }
184
+
185
+ it_should_behave_like "a badly formatted date or time"
186
+ end
187
+ end
188
+
159
189
  [' ', nil].each do |date_value|
160
190
  context "with date = #{date_value.inspect}" do
161
191
  let(:date_string) { date_value }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: multiparameter_date_time
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Case Commons, LLC
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2013-10-04 00:00:00.000000000 Z
14
+ date: 2013-11-19 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: american_date
@@ -140,7 +140,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
140
140
  version: '0'
141
141
  requirements: []
142
142
  rubyforge_project:
143
- rubygems_version: 2.1.5
143
+ rubygems_version: 2.0.3
144
144
  signing_key:
145
145
  specification_version: 4
146
146
  summary: Set a DateTime via two accessors, one for the date, one for the time
@@ -148,4 +148,3 @@ test_files:
148
148
  - spec/is_valid_multiparameter_date_time_validator_spec.rb
149
149
  - spec/multiparameter_date_time_spec.rb
150
150
  - spec/spec_helper.rb
151
- has_rdoc: