vcardigan 0.0.5 → 0.0.6

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: 7799d87438e5ba3eaad59ae21715a984f745d250
4
- data.tar.gz: 0aaddc3527eef3b5213196715f71383197d610d4
3
+ metadata.gz: 848d27844cf20837560cd7701c7adff92125468c
4
+ data.tar.gz: 3abfac9811f1d2c1f445c21fa48fb26a80f5fa45
5
5
  SHA512:
6
- metadata.gz: 726b70f8e1404cd2f51c945678b0929f519f90efbe3e99c4b7b78f350b810cae4195d6d47e4ed203f2a3fd53f7a9f81013e75cf3bff8b67ad72176ea2fedec5c
7
- data.tar.gz: 6136cdfef1723d5c74b0231bffa58f1bf6d273ed07619135064a5b90f837d8dedbba7c7085131da8a2590eeeb40c570f7761e9ace4b8e8b4fc278f6aff79139d
6
+ metadata.gz: afbd21e400c00e7613394c8233c12d373776a01d99fb9f75bc4e6aa7e5651ce52114f0adb90dc442cfd814d4fe38341ffdea7e5835e2d667c95fbc8740034c80
7
+ data.tar.gz: 512b60cd50f5e453198bb16d86bcc4755aea3915e2b10659203c1bd25c770a86786491d0efa4e946927996640276b6ad1d69f478234efe81625096ef0886c669
@@ -136,6 +136,13 @@ module VCardigan
136
136
  return vcard
137
137
  end
138
138
 
139
+ def valid?
140
+ validate
141
+ true
142
+ rescue VCardigan::EncodingError
143
+ false
144
+ end
145
+
139
146
  # Aliases ##########
140
147
 
141
148
  def name(*args)
@@ -1,5 +1,5 @@
1
1
  module VCardigan
2
2
 
3
- VERSION = '0.0.5'
3
+ VERSION = '0.0.6'
4
4
 
5
5
  end
@@ -274,6 +274,23 @@ describe VCardigan::VCard do
274
274
  end
275
275
  end
276
276
 
277
+ describe "#valid?" do
278
+ let(:vcard) { VCardigan.create }
279
+
280
+ context 'with no FN' do
281
+ it 'it should return false' do
282
+ expect( vcard.valid? ).to be_false
283
+ end
284
+ end
285
+
286
+ context 'with FN' do
287
+ it 'it should return true' do
288
+ vcard.fullname("My Name")
289
+ expect( vcard.valid? ).to be_true
290
+ end
291
+ end
292
+ end
293
+
277
294
  describe '#parse' do
278
295
  context 'valid 4.0 vCard' do
279
296
  let(:data) { File.read(File.dirname(__FILE__) + '/../helpers/joe.vcf') }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vcardigan
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Morgan