hdo-storting-importer 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -83,7 +83,7 @@ module Hdo
83
83
  @party = party
84
84
  @body = body
85
85
  @general = general
86
- @categories = categories.map(&:strip).map { |e| UnicodeUtils.upcase(e) }
86
+ @categories = clean_categories(categories)
87
87
  @source = source
88
88
  @page = page
89
89
  end
@@ -100,6 +100,14 @@ module Hdo
100
100
  end
101
101
  end
102
102
 
103
+ private
104
+
105
+ def clean_categories(categories)
106
+ categories.map(&:strip).
107
+ reject(&:empty?).
108
+ map { |e| UnicodeUtils.upcase(e) }
109
+ end
110
+
103
111
  end
104
112
  end
105
113
  end
@@ -1,5 +1,5 @@
1
1
  module Hdo
2
2
  module StortingImporter
3
- VERSION = "0.0.6"
3
+ VERSION = "0.0.7"
4
4
  end
5
5
  end
@@ -98,6 +98,11 @@ XML
98
98
  promise.categories.should == ["ÆØÅ"]
99
99
  end
100
100
 
101
+ it 'ignores empty categories' do
102
+ promise = Promise.new("Party", "Body", true, ["FOO", ""], "PP", 8)
103
+ promise.categories.should == ["FOO"]
104
+ end
105
+
101
106
  end
102
107
  end
103
108
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hdo-storting-importer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: