diff options
author | Xavier Noria <fxn@hashref.com> | 2016-07-23 20:01:56 +0200 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2016-07-23 20:22:20 +0200 |
commit | 99cf7558000090668b137085bfe6bcc06c4571dc (patch) | |
tree | 33511db166bdbaa76ccd29a29daaf6bf343f149d /activerecord/Rakefile | |
parent | 1ca571cc472ffea2dfab43ee57d8204e89d5b1a6 (diff) | |
download | rails-99cf7558000090668b137085bfe6bcc06c4571dc.tar.gz rails-99cf7558000090668b137085bfe6bcc06c4571dc.tar.bz2 rails-99cf7558000090668b137085bfe6bcc06c4571dc.zip |
systematic revision of =~ usage in AR
Where appropriatei, prefer the more concise Regexp#match?,
String#include?, String#start_with?, or String#end_with?
Diffstat (limited to 'activerecord/Rakefile')
-rw-r--r-- | activerecord/Rakefile | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/Rakefile b/activerecord/Rakefile index 012db35765..8fbea61335 100644 --- a/activerecord/Rakefile +++ b/activerecord/Rakefile @@ -51,7 +51,7 @@ end adapter_short = adapter == 'db2' ? adapter : adapter[/^[a-z0-9]+/] t.libs << 'test' t.test_files = (Dir.glob( "test/cases/**/*_test.rb" ).reject { - |x| x =~ /\/adapters\// + |x| x.include?('/adapters/') } + Dir.glob("test/cases/adapters/#{adapter_short}/**/*_test.rb")) t.warning = true @@ -64,7 +64,7 @@ end adapter_short = adapter == 'db2' ? adapter : adapter[/^[a-z0-9]+/] puts [adapter, adapter_short].inspect (Dir["test/cases/**/*_test.rb"].reject { - |x| x =~ /\/adapters\// + |x| x.include?('/adapters/') } + Dir["test/cases/adapters/#{adapter_short}/**/*_test.rb"]).all? do |file| sh(Gem.ruby, '-w' ,"-Itest", file) end or raise "Failures" |