multiparameter_date_time 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2d717719290be36be6c8d1fb0ff2741e93bb338a
|
4
|
+
data.tar.gz: 5c2fda8d5e8ecd689d617b19915a9e4e2575a8f8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
|
@@ -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.
|
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-
|
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.
|
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:
|