aboutsummaryrefslogtreecommitdiffstats
path: root/test/nodes/test_named_function.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/nodes/test_named_function.rb')
-rw-r--r--test/nodes/test_named_function.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/nodes/test_named_function.rb b/test/nodes/test_named_function.rb
index 18ecdd2851..3e0b2c3972 100644
--- a/test/nodes/test_named_function.rb
+++ b/test/nodes/test_named_function.rb
@@ -8,6 +8,23 @@ module Arel
assert_equal 'omg', function.name
assert_equal 'zomg', function.expressions
end
+
+ def test_function_alias
+ function = NamedFunction.new 'omg', 'zomg'
+ function = function.as('wth')
+ assert_equal 'omg', function.name
+ assert_equal 'zomg', function.expressions
+ assert_kind_of SqlLiteral, function.alias
+ assert_equal 'wth', function.alias
+ end
+
+ def test_construct_with_alias
+ function = NamedFunction.new 'omg', 'zomg', 'wth'
+ assert_equal 'omg', function.name
+ assert_equal 'zomg', function.expressions
+ assert_kind_of SqlLiteral, function.alias
+ assert_equal 'wth', function.alias
+ end
end
end
end