From fcb00d388c8afe25cdc8bd0fa5c762840921a8c9 Mon Sep 17 00:00:00 2001 From: Ivan Antropov Date: Sat, 9 Nov 2013 10:16:19 +0700 Subject: Add :encode_with for proper YAML serialization --- test/nodes/test_sql_literal.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test/nodes/test_sql_literal.rb') diff --git a/test/nodes/test_sql_literal.rb b/test/nodes/test_sql_literal.rb index 9deb8e5d8d..085c5dad6b 100644 --- a/test/nodes/test_sql_literal.rb +++ b/test/nodes/test_sql_literal.rb @@ -1,4 +1,5 @@ require 'helper' +require 'yaml' module Arel module Nodes @@ -56,6 +57,13 @@ module Arel @visitor.accept(node).must_be_like %{ (foo = 1 AND foo = 2) } end end + + describe 'serialization' do + it 'serializes into YAML' do + yaml_literal = SqlLiteral.new('foo').to_yaml + assert_equal('foo', YAML.load(yaml_literal)) + end + end end end end -- cgit v1.2.3