go_import 3.0.21 → 3.0.22

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NWU4ODY3ZjBlYWZjYTExMzE2NjExMmIxODYzZjZkOWJkODk5MDg3ZA==
4
+ MzkxYmMwYWUwM2M0MjE1YTZmNzA0YjdiN2Q5NWZmMTk0YWVkZDhiOQ==
5
5
  data.tar.gz: !binary |-
6
- OWNlYzA4NjJmYmIzNDU1OTZlNzFiZGU1YWExNjYxNTM2MGQyMjUxMg==
6
+ NzBkM2ZkMDkzNWQ1MGM0MDc5MmU5MzBmNDMzYmMwNGRjNGQ5YmVkMg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YzJlNjIxOTViMDhhN2Q0ZGVlMDc2YjA0YThkOGUyNjUyY2I2NmVlMDBjNjZj
10
- Y2E2NTkzMDQwZjJjNWZkYjUzZmVhMTc5OTBiZDZlZTBjOTA0ZjM4ZWU3MmRh
11
- ZDZiMzU0ZDkzZTI4YWQ1NDhkNmY3YTJhOWM2ZmI0YmZlN2U4ZTQ=
9
+ N2Y4ZTM1ZWQxNDAyYmQ5MWVhZmE5OGM1NzYzOTJhYTliOWVjNDZjN2I1YmMy
10
+ MTVkOGU1N2I1ZjVmNmYyYTcwZWQ1YTE0ODQzM2I4OTZlZTFmYTRhM2Q4NDFi
11
+ ODFjMzI5NDYyNmFjMjAwMDVhODE0ODliNTQ0NGRhNWUwNGQ4MzM=
12
12
  data.tar.gz: !binary |-
13
- ODU4M2I5NmNlOWM5MTM1M2MwMmFhZjYzNDVhMTRlMWIzOTkwNjFmYmNhNjgz
14
- YmFjYmQ0NDRkYTkzYTI1ZGQ0ZmM5MTI0YTY4NmEyYTZjYjEwMWYwNDJhMjcx
15
- ZDg3Y2UyMDUwMTQ0YTkyZjFhNDI2NGQxZTA1MTM4ZDYwOTQ5MjU=
13
+ ZWRkYWI2MGRiZDI1YTcxZmVlNTUyNWNhOWUxZTc0ZmQyZWY4Nzg3YzdlMzI0
14
+ ZTY3YTZkYjA5MjZlZWRkNWNlOWQ2YzJlZjEzNTZlNTNjYjJlNjA0OWEzMGVk
15
+ ZmRjMDJlNjU0YjEwZjdmYTAxNTM5MzFjYzlhMmI5OWUzNWQ4Y2I=
@@ -47,6 +47,18 @@ module GoImport
47
47
  # @example
48
48
  # obj.set_tag("partner")
49
49
  def set_tag(str)
50
+ if str.nil?
51
+ return
52
+ end
53
+
54
+ if !str.is_a?(String)
55
+ return
56
+ end
57
+
58
+ if str.length == 0
59
+ return
60
+ end
61
+
50
62
  @tags = [] if @tags == nil
51
63
  if ! @tags.any? {|tag| tag.value == str }
52
64
  @tags.push(Tag.new(str))
@@ -12,6 +12,42 @@ describe "Organization" do
12
12
  organization.tags[0].value.should eq 'Import'
13
13
  end
14
14
 
15
+ it "should not accept empty tags" do
16
+ # given
17
+ organization.tags.count.should eq 1
18
+
19
+ # when
20
+ organization.set_tag ""
21
+
22
+ # then
23
+ organization.tags.count.should eq 1
24
+ end
25
+
26
+ it "should not accept nil tags" do
27
+ # given
28
+ organization.tags.count.should eq 1
29
+
30
+ # when
31
+ organization.set_tag ""
32
+
33
+ # then
34
+ organization.tags.count.should eq 1
35
+ end
36
+
37
+ it "should not accept objects as tags" do
38
+ # given
39
+ organization.tags.count.should eq 1
40
+
41
+ # when
42
+ not_a_tag = {}
43
+ not_a_tag[:text] = 'this is not a tag'
44
+ organization.set_tag not_a_tag
45
+
46
+ # then
47
+ organization.tags.count.should eq 1
48
+ end
49
+
50
+
15
51
  it "must have a name" do
16
52
  # given, when
17
53
  organization.name = "Lundalogik"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: go_import
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.21
4
+ version: 3.0.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oskar Gewalli
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2014-12-16 00:00:00.000000000 Z
14
+ date: 2014-12-18 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: iso_country_codes