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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1018ad8769adfc0c8f21a8e26705652eb15fd827
4
- data.tar.gz: 2b7c9a2dd0b4c5e500c37e76e5c4ed55cf6b972b
3
+ metadata.gz: 0ebf686025b5cc17c869bc0be46f3fc2005cf079
4
+ data.tar.gz: 10caa8ee1bdaff71f2a20fc57209e07c57bc66f5
5
5
  SHA512:
6
- metadata.gz: 6e3c711a81491a0112406cc18649ae16cb546b633db18739a207320d9587a39a9baf34869def9772951bf16be28470528f02c80a5a571dc10fec2bd21da912ca
7
- data.tar.gz: 8c02998a7e094d02d267d0c2e1f06c2b05c41a0e910c6f723dcfef764a324de8d1404604232defc75d8003f6111c05fd809fa9d16e7244c0eb560b98b410f17a
6
+ metadata.gz: 81297ab5b851f8523724b4a10cd32f178fe1e66110d90b947ef03a6f4258ec75d504661171fd37a276479c7f8f046bb6046bd6b75f241d37147bcb5088b4af0c
7
+ data.tar.gz: e84a330de156271297a93e369a7da4686dd3f6a0608b2e234e74269dc2e8e1ae60feb75e2601be8de1a4f8b66864bf3bf7cb2b788383eb10b31d1b04cf254d51
@@ -1,3 +1,3 @@
1
1
  module MorseSpecHelpers
2
- VERSION = "0.2.0"
2
+ VERSION = "2.0.0"
3
3
  end
@@ -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: 0.2.0
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: 2015-11-19 00:00:00.000000000 Z
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.4.8
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.