daily_affirmation 0.7.0 → 0.7.1

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: ad1c5a4b4e1e7249d7c2d5dbf1fa15f12359e42c
4
- data.tar.gz: f78b555770fa41e2d8fa5067386fc222f4cedcd1
3
+ metadata.gz: 311e00301c5ac2fc0ef7137531472997e5f9668b
4
+ data.tar.gz: 6df1cba1e7c2560e5d2853dfc5600ce3bd74a0aa
5
5
  SHA512:
6
- metadata.gz: 021ecc75cfd176b1c0dcef4c20483390eae03c1cd6fbc70ed1ecb59a017668c26407ef50d953b82d95e2f69a073c8bd68cae5755d0ff848d495abbbe8d92e268
7
- data.tar.gz: 59f2f6394cf6d359e39b8a7c441b2ae9882ce7e6bd63f993a4690418dd114c06d418b29810a5339f427e164ca99bb2153f8cc3cb0a1aab6b67c2eb0c4c5e1785
6
+ metadata.gz: 135d36905bc518d3a39e1504d9d2ff4d2a42cc9055b8d206ef84abeb164fe7d78db17efe81e5db39bc5346008f9292a7acae1553b87cad1695504cdaf31e4085
7
+ data.tar.gz: 67c1b7f3a369dfb7732d97391b824b3d4290127a867f35db5ebdb5fe07f795fa75c7bd6689da7162699435c7b7b8b86a34776b77ee16cafc0ac6b07aa6916ac5
@@ -119,6 +119,12 @@ module DailyAffirmation
119
119
  }.merge(opts)
120
120
  end
121
121
 
122
+ def affirms_valid_date(attribute, opts = {})
123
+ affirmations << {
124
+ :attribute => attribute, :type => :date
125
+ }.merge(opts)
126
+ end
127
+
122
128
  def affirms(attribute, opts = {})
123
129
  affirmations << {
124
130
  :attribute => attribute, :type => :custom
@@ -1,3 +1,3 @@
1
1
  module DailyAffirmation
2
- VERSION = "0.7.0"
2
+ VERSION = "0.7.1"
3
3
  end
@@ -98,20 +98,22 @@ describe DailyAffirmation do
98
98
  affirms_length_of :password, :range => 8..40
99
99
  affirms_numericality_of :age
100
100
  affirms_presence_of :name
101
+ affirms_valid_date :created_at
101
102
  affirms :name, :proc => Proc.new { |object|
102
103
  object.name == "Bobby Tabbles"
103
104
  }
104
105
  end
105
106
  end
106
107
 
107
- it "correct sets up affirmations" do
108
+ it "correctly sets up affirmations" do
108
109
  obj = double(
109
110
  :conflicts => nil,
110
111
  :eula => true,
111
112
  :password => "test1234",
112
113
  :password_confirmation => "test1234",
113
114
  :age => 19,
114
- :name => "Bobby Tabbles"
115
+ :name => "Bobby Tabbles",
116
+ :created_at => "1981-11-28"
115
117
  )
116
118
 
117
119
  affirmation = cls.new(obj)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: daily_affirmation
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shane Emmons