aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/test
diff options
context:
space:
mode:
authorKoichi ITO <koic.ito@gmail.com>2019-04-16 17:05:50 +0900
committerKoichi ITO <koic.ito@gmail.com>2019-04-16 17:58:24 +0900
commitc6379fd27f159177a54f34796a0f5e4c778c4290 (patch)
tree9d19b59b99f6c6247443c4cab6b56c5c320c596a /actionview/test
parent20b94af9eb9305d19a343f72f0afb18eb49e2de7 (diff)
downloadrails-c6379fd27f159177a54f34796a0f5e4c778c4290.tar.gz
rails-c6379fd27f159177a54f34796a0f5e4c778c4290.tar.bz2
rails-c6379fd27f159177a54f34796a0f5e4c778c4290.zip
Bump RuboCop to 0.67.2
Performance cops will be extracted from RuboCop to RuboCop Performance when next RuboCop 0.68 will be released. https://github.com/rubocop-hq/rubocop/issues/5977 RuboCop 0.67 is its transition period. Since rails/rails repository uses Performance cops, This PR added rubocop-performance gem to Gemfile. And this PR fixes some offenses using the following auto-correct. ```console % bundle exec rubocop -a Offenses: activerecord/test/cases/connection_adapters/connection_handlers_multi_db_test.rb:212:26: C: [Corrected] Layout/SpaceAroundOperators: Operator = > should be surrounded by a single space. "primary" => { adapter: "sqlite3", database: "db/primary.sqlite3" } ^^ activerecord/test/cases/connection_adapters/connection_handlers_multi_db_test.rb:239:26: C: [Corrected] Layout/SpaceAroundOperators: Operator => should be surrounded by a single space. "primary" => { adapter: "sqlite3", database: "db/primary.sqlite3" } ^^ actionview/test/template/resolver_shared_tests.rb:1:1: C: [Corrected] Style/FrozenStringLiteralComment: Missing magic comment # frozen_string_literal: true. module ResolverSharedTests ^ actionview/test/template/resolver_shared_tests.rb:10:33: C: [Corrected] Layout/SpaceAroundEqualsInParameterDefault: Surrounding space missing in default value assignment. def with_file(filename, source="File at #{filename}") ^ actionview/test/template/resolver_shared_tests.rb:106:5: C: [Corrected] Rails/RefuteMethods: Prefer assert_not_same over refute_same. refute_same a, b ^^^^^^^^^^^ 2760 files inspected, 5 offenses detected, 5 offenses corrected ```
Diffstat (limited to 'actionview/test')
-rw-r--r--actionview/test/template/resolver_shared_tests.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/actionview/test/template/resolver_shared_tests.rb b/actionview/test/template/resolver_shared_tests.rb
index 525b452075..8b47c5bc89 100644
--- a/actionview/test/template/resolver_shared_tests.rb
+++ b/actionview/test/template/resolver_shared_tests.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module ResolverSharedTests
attr_reader :tmpdir
@@ -7,7 +9,7 @@ module ResolverSharedTests
end
end
- def with_file(filename, source="File at #{filename}")
+ def with_file(filename, source = "File at #{filename}")
path = File.join(tmpdir, filename)
FileUtils.mkdir_p(File.dirname(path))
File.write(path, source)
@@ -103,7 +105,7 @@ module ResolverSharedTests
c = context.find("hello_world", "test", false, [], {})
# disable_cache should give us a new object
- refute_same a, b
+ assert_not_same a, b
# but it should not clear the cache
assert_same a, c