aboutsummaryrefslogblamecommitdiffstats
path: root/spec/algebra/unit/predicates/inequality_spec.rb
blob: f95b8d120ec80c5bb6e19b7f75a273fd13348588 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14













                                               





                                     











                                                     
require 'spec_helper'

module Arel
  module Predicates
    describe Inequality do
      before do
        relation1 = Arel::Table.new(:users)
        relation2 = Arel::Table.new(:photos)
        left      = relation1[:id]
        right     = relation2[:user_id]
        @a        = Inequality.new(left, right)
        @b        = Inequality.new(right, left)
      end

      describe 'operator' do
        it "should have one" do
          @a.operator.should == :"!="
        end
      end

      describe '==' do
        it "is equal to itself" do
          @a.should == @a
        end

        it "should not care abount children order" do
          @a.should == @b
        end
      end
    end
  end
end