aboutsummaryrefslogtreecommitdiffstats
path: root/spec/arel/engines/sql/unit/engine_spec.rb
blob: 67a5d6232076123b7874aa3556ce9b14d01f86a6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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