morse_spec_helpers 0.2.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/morse_spec_helpers/version.rb +1 -1
- data/lib/morse_spec_helpers.rb +18 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0ebf686025b5cc17c869bc0be46f3fc2005cf079
|
4
|
+
data.tar.gz: 10caa8ee1bdaff71f2a20fc57209e07c57bc66f5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 81297ab5b851f8523724b4a10cd32f178fe1e66110d90b947ef03a6f4258ec75d504661171fd37a276479c7f8f046bb6046bd6b75f241d37147bcb5088b4af0c
|
7
|
+
data.tar.gz: e84a330de156271297a93e369a7da4686dd3f6a0608b2e234e74269dc2e8e1ae60feb75e2601be8de1a4f8b66864bf3bf7cb2b788383eb10b31d1b04cf254d51
|
data/lib/morse_spec_helpers.rb
CHANGED
@@ -80,6 +80,24 @@ module MorseSpecHelpers
|
|
80
80
|
end
|
81
81
|
end
|
82
82
|
|
83
|
+
def mandatory_date_or_default(method, default)
|
84
|
+
describe "#{method} is a mandatory date that defaults to a value" do
|
85
|
+
context "where it is present" do
|
86
|
+
it "should be valid" do
|
87
|
+
allow(@instance).to receive(method).and_return(Date.today)
|
88
|
+
expect(@instance).to be_valid
|
89
|
+
end
|
90
|
+
end
|
91
|
+
context "where it is not present" do
|
92
|
+
it "should set to the default" do
|
93
|
+
@instance.send("{method}=", nil)
|
94
|
+
expect(@instance).to be_valid
|
95
|
+
expect(@instance.send(method)).to eq(default)
|
96
|
+
end
|
97
|
+
end
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
83
101
|
def mandatory_datetime(method,time=nil)
|
84
102
|
context "#{method} is a mandatory datetime" do
|
85
103
|
it "should reject a blank #{method}" do
|
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:
|
4
|
+
version: 2.0.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:
|
11
|
+
date: 2016-03-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -78,7 +78,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
78
78
|
version: '0'
|
79
79
|
requirements: []
|
80
80
|
rubyforge_project:
|
81
|
-
rubygems_version: 2.
|
81
|
+
rubygems_version: 2.5.1
|
82
82
|
signing_key:
|
83
83
|
specification_version: 4
|
84
84
|
summary: A series of helpers to make the rspec experience nicer.
|