aboutsummaryrefslogtreecommitdiffstats
path: root/spec/arel
diff options
context:
space:
mode:
authorBryan Helmkamp <bryan@brynary.com>2009-05-17 18:36:08 -0400
committerBryan Helmkamp <bryan@brynary.com>2009-05-17 18:36:08 -0400
commit9560650fa79212b33d6ab349ff83b4f617d395b7 (patch)
treee377c45b81cf59af1f2815adbd8c283bd3cf86cc /spec/arel
parenta842aa572af1e8fac48f8a73a2e2985fbe39e046 (diff)
downloadrails-9560650fa79212b33d6ab349ff83b4f617d395b7.tar.gz
rails-9560650fa79212b33d6ab349ff83b4f617d395b7.tar.bz2
rails-9560650fa79212b33d6ab349ff83b4f617d395b7.zip
Adding skeleton of spec for CRUD operations in Sql::Engine
Diffstat (limited to 'spec/arel')
-rw-r--r--spec/arel/engines/sql/unit/engine_spec.rb36
1 files changed, 36 insertions, 0 deletions
diff --git a/spec/arel/engines/sql/unit/engine_spec.rb b/spec/arel/engines/sql/unit/engine_spec.rb
new file mode 100644
index 0000000000..67a5d62320
--- /dev/null
+++ b/spec/arel/engines/sql/unit/engine_spec.rb
@@ -0,0 +1,36 @@
+require File.join(File.dirname(__FILE__), '..', '..', '..', '..', 'spec_helper')
+
+module Arel
+ describe Sql::Engine do
+ before do
+ @relation = Table.new(:users)
+ end
+
+ describe "CRUD" do
+ describe "#create" do
+ it "inserts into the relation" do
+ @relation.insert @relation[:name] => "Bryan"
+ end
+ end
+
+ describe "#read" do
+ it "reads from the relation" do
+ @relation.each do |row|
+ end
+ end
+ end
+
+ describe "#update" do
+ it "updates the relation" do
+ @relation.update @relation[:name] => "Bryan"
+ end
+ end
+
+ describe "#delete" do
+ it "deletes from the relation" do
+ @relation.delete
+ end
+ end
+ end
+ end
+end