Skip to content
Browse files

added issn duplicate test

  • Loading branch information...
1 parent 1a53039 commit 6beff471109fc1969fbd63d38828627034bcf61e @inukshuk inukshuk committed Aug 5, 2012
Showing with 15 additions and 5 deletions.
  1. +3 −3 spec/repository_spec.rb
  2. +12 −2 spec/spec_helper.rb
View
6 spec/repository_spec.rb
@@ -12,8 +12,8 @@
(Independents.keys & Dependents.keys).should be_empty
end
- # it "contains no duplicate ISSNs" do
- # ISSN.select { |k,v| v.length > 1 }.should == []
- # end
+ it "contains no duplicate ISSNs" do
+ ISSN.select { |k,v| v.length > 1 }.should == []
+ end
end
View
14 spec/spec_helper.rb
@@ -14,8 +14,18 @@ def load_style(path)
# failed to parse the style. we'll report the error later
end
- begin
- ISSN[style.info.issn.to_s] << id if style.info.has_issn?
+ begin
+ if style.info.has_issn?
+ Array(style.info.issn).each do |issn|
+ ISSN[issn.to_s] << id
+ end
+ end
+
+ if style.info.has_eissn?
+ Array(style.info.eissn).each do |issn|
+ ISSN[issn.to_s] << id
+ end
+ end
rescue
warn "Failed to extract ISSN of style #{id}"
end

0 comments on commit 6beff47

Please sign in to comment.
Something went wrong with that request. Please try again.