mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
24 lines
576 B
Ruby
24 lines
576 B
Ruby
|
require 'helper'
|
||
|
|
||
|
module Arel
|
||
|
module Nodes
|
||
|
class TestBin < MiniTest::Unit::TestCase
|
||
|
def test_new
|
||
|
assert Arel::Nodes::Bin.new('zomg')
|
||
|
end
|
||
|
|
||
|
def test_default_to_sql
|
||
|
viz = Arel::Visitors::ToSql.new Table.engine
|
||
|
node = Arel::Nodes::Bin.new(Arel.sql('zomg'))
|
||
|
assert_equal 'zomg', viz.accept(node)
|
||
|
end
|
||
|
|
||
|
def test_mysql_to_sql
|
||
|
viz = Arel::Visitors::MySQL.new Table.engine
|
||
|
node = Arel::Nodes::Bin.new(Arel.sql('zomg'))
|
||
|
assert_equal 'BINARY zomg', viz.accept(node)
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
end
|