morse_spec_helpers 0.0.15 → 0.1.0
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 +4 -4
- data/lib/morse_spec_helpers.rb +44 -0
- data/lib/morse_spec_helpers/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b1845d75d9389d20fd422f3b762cce42b0147df7
|
4
|
+
data.tar.gz: 047293471013733919b465daed958993b2b6a57a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 36c8b302b967e6090e7b886202d491dde52f7afb5870e0c8a50dd40c9b5d9602dcd64bf6b956cc2126ecf0d8a1291b8f3352b63cc7729e2eed4b1f52840b68ed
|
7
|
+
data.tar.gz: a919ab898d7d0e8910a3a9a6fccb9a013478f8588bb8d0a6c41d7efa51e12bcd27981a4312175977ce34db829e4bad7257164ea3bcb733c229cdc56b8a757b63
|
data/lib/morse_spec_helpers.rb
CHANGED
@@ -94,6 +94,28 @@ module MorseSpecHelpers
|
|
94
94
|
end
|
95
95
|
end
|
96
96
|
|
97
|
+
def mandatory_email(method)
|
98
|
+
context "#{method} is a mandatory email" do
|
99
|
+
it "should reject a blank #{method}" do
|
100
|
+
@instance.send("#{method}=","")
|
101
|
+
expect(@instance).not_to be_valid
|
102
|
+
end
|
103
|
+
it "should reject a badly formatted email for #{method}" do
|
104
|
+
@instance.send("#{method}=","test@test")
|
105
|
+
expect(@instance).to_not be_valid
|
106
|
+
end
|
107
|
+
it "should accept a properly formatted email for #{method}" do
|
108
|
+
@instance.send("#{method}=","test@test.com")
|
109
|
+
expect(@instance).to be_valid
|
110
|
+
end
|
111
|
+
it "should reject a normal string for #{method}" do
|
112
|
+
@instance.send("#{method}=","test")
|
113
|
+
expect(@instance).to_not be_valid
|
114
|
+
end
|
115
|
+
mandatory_thing(method)
|
116
|
+
end
|
117
|
+
end
|
118
|
+
|
97
119
|
def mandatory_float(method)
|
98
120
|
context "#{method} is a mandatory float" do
|
99
121
|
it "should reject a blank #{method}" do
|
@@ -334,6 +356,28 @@ module MorseSpecHelpers
|
|
334
356
|
end
|
335
357
|
end
|
336
358
|
|
359
|
+
def optional_email(method)
|
360
|
+
context "#{method} is an optional email" do
|
361
|
+
it "should make a blank #{method} nil" do
|
362
|
+
@instance.send("#{method}=","")
|
363
|
+
expect(@instance).to be_valid
|
364
|
+
expect(@instance.send(method)).to be_nil
|
365
|
+
end
|
366
|
+
it "should reject a badly formatted email for #{method}" do
|
367
|
+
@instance.send("#{method}=","test@test")
|
368
|
+
expect(@instance).to_not be_valid
|
369
|
+
end
|
370
|
+
it "should accept a properly formatted email for #{method}" do
|
371
|
+
@instance.send("#{method}=","test@test.com")
|
372
|
+
expect(@instance).to be_valid
|
373
|
+
end
|
374
|
+
it "should reject a normal string for #{method}" do
|
375
|
+
@instance.send("#{method}=","test")
|
376
|
+
expect(@instance).to_not be_valid
|
377
|
+
end
|
378
|
+
end
|
379
|
+
end
|
380
|
+
|
337
381
|
def optional_float(method)
|
338
382
|
context "#{method} is an optional float" do
|
339
383
|
exists(method)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: morse_spec_helpers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Terry S
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-03-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|