morse_spec_helpers 0.0.12 → 0.0.13
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 +15 -0
- data/lib/morse_spec_helpers/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a318d32885e6d67acb2939059d512027c107789a
|
4
|
+
data.tar.gz: 24fcdc477cc0bb1db5f8365bff295dcc46010c1a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cdb0335935f82bd3e36cb0ef50c2acc091bfc580ce6be4a919c30680fed0170a3b1fbdb0541a0858f066d6e21893be2e23c29bf15092f39d0b9a56766defcb5f
|
7
|
+
data.tar.gz: b2486b8db013151b53d6fc8c41cbbb5626071f06f62fb531f0720a42909e0e82b3e69ef326faab5573685ad0b8d82f5bdbd9511d69b71baa2d37eeed8688bc2a
|
data/lib/morse_spec_helpers.rb
CHANGED
@@ -346,6 +346,21 @@ module MorseSpecHelpers
|
|
346
346
|
end
|
347
347
|
end
|
348
348
|
|
349
|
+
def optional_integer(method)
|
350
|
+
context "#{method} is an optional integer" do
|
351
|
+
exists(method)
|
352
|
+
it "should make a blank #{method} nil" do
|
353
|
+
@instance.send("#{method}=","")
|
354
|
+
expect(@instance).to be_valid
|
355
|
+
expect(@instance.send(method)).to be_nil
|
356
|
+
end
|
357
|
+
it "should accept a normal integer for #{method}" do
|
358
|
+
@instance.send("#{method}=",1)
|
359
|
+
expect(@instance).to be_valid
|
360
|
+
end
|
361
|
+
end
|
362
|
+
end
|
363
|
+
|
349
364
|
def optional_time(method)
|
350
365
|
context "#{method} is an optional time" do
|
351
366
|
exists(method)
|