aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/adapters/sqlite3
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2016-08-16 04:30:11 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2016-08-16 04:30:11 -0300
commit55f9b8129a50206513264824abb44088230793c2 (patch)
treeff2f01cabfc7e74b0bd831c2272a5517e4e81e99 /activerecord/test/cases/adapters/sqlite3
parentd0bdd74d7f6fae3d69b3681d5bc2d5ef6f55a0f8 (diff)
downloadrails-55f9b8129a50206513264824abb44088230793c2.tar.gz
rails-55f9b8129a50206513264824abb44088230793c2.tar.bz2
rails-55f9b8129a50206513264824abb44088230793c2.zip
Add three new rubocop rules
Style/SpaceBeforeBlockBraces Style/SpaceInsideBlockBraces Style/SpaceInsideHashLiteralBraces Fix all violations in the repository.
Diffstat (limited to 'activerecord/test/cases/adapters/sqlite3')
-rw-r--r--activerecord/test/cases/adapters/sqlite3/copy_table_test.rb14
-rw-r--r--activerecord/test/cases/adapters/sqlite3/sqlite3_adapter_test.rb2
2 files changed, 8 insertions, 8 deletions
diff --git a/activerecord/test/cases/adapters/sqlite3/copy_table_test.rb b/activerecord/test/cases/adapters/sqlite3/copy_table_test.rb
index 70e2f0fec1..8342b05870 100644
--- a/activerecord/test/cases/adapters/sqlite3/copy_table_test.rb
+++ b/activerecord/test/cases/adapters/sqlite3/copy_table_test.rb
@@ -11,7 +11,7 @@ class CopyTableTest < ActiveRecord::SQLite3TestCase
end
def test_copy_table(from = "customers", to = "customers2", options = {})
- assert_nothing_raised {copy_table(from, to, options)}
+ assert_nothing_raised { copy_table(from, to, options) }
assert_equal row_count(from), row_count(to)
if block_given?
@@ -25,7 +25,7 @@ class CopyTableTest < ActiveRecord::SQLite3TestCase
def test_copy_table_renaming_column
test_copy_table("customers", "customers2",
- rename: {"name" => "person_name"}) do |from, to, options|
+ rename: { "name" => "person_name" }) do |from, to, options|
expected = column_values(from, "name")
assert_equal expected, column_values(to, "person_name")
assert expected.any?, "No values in table: #{expected.inspect}"
@@ -55,8 +55,8 @@ class CopyTableTest < ActiveRecord::SQLite3TestCase
def test_copy_table_with_id_col_that_is_not_primary_key
test_copy_table("goofy_string_id", "goofy_string_id2") do
- original_id = @connection.columns("goofy_string_id").detect{|col| col.name == "id" }
- copied_id = @connection.columns("goofy_string_id2").detect{|col| col.name == "id" }
+ original_id = @connection.columns("goofy_string_id").detect { |col| col.name == "id" }
+ copied_id = @connection.columns("goofy_string_id2").detect { |col| col.name == "id" }
assert_equal original_id.type, copied_id.type
assert_equal original_id.sql_type, copied_id.sql_type
assert_equal original_id.limit, copied_id.limit
@@ -77,15 +77,15 @@ class CopyTableTest < ActiveRecord::SQLite3TestCase
protected
def copy_table(from, to, options = {})
- @connection.copy_table(from, to, {temporary: true}.merge(options))
+ @connection.copy_table(from, to, { temporary: true }.merge(options))
end
def column_names(table)
- @connection.table_structure(table).map {|column| column["name"]}
+ @connection.table_structure(table).map { |column| column["name"] }
end
def column_values(table, column)
- @connection.select_all("SELECT #{column} FROM #{table} ORDER BY id").map {|row| row[column]}
+ @connection.select_all("SELECT #{column} FROM #{table} ORDER BY id").map { |row| row[column] }
end
def table_indexes_without_name(table)
diff --git a/activerecord/test/cases/adapters/sqlite3/sqlite3_adapter_test.rb b/activerecord/test/cases/adapters/sqlite3/sqlite3_adapter_test.rb
index 4800d3d7d5..d2f0710cb2 100644
--- a/activerecord/test/cases/adapters/sqlite3/sqlite3_adapter_test.rb
+++ b/activerecord/test/cases/adapters/sqlite3/sqlite3_adapter_test.rb
@@ -405,7 +405,7 @@ module ActiveRecord
configurations["arunit"]["database"])
statement = ::SQLite3::Statement.new(db,
"CREATE TABLE statement_test (number integer not null)")
- statement.stub(:step, ->{ raise ::SQLite3::BusyException.new("busy") }) do
+ statement.stub(:step, -> { raise ::SQLite3::BusyException.new("busy") }) do
assert_called(statement, :columns, returns: []) do
assert_called(statement, :close) do
::SQLite3::Statement.stub(:new, statement) do