aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/arel/nodes/equality_test.rb
diff options
context:
space:
mode:
authorMatthew Draper <matthew@trebex.net>2018-02-24 17:15:50 +1030
committerMatthew Draper <matthew@trebex.net>2018-02-24 17:16:13 +1030
commit4c0a3d48804a363c7e9272519665a21f601b5248 (patch)
tree6b1f6e28f85cfd69a0ce534856ef939c7079d5cf /activerecord/test/cases/arel/nodes/equality_test.rb
parent17ca17072dcdff11b3702a6b45f2fb0c8f8fe9a4 (diff)
downloadrails-4c0a3d48804a363c7e9272519665a21f601b5248.tar.gz
rails-4c0a3d48804a363c7e9272519665a21f601b5248.tar.bz2
rails-4c0a3d48804a363c7e9272519665a21f601b5248.zip
Arel: rubocop -a
Diffstat (limited to 'activerecord/test/cases/arel/nodes/equality_test.rb')
-rw-r--r--activerecord/test/cases/arel/nodes/equality_test.rb41
1 files changed, 21 insertions, 20 deletions
diff --git a/activerecord/test/cases/arel/nodes/equality_test.rb b/activerecord/test/cases/arel/nodes/equality_test.rb
index 28a74de321..e173720e86 100644
--- a/activerecord/test/cases/arel/nodes/equality_test.rb
+++ b/activerecord/test/cases/arel/nodes/equality_test.rb
@@ -1,37 +1,38 @@
# frozen_string_literal: true
-require_relative '../helper'
+
+require_relative "../helper"
module Arel
module Nodes
- describe 'equality' do
+ describe "equality" do
# FIXME: backwards compat
- describe 'backwards compat' do
- describe 'operator' do
- it 'returns :==' do
+ describe "backwards compat" do
+ describe "operator" do
+ it "returns :==" do
attr = Table.new(:users)[:id]
- left = attr.eq(10)
+ left = attr.eq(10)
left.operator.must_equal :==
end
end
- describe 'operand1' do
+ describe "operand1" do
it "should equal left" do
attr = Table.new(:users)[:id]
- left = attr.eq(10)
+ left = attr.eq(10)
left.left.must_equal left.operand1
end
end
- describe 'operand2' do
+ describe "operand2" do
it "should equal right" do
attr = Table.new(:users)[:id]
- left = attr.eq(10)
+ left = attr.eq(10)
left.right.must_equal left.operand2
end
end
- describe 'to_sql' do
- it 'takes an engine' do
+ describe "to_sql" do
+ it "takes an engine" do
engine = FakeRecord::Base.new
engine.connection.extend Module.new {
attr_accessor :quote_count
@@ -49,8 +50,8 @@ module Arel
end
end
- describe 'or' do
- it 'makes an OR node' do
+ describe "or" do
+ it "makes an OR node" do
attr = Table.new(:users)[:id]
left = attr.eq(10)
right = attr.eq(11)
@@ -60,8 +61,8 @@ module Arel
end
end
- describe 'and' do
- it 'makes and AND node' do
+ describe "and" do
+ it "makes and AND node" do
attr = Table.new(:users)[:id]
left = attr.eq(10)
right = attr.eq(11)
@@ -71,13 +72,13 @@ module Arel
end
end
- it 'is equal with equal ivars' do
- array = [Equality.new('foo', 'bar'), Equality.new('foo', 'bar')]
+ it "is equal with equal ivars" do
+ array = [Equality.new("foo", "bar"), Equality.new("foo", "bar")]
assert_equal 1, array.uniq.size
end
- it 'is not equal with different ivars' do
- array = [Equality.new('foo', 'bar'), Equality.new('foo', 'baz')]
+ it "is not equal with different ivars" do
+ array = [Equality.new("foo", "bar"), Equality.new("foo", "baz")]
assert_equal 2, array.uniq.size
end
end