aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2011-04-21 15:28:21 -0500
committerAaron Patterson <aaron.patterson@gmail.com>2011-04-21 15:28:21 -0500
commitcae83ce964b9919b890bb7fa6f920a536e6b5425 (patch)
treec0d11479ee90c9ead48cef7a3db1e297ee333489 /test
parent885a3acb1ce183189b8628f14fa834b3e1ba39ec (diff)
downloadrails-cae83ce964b9919b890bb7fa6f920a536e6b5425.tar.gz
rails-cae83ce964b9919b890bb7fa6f920a536e6b5425.tar.bz2
rails-cae83ce964b9919b890bb7fa6f920a536e6b5425.zip
adding a DISTINCT node
Diffstat (limited to 'test')
-rw-r--r--test/nodes/test_select_core.rb37
1 files changed, 23 insertions, 14 deletions
diff --git a/test/nodes/test_select_core.rb b/test/nodes/test_select_core.rb
index 884d86e21f..47f85aee8a 100644
--- a/test/nodes/test_select_core.rb
+++ b/test/nodes/test_select_core.rb
@@ -1,22 +1,31 @@
require 'helper'
-describe Arel::Nodes::SelectCore do
- describe "#clone" do
- it "clones froms, projections and wheres" do
- core = Arel::Nodes::SelectCore.new
- core.froms = %w[a b c]
- core.projections = %w[d e f]
- core.wheres = %w[g h i]
+module Arel
+ module Nodes
+ class TestSelectCore < MiniTest::Unit::TestCase
+ def test_clone
+ core = Arel::Nodes::SelectCore.new
+ core.froms = %w[a b c]
+ core.projections = %w[d e f]
+ core.wheres = %w[g h i]
- dolly = core.clone
+ dolly = core.clone
- dolly.froms.must_equal core.froms
- dolly.projections.must_equal core.projections
- dolly.wheres.must_equal core.wheres
+ dolly.froms.must_equal core.froms
+ dolly.projections.must_equal core.projections
+ dolly.wheres.must_equal core.wheres
- dolly.froms.wont_be_same_as core.froms
- dolly.projections.wont_be_same_as core.projections
- dolly.wheres.wont_be_same_as core.wheres
+ dolly.froms.wont_be_same_as core.froms
+ dolly.projections.wont_be_same_as core.projections
+ dolly.wheres.wont_be_same_as core.wheres
+ end
+
+ def test_set_quantifier
+ core = Arel::Nodes::SelectCore.new
+ core.set_quantifier = Arel::Nodes::Distinct.new
+ viz = Arel::Visitors::ToSql.new Table.engine
+ assert_match 'DISTINCT', viz.accept(core)
+ end
end
end
end