diff options
author | Colin Jones <trptcolin@gmail.com> | 2013-08-14 17:02:17 -0500 |
---|---|---|
committer | Colin Jones <trptcolin@gmail.com> | 2013-08-14 17:02:17 -0500 |
commit | d93a05eec1adc5ca9d752a1e0b33313fc092c3e7 (patch) | |
tree | 7d03b1524adef2f462f579af15381d1423e3a416 /test/visitors | |
parent | 4524c7f8a8225677893e0731f40993de17d4babc (diff) | |
download | rails-d93a05eec1adc5ca9d752a1e0b33313fc092c3e7.tar.gz rails-d93a05eec1adc5ca9d752a1e0b33313fc092c3e7.tar.bz2 rails-d93a05eec1adc5ca9d752a1e0b33313fc092c3e7.zip |
Cache visitor dispatch on a per-visitor basis
Diffstat (limited to 'test/visitors')
-rw-r--r-- | test/visitors/test_dispatch_contamination.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/visitors/test_dispatch_contamination.rb b/test/visitors/test_dispatch_contamination.rb new file mode 100644 index 0000000000..d3c9e8af2e --- /dev/null +++ b/test/visitors/test_dispatch_contamination.rb @@ -0,0 +1,22 @@ +require 'helper' + +module Arel + module Visitors + describe 'avoiding contamination between visitor dispatch tables' do + before do + @connection = Table.engine.connection + @table = Table.new(:users) + end + + it 'dispatches properly after failing upwards' do + node = Nodes::Union.new(Nodes::True.new, Nodes::False.new) + assert_equal "( TRUE UNION FALSE )", node.to_sql + + node.first # from Nodes::Node's Enumerable mixin + + assert_equal "( TRUE UNION FALSE )", node.to_sql + end + end + end +end + |