aboutsummaryrefslogtreecommitdiffstats
path: root/spec/sql
diff options
context:
space:
mode:
authorNick Kallen <nkallen@nick-kallens-computer-2.local>2007-12-30 11:35:44 -0800
committerNick Kallen <nkallen@nick-kallens-computer-2.local>2007-12-30 11:35:44 -0800
commit960bbcb3ce4a82cf4f031d1c6682ce4c1a04474d (patch)
tree24e8e29629450700940d3bdc233265648b5f73f2 /spec/sql
downloadrails-960bbcb3ce4a82cf4f031d1c6682ce4c1a04474d.tar.gz
rails-960bbcb3ce4a82cf4f031d1c6682ce4c1a04474d.tar.bz2
rails-960bbcb3ce4a82cf4f031d1c6682ce4c1a04474d.zip
initial import
Diffstat (limited to 'spec/sql')
-rw-r--r--spec/sql/select_spec.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/sql/select_spec.rb b/spec/sql/select_spec.rb
new file mode 100644
index 0000000000..7d40a20a5b
--- /dev/null
+++ b/spec/sql/select_spec.rb
@@ -0,0 +1,19 @@
+require File.join(File.dirname(__FILE__), '..', 'spec_helper')
+
+describe Select, '==' do
+ it "obtains for queries with identical attributes" do
+ Select.new(:foo).should == Select.new(:foo)
+ Select.new(:bar).should_not == Select.new(:foo)
+ end
+
+ it "obtains for queries with identical tables" do
+ Select.new(:foo).from(:bar).should == Select.new(:foo).from(:bar)
+ Select.new(:foo).from(:bar).should_not == Select.new(:foo).from(:foo)
+ end
+
+ it "obtains for queries with identical predicates" do
+ Select.new(:foo).from(:bar).where(:baz).should == Select.new(:foo).from(:bar).where(:baz)
+ Select.new(:foo).from(:bar).where(:baz).should_not == Select.new(:foo).from(:bar).where(:foo)
+ end
+
+end \ No newline at end of file