Skip to content

Commit

Permalink
[fix] spec files not ends with "_spec.rb" (#3879)
Browse files Browse the repository at this point in the history
* [modify] rename specs not ends with "_spec.rb"

* [modify] move support file under "spec/support/"

* [modify] exit on failure if spec files not ended with "_spec.rb" are found
  • Loading branch information
sunny4381 committed Apr 15, 2021
1 parent 7fc90e2 commit 294e394
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion .travis.d/split_specs.rb
Expand Up @@ -12,7 +12,14 @@
opt.parse!(ARGV)
end

spec_files = Dir.glob("#{ARGV.first || "spec"}/**/*.rb")
count = `find spec -name '*.rb' | fgrep -v spec/factories/ | fgrep -v spec/support/ | fgrep -v _spec.rb | wc -l`
count = count.strip.to_i
if count > 1
puts "there are spec files which aren't ended with \"_spec.rb\""
exit!
end

spec_files = Dir.glob("#{ARGV.first || "spec"}/**/*_spec.rb")
excludes.each do |exclude|
spec_files.reject! { |file| file.include?(exclude) }
end
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 294e394

Please sign in to comment.