aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2017-01-05 00:40:24 -0500
committerRafael Mendonça França <rafaelmfranca@gmail.com>2017-01-05 00:40:24 -0500
commit209bfc0a5c6416bcba8a90e87159234d72f3e561 (patch)
treee13b3c019335f85204ebb15ac5e779249f15b850
parent46bb76acadc132de0344166db223be5f3fcd5426 (diff)
downloadrails-209bfc0a5c6416bcba8a90e87159234d72f3e561.tar.gz
rails-209bfc0a5c6416bcba8a90e87159234d72f3e561.tar.bz2
rails-209bfc0a5c6416bcba8a90e87159234d72f3e561.zip
Fix style guide violations
-rw-r--r--actionpack/test/abstract_unit.rb6
-rw-r--r--activerecord/test/cases/query_cache_test.rb6
-rw-r--r--activesupport/lib/active_support/core_ext/object/duplicable.rb2
-rw-r--r--activesupport/test/core_ext/object/duplicable_test.rb2
-rw-r--r--railties/test/application/rake_test.rb1
5 files changed, 8 insertions, 9 deletions
diff --git a/actionpack/test/abstract_unit.rb b/actionpack/test/abstract_unit.rb
index 11a9092527..bfd9068f23 100644
--- a/actionpack/test/abstract_unit.rb
+++ b/actionpack/test/abstract_unit.rb
@@ -259,9 +259,9 @@ module ActionDispatch
host = uri_or_host.host unless path
path ||= uri_or_host.path
- params = { "PATH_INFO" => path,
- "REQUEST_METHOD" => method,
- "HTTP_HOST" => host }
+ params = { "PATH_INFO" => path,
+ "REQUEST_METHOD" => method,
+ "HTTP_HOST" => host }
routes.call(params)
end
diff --git a/activerecord/test/cases/query_cache_test.rb b/activerecord/test/cases/query_cache_test.rb
index 4c47a487ac..324c2f4388 100644
--- a/activerecord/test/cases/query_cache_test.rb
+++ b/activerecord/test/cases/query_cache_test.rb
@@ -280,18 +280,18 @@ class QueryCacheTest < ActiveRecord::TestCase
# Warm up the cache by running the query
assert_queries(1) do
- assert_equal 0, Post.where(title: 'test').to_a.count
+ assert_equal 0, Post.where(title: "test").to_a.count
end
# Check that if the same query is run again, no queries are executed
assert_queries(0) do
- assert_equal 0, Post.where(title: 'test').to_a.count
+ assert_equal 0, Post.where(title: "test").to_a.count
end
ActiveRecord::Base.connection.uncached do
# Check that new query is executed, avoiding the cache
assert_queries(1) do
- assert_equal 0, Post.where(title: 'test').to_a.count
+ assert_equal 0, Post.where(title: "test").to_a.count
end
end
end
diff --git a/activesupport/lib/active_support/core_ext/object/duplicable.rb b/activesupport/lib/active_support/core_ext/object/duplicable.rb
index 9485e74816..ea81df2bd8 100644
--- a/activesupport/lib/active_support/core_ext/object/duplicable.rb
+++ b/activesupport/lib/active_support/core_ext/object/duplicable.rb
@@ -74,7 +74,7 @@ end
class Symbol
begin
:symbol.dup # Ruby 2.4.x.
- 'symbol_from_string'.to_sym.dup # Some symbols can't `dup` in Ruby 2.4.0.
+ "symbol_from_string".to_sym.dup # Some symbols can't `dup` in Ruby 2.4.0.
rescue TypeError
# Symbols are not duplicable:
diff --git a/activesupport/test/core_ext/object/duplicable_test.rb b/activesupport/test/core_ext/object/duplicable_test.rb
index fb140a5b76..466f62a4b4 100644
--- a/activesupport/test/core_ext/object/duplicable_test.rb
+++ b/activesupport/test/core_ext/object/duplicable_test.rb
@@ -5,7 +5,7 @@ require "active_support/core_ext/numeric/time"
class DuplicableTest < ActiveSupport::TestCase
if RUBY_VERSION >= "2.4.0"
- RAISE_DUP = [method(:puts), Complex(1), Rational(1), 'symbol_from_string'.to_sym]
+ RAISE_DUP = [method(:puts), Complex(1), Rational(1), "symbol_from_string".to_sym]
ALLOW_DUP = ["1", Object.new, /foo/, [], {}, Time.now, Class.new, Module.new, BigDecimal.new("4.56"), nil, false, true, 1, 2.3]
else
RAISE_DUP = [nil, false, true, :symbol, 1, 2.3, method(:puts), Complex(1), Rational(1)]
diff --git a/railties/test/application/rake_test.rb b/railties/test/application/rake_test.rb
index 70c7688789..1b64a0a1ca 100644
--- a/railties/test/application/rake_test.rb
+++ b/railties/test/application/rake_test.rb
@@ -214,7 +214,6 @@ module ApplicationTests
assert_equal expected_output, output
end
-
def test_rails_routes_displays_message_when_no_routes_are_defined
app_file "config/routes.rb", <<-RUBY
Rails.application.routes.draw do