Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

got rid of retarded check method. down with rspec

  • Loading branch information...
commit a2cee877ec890962d302f24caf99b6ae1de4801f 1 parent 31f61b8
@zenspider zenspider authored
View
12 test/attributes/test_attribute.rb
@@ -328,8 +328,8 @@ module Attributes
it 'should return an equality node' do
attribute = Attribute.new nil, nil, nil
equality = attribute.eq 1
- check equality.left.must_equal attribute
- check equality.right.must_equal 1
+ equality.left.must_equal attribute
+ equality.right.must_equal 1
equality.must_be_kind_of Nodes::Equality
end
@@ -487,8 +487,8 @@ module Attributes
it 'should return an in node' do
attribute = Attribute.new nil, nil, nil
node = Nodes::In.new attribute, [1,2,3]
- check node.left.must_equal attribute
- check node.right.must_equal [1, 2, 3]
+ node.left.must_equal attribute
+ node.right.must_equal [1, 2, 3]
end
it 'should generate IN in sql' do
@@ -540,8 +540,8 @@ module Attributes
it 'should return a NotIn node' do
attribute = Attribute.new nil, nil, nil
node = Nodes::NotIn.new attribute, [1,2,3]
- check node.left.must_equal attribute
- check node.right.must_equal [1, 2, 3]
+ node.left.must_equal attribute
+ node.right.must_equal [1, 2, 3]
end
it 'should generate NOT IN in sql' do
View
16 test/nodes/test_equality.rb
@@ -9,7 +9,7 @@ module Nodes
it 'returns :==' do
attr = Table.new(:users)[:id]
left = attr.eq(10)
- check left.operator.must_equal :==
+ left.operator.must_equal :==
end
end
@@ -17,7 +17,7 @@ module Nodes
it "should equal left" do
attr = Table.new(:users)[:id]
left = attr.eq(10)
- check left.left.must_equal left.operand1
+ left.left.must_equal left.operand1
end
end
@@ -25,7 +25,7 @@ module Nodes
it "should equal right" do
attr = Table.new(:users)[:id]
left = attr.eq(10)
- check left.right.must_equal left.operand2
+ left.right.must_equal left.operand2
end
end
@@ -43,7 +43,7 @@ def quote_table_name(*args) @quote_count += 1; super; end
attr = Table.new(:users)[:id]
test = attr.eq(10)
test.to_sql engine
- check engine.connection.quote_count.must_equal 2
+ engine.connection.quote_count.must_equal 2
end
end
end
@@ -54,8 +54,8 @@ def quote_table_name(*args) @quote_count += 1; super; end
left = attr.eq(10)
right = attr.eq(11)
node = left.or right
- check node.expr.left.must_equal left
- check node.expr.right.must_equal right
+ node.expr.left.must_equal left
+ node.expr.right.must_equal right
end
end
@@ -65,8 +65,8 @@ def quote_table_name(*args) @quote_count += 1; super; end
left = attr.eq(10)
right = attr.eq(11)
node = left.and right
- check node.left.must_equal left
- check node.right.must_equal right
+ node.left.must_equal left
+ node.right.must_equal right
end
end
end
View
8 test/nodes/test_or.rb
@@ -9,12 +9,12 @@ module Nodes
left = attr.eq(10)
right = attr.eq(11)
node = left.or right
- check node.expr.left.must_equal left
- check node.expr.right.must_equal right
+ node.expr.left.must_equal left
+ node.expr.right.must_equal right
oror = node.or(right)
- check oror.expr.left.must_equal node
- check oror.expr.right.must_equal right
+ oror.expr.left.must_equal node
+ oror.expr.right.must_equal right
end
end
end
View
2  test/test_activerecord_compat.rb
@@ -9,7 +9,7 @@ module Arel
manager.where table[:id].eq 1
manager.where table[:name].eq 'Aaron'
- check manager.wheres.map { |x|
+ manager.wheres.map { |x|
x.value
}.join(', ').must_equal "\"users\".\"id\" = 1, \"users\".\"name\" = 'Aaron'"
end
View
4 test/test_delete_manager.rb
@@ -19,7 +19,7 @@ module Arel
it 'chains' do
table = Table.new(:users)
dm = Arel::DeleteManager.new Table.engine
- check dm.from(table).must_equal dm
+ dm.from(table).must_equal dm
end
end
@@ -35,7 +35,7 @@ module Arel
it 'chains' do
table = Table.new(:users)
dm = Arel::DeleteManager.new Table.engine
- check dm.where(table[:id].eq(10)).must_equal dm
+ dm.where(table[:id].eq(10)).must_equal dm
end
end
end
View
5 test/test_helper.rb
@@ -10,9 +10,4 @@ class Object
def must_be_like other
self.gsub(/\s+/, ' ').strip.must_equal other.gsub(/\s+/, ' ').strip
end
-
- # TODO: remove
- def check truthiness
- raise "not truthy" unless truthiness
- end
end
View
20 test/test_select_manager.rb
@@ -135,7 +135,7 @@ def execute sql, name = nil, *args
table = Table.new :users
manager = Arel::SelectManager.new Table.engine
manager.take 10
- check manager.taken.must_equal 10
+ manager.taken.must_equal 10
end
end
@@ -168,7 +168,7 @@ def execute sql, name = nil, *args
manager = Arel::SelectManager.new Table.engine
order = table[:id]
manager.order table[:id]
- check manager.orders.must_equal [order]
+ manager.orders.must_equal [order]
end
end
@@ -199,7 +199,7 @@ def execute sql, name = nil, *args
it 'chains' do
table = Table.new :users
manager = Arel::SelectManager.new Table.engine
- check manager.order(table[:id]).must_equal manager
+ manager.order(table[:id]).must_equal manager
end
end
@@ -275,7 +275,7 @@ def execute sql, name = nil, *args
it 'noops on nil' do
manager = Arel::SelectManager.new Table.engine
- check manager.join(nil).must_equal manager
+ manager.join(nil).must_equal manager
end
end
@@ -288,7 +288,7 @@ def execute sql, name = nil, *args
manager.join_sql.must_be_like %{
INNER JOIN "users" "users_2" "users"."id" = "users_2"."id"
}
- check manager.joins(manager).must_equal manager.join_sql
+ manager.joins(manager).must_equal manager.join_sql
end
it 'returns outer join sql' do
@@ -299,7 +299,7 @@ def execute sql, name = nil, *args
manager.join_sql.must_be_like %{
LEFT OUTER JOIN "users" "users_2" "users"."id" = "users_2"."id"
}
- check manager.joins(manager).must_equal manager.join_sql
+ manager.joins(manager).must_equal manager.join_sql
end
it 'returns string join sql' do
@@ -308,7 +308,7 @@ def execute sql, name = nil, *args
manager = Arel::SelectManager.new Table.engine
manager.from Nodes::StringJoin.new(table, 'hello')
manager.join_sql.must_be_like %{ 'hello' }
- check manager.joins(manager).must_equal manager.join_sql
+ manager.joins(manager).must_equal manager.join_sql
end
it 'returns nil join sql' do
@@ -342,7 +342,7 @@ def execute sql, name = nil, *args
it 'chains' do
table = Table.new :users
manager = Arel::SelectManager.new Table.engine
- check manager.group(table[:id]).must_equal manager
+ manager.group(table[:id]).must_equal manager
end
it 'takes multiple args' do
@@ -550,7 +550,7 @@ def execute sql, name = nil, *args
mgr = left.join(right)
mgr.project Nodes::SqlLiteral.new('*')
- check mgr.on(predicate).must_equal mgr
+ mgr.on(predicate).must_equal mgr
mgr.to_sql.must_be_like %{
SELECT * FROM "users"
@@ -573,7 +573,7 @@ def execute sql, name = nil, *args
it "chains" do
table = Table.new :users
manager = Arel::SelectManager.new Table.engine
- check manager.from(table).project(table['id']).must_equal manager
+ manager.from(table).project(table['id']).must_equal manager
manager.to_sql.must_be_like 'SELECT "users"."id" FROM "users"'
end
end
View
24 test/test_table.rb
@@ -8,7 +8,7 @@ module Arel
describe 'primary_key' do
it 'should return an attribute' do
- check @relation.primary_key.name.must_equal :id
+ @relation.primary_key.name.must_equal :id
end
end
@@ -31,7 +31,7 @@ module Arel
describe 'backwards compat' do
describe 'joins' do
it 'returns nil' do
- check @relation.joins(nil).must_equal nil
+ @relation.joins(nil).must_equal nil
end
end
@@ -67,12 +67,12 @@ module Arel
describe 'alias' do
it 'should create a node that proxies to a table' do
- check @relation.aliases.must_equal []
+ @relation.aliases.must_equal []
node = @relation.alias
- check @relation.aliases.must_equal [node]
- check node.name.must_equal 'users_2'
- check node[:id].relation.must_equal node
+ @relation.aliases.must_equal [node]
+ node.name.must_equal 'users_2'
+ node[:id].relation.must_equal node
end
end
@@ -80,18 +80,18 @@ module Arel
it 'takes :columns' do
columns = Table.engine.connection.columns("users")
@relation = Table.new(:users, :columns => columns)
- check @relation.columns.first.name.must_equal :id
- check @relation.engine.must_equal Table.engine
+ @relation.columns.first.name.must_equal :id
+ @relation.engine.must_equal Table.engine
end
it 'should accept an engine' do
rel = Table.new :users, 'foo'
- check rel.engine.must_equal 'foo'
+ rel.engine.must_equal 'foo'
end
it 'should accept a hash' do
rel = Table.new :users, :engine => 'foo'
- check rel.engine.must_equal 'foo'
+ rel.engine.must_equal 'foo'
end
it 'ignores as if it equals name' do
@@ -143,7 +143,7 @@ module Arel
describe 'columns' do
it 'returns a list of columns' do
columns = @relation.columns
- check columns.length.must_equal 2
+ columns.length.must_equal 2
columns.map { |x| x.name.to_s }.sort.must_equal %w{ name id }.sort
end
end
@@ -160,7 +160,7 @@ module Arel
describe 'when given a Symbol' do
it "manufactures an attribute if the symbol names an attribute within the relation" do
column = @relation[:id]
- check column.name.must_equal :id
+ column.name.must_equal :id
column.must_be_kind_of Attributes::Integer
end
end
View
6 test/visitors/test_oracle.rb
@@ -28,7 +28,7 @@ module Visitors
sql = @visitor.accept(stmt)
sql2 = @visitor.accept(stmt)
- check sql.must_equal sql2
+ sql.must_equal sql2
end
it 'splits orders with commas' do
@@ -58,7 +58,7 @@ module Visitors
stmt.limit = 10
sql = @visitor.accept stmt
sql2 = @visitor.accept stmt
- check sql.must_equal sql2
+ sql.must_equal sql2
end
it 'creates a subquery when there is order_by' do
@@ -102,7 +102,7 @@ module Visitors
stmt.offset = Nodes::Offset.new(10)
sql = @visitor.accept stmt
sql2 = @visitor.accept stmt
- check sql.must_equal sql2
+ sql.must_equal sql2
end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.