vcardigan 0.0.6 → 0.0.7

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: 848d27844cf20837560cd7701c7adff92125468c
4
- data.tar.gz: 3abfac9811f1d2c1f445c21fa48fb26a80f5fa45
3
+ metadata.gz: fecc595fa698e75daf5a8fa962f921ca403a7bb1
4
+ data.tar.gz: 42aca309a5059eb66eaf3f4c2c879c01f76955ee
5
5
  SHA512:
6
- metadata.gz: afbd21e400c00e7613394c8233c12d373776a01d99fb9f75bc4e6aa7e5651ce52114f0adb90dc442cfd814d4fe38341ffdea7e5835e2d667c95fbc8740034c80
7
- data.tar.gz: 512b60cd50f5e453198bb16d86bcc4755aea3915e2b10659203c1bd25c770a86786491d0efa4e946927996640276b6ad1d69f478234efe81625096ef0886c669
6
+ metadata.gz: 47f0e8c1ff8ad181d2eed402c87d2d21059b28e6fcad55e8fa5656745099f0af9c6e611640292c21e3911432e34f4beb96ca93f0fbccb3c33a96257de466d27b
7
+ data.tar.gz: 1377d0431be7981ccf7270cc7130c25f01612b04319e45e7659732eecaf1c871c93400edf9429493462bec3b8d37a0e27c4b0d0672831d50f33fb070f59d3f73
@@ -65,9 +65,13 @@ module VCardigan
65
65
  @group = nil
66
66
  end
67
67
 
68
+ args.reject!(&:nil?)
69
+
68
70
  # Build the property and add it to the vCard
69
- property = build_prop(name, *args)
70
- add_prop(property)
71
+ if args.any?
72
+ property = build_prop(name, *args)
73
+ add_prop(property)
74
+ end
71
75
  end
72
76
 
73
77
  def remove(name)
@@ -1,5 +1,5 @@
1
1
  module VCardigan
2
2
 
3
- VERSION = '0.0.6'
3
+ VERSION = '0.0.7'
4
4
 
5
5
  end
@@ -108,6 +108,31 @@ describe VCardigan::VCard do
108
108
  groups[group.to_s].first.should be_an_instance_of(VCardigan::Property)
109
109
  end
110
110
  end
111
+
112
+ context 'regardless of group' do
113
+
114
+ before do
115
+ vcard.add(name, *values)
116
+ end
117
+
118
+ context 'some args are nil' do
119
+
120
+ let(:values) { [nil, 'joe@strummer.com'] }
121
+
122
+ it 'should not build properties from nil args' do
123
+ fields[name.to_s].first.values.should == [values.last]
124
+ end
125
+ end
126
+
127
+ context 'all args are nil' do
128
+
129
+ let(:values) { [nil, nil] }
130
+
131
+ it 'should not build properties' do
132
+ fields[name.to_s].should be_nil
133
+ end
134
+ end
135
+ end
111
136
  end
112
137
 
113
138
  describe "#remove" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vcardigan
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Morgan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-11 00:00:00.000000000 Z
11
+ date: 2015-03-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -82,3 +82,4 @@ test_files:
82
82
  - spec/examples/property_spec.rb
83
83
  - spec/examples/vcard_spec.rb
84
84
  - spec/spec_helper.rb
85
+ has_rdoc: false