Skip to content

Commit

Permalink
added issn duplicate test
Browse files Browse the repository at this point in the history
  • Loading branch information
inukshuk committed Aug 5, 2012
1 parent 1a53039 commit 6beff47
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
6 changes: 3 additions & 3 deletions spec/repository_spec.rb
Expand Up @@ -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
14 changes: 12 additions & 2 deletions spec/spec_helper.rb
Expand Up @@ -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
Expand Down

0 comments on commit 6beff47

Please sign in to comment.