1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Allow rubocop check more files

This commit fix pattern of filenames for `CustomCops/AssertNot` and
`CustomCops/RefuteNot`.

rubocop should check every file under `test/`.

Related to #32441, #32605
This commit is contained in:
bogdanvlviv 2018-04-19 23:25:39 +03:00
parent 8bdf50d515
commit 1a42d87e3b
No known key found for this signature in database
GPG key ID: E4ACD76A6DB6DFDD
6 changed files with 13 additions and 13 deletions

View file

@ -14,12 +14,12 @@ AllCops:
# Prefer assert_not_x over refute_x # Prefer assert_not_x over refute_x
CustomCops/RefuteNot: CustomCops/RefuteNot:
Include: Include:
- '**/*_test.rb' - '**/test/**/*'
# Prefer assert_not over assert ! # Prefer assert_not over assert !
CustomCops/AssertNot: CustomCops/AssertNot:
Include: Include:
- '**/*_test.rb' - '**/test/**/*'
# Prefer &&/|| over and/or. # Prefer &&/|| over and/or.
Style/AndOr: Style/AndOr:

View file

@ -7,9 +7,9 @@ module CacheDeleteMatchedBehavior
@cache.write("foo/bar", "baz") @cache.write("foo/bar", "baz")
@cache.write("fu/baz", "bar") @cache.write("fu/baz", "bar")
@cache.delete_matched(/oo/) @cache.delete_matched(/oo/)
assert !@cache.exist?("foo") assert_not @cache.exist?("foo")
assert @cache.exist?("fu") assert @cache.exist?("fu")
assert !@cache.exist?("foo/bar") assert_not @cache.exist?("foo/bar")
assert @cache.exist?("fu/baz") assert @cache.exist?("fu/baz")
end end
end end

View file

@ -33,7 +33,7 @@ module CacheStoreBehavior
cache_miss = false cache_miss = false
assert_equal 3, @cache.fetch("foo") { |key| cache_miss = true; key.length } assert_equal 3, @cache.fetch("foo") { |key| cache_miss = true; key.length }
assert !cache_miss assert_not cache_miss
end end
def test_fetch_with_forced_cache_miss def test_fetch_with_forced_cache_miss
@ -308,7 +308,7 @@ module CacheStoreBehavior
@cache.write("foo", "bar") @cache.write("foo", "bar")
assert @cache.exist?("foo") assert @cache.exist?("foo")
assert @cache.delete("foo") assert @cache.delete("foo")
assert !@cache.exist?("foo") assert_not @cache.exist?("foo")
end end
def test_original_store_objects_should_not_be_immutable def test_original_store_objects_should_not_be_immutable

View file

@ -30,7 +30,7 @@ module CacheStoreVersionBehavior
def test_exist_with_wrong_version_should_be_false def test_exist_with_wrong_version_should_be_false
@cache.write("foo", "bar", version: 1) @cache.write("foo", "bar", version: 1)
assert !@cache.exist?("foo", version: 2) assert_not @cache.exist?("foo", version: 2)
end end
def test_reading_and_writing_with_model_supporting_cache_version def test_reading_and_writing_with_model_supporting_cache_version

View file

@ -63,7 +63,7 @@ module FailureSafetyBehavior
@cache.write("foo", "bar") @cache.write("foo", "bar")
emulating_unavailability do |cache| emulating_unavailability do |cache|
assert !cache.exist?("foo") assert_not cache.exist?("foo")
end end
end end

View file

@ -30,7 +30,7 @@ module FileUpdateCheckerSharedTests
checker = new_checker { i += 1 } checker = new_checker { i += 1 }
assert !checker.execute_if_updated assert_not checker.execute_if_updated
assert_equal 0, i assert_equal 0, i
end end
@ -41,7 +41,7 @@ module FileUpdateCheckerSharedTests
checker = new_checker(tmpfiles) { i += 1 } checker = new_checker(tmpfiles) { i += 1 }
assert !checker.execute_if_updated assert_not checker.execute_if_updated
assert_equal 0, i assert_equal 0, i
end end
@ -212,7 +212,7 @@ module FileUpdateCheckerSharedTests
touch(tmpfile("foo.rb")) touch(tmpfile("foo.rb"))
wait wait
assert !checker.execute_if_updated assert_not checker.execute_if_updated
assert_equal 0, i assert_equal 0, i
end end
@ -238,7 +238,7 @@ module FileUpdateCheckerSharedTests
mkdir(subdir) mkdir(subdir)
wait wait
assert !checker.execute_if_updated assert_not checker.execute_if_updated
assert_equal 0, i assert_equal 0, i
touch(File.join(subdir, "nested.rb")) touch(File.join(subdir, "nested.rb"))
@ -259,7 +259,7 @@ module FileUpdateCheckerSharedTests
touch(tmpfile("new.txt")) touch(tmpfile("new.txt"))
wait wait
assert !checker.execute_if_updated assert_not checker.execute_if_updated
assert_equal 0, i assert_equal 0, i
# subdir does not look for Ruby files, but its parent tmpdir does. # subdir does not look for Ruby files, but its parent tmpdir does.