Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add no-extra-files test

  • Loading branch information...
commit 8b3ea9f8f118973c04da9a930865a11c7f51b7b5 1 parent 39a4360
@inukshuk inukshuk authored
Showing with 16 additions and 2 deletions.
  1. +5 −1 spec/repository_spec.rb
  2. +11 −1 spec/spec_helper.rb
View
6 spec/repository_spec.rb
@@ -9,7 +9,7 @@
end
it "does not contain any duplicate file names" do
- (Independents.keys & Dependents.keys).should be_empty
+ (Independents.keys & Dependents.keys).should == []
end
it "contains no duplicate ISSNs" do
@@ -19,4 +19,8 @@
it "contains no duplicate style titles" do
TITLES.select { |_, styles| styles.length > 1 }.should == {}
end
+
+ it "contains no extra files" do
+ EXTRA_FILES.should == []
+ end
end
View
12 spec/spec_helper.rb
@@ -12,12 +12,22 @@
0036-8075 1095-9203 1359-4184 1476-5578 1097-6256 1546-1726
}
-# These titles are ignored when checking for duplicate Titles
+# These titles are ignored when checking for duplicate titles
TITLES_FILTER = [
# 'example title 1',
# 'example title 2'
]
+# These files are ignored when checking for extra files
+EXTRA_FILES_FILTER = [
+ 'CONTRIBUTING.md', 'Gemfile', 'Gemfile.lock', 'README.md',
+ 'dependent', 'Rakefile', 'spec', 'spec_helper.rb', /_spec\.rb$/
+]
+
+EXTRA_FILES = Dir[File.join(STYLE_ROOT, '**', '*')].reject do |file|
+ name = File.basename(file)
+ File.extname(file) == '.csl' || EXTRA_FILES_FILTER.any? { |f| f === name }
+end
def load_style(path)
filename = File.basename(path)
Please sign in to comment.
Something went wrong with that request. Please try again.