lib/tork/config/rails.rb in tork-17.1.0 vs lib/tork/config/rails.rb in tork-18.0.0
- old
+ new
@@ -6,19 +6,13 @@
%r<^db/schema\.rb$>,
%r<^Gemfile\.lock$>
)
Tork::Config.test_file_globbers.update(
- %r<^(app|lib|test|spec)/.+\.rb$> => lambda do |path, matches|
- base = File.basename(path, '.rb')
- poly = ActiveSupport::Inflector.pluralize(base)
- "{test,spec}/**/{#{base},#{poly}_*}_{test,spec}.rb"
- end,
-
- %r<^(test|spec)/factories/.+_factory\.rb$> => lambda do |path, matches|
- base = File.basename(path, '_factory.rb')
- poly = ActiveSupport::Inflector.pluralize(base)
- "{test,spec}/**/{#{base},#{poly}_*}_{test,spec}.rb"
+ %r<^(app|lib|test|spec)/.*?([^/]+?)(_factory)?\.rb$> => lambda do |matches|
+ single = matches[2]
+ plural = ActiveSupport::Inflector.pluralize(single)
+ "{test,spec}/**/{#{single},#{plural}_*}_{test,spec}.rb"
end
)
Tork::Config.after_fork_hooks << proc do
if defined? ActiveRecord::Base and