Sha256: bba688cb82db05ddc4883e28081da98a9b203b391c0c633afbec660c9f1bb5c5

Contents?: true

Size: 822 Bytes

Versions: 116

Compression:

Stored size: 822 Bytes

Contents

require 'helper'

module Arel
  module Nodes
    class TestInfixOperation < MiniTest::Unit::TestCase
      def test_construct
        operation = InfixOperation.new :+, 1, 2
        assert_equal :+, operation.operator
        assert_equal 1, operation.left
        assert_equal 2, operation.right
      end

      def test_operation_alias
        operation = InfixOperation.new :+, 1, 2
        aliaz = operation.as('zomg')
        assert_kind_of As, aliaz
        assert_equal operation, aliaz.left
        assert_equal 'zomg', aliaz.right
      end

      def test_opertaion_ordering
        operation = InfixOperation.new :+, 1, 2
        ordering = operation.desc
        assert_kind_of Descending, ordering
        assert_equal operation, ordering.expr
        assert ordering.descending?
      end
    end
  end
end

Version data entries

116 entries across 98 versions & 14 rubygems

Version Path
mdg-1.0.1 vendor/bundle/ruby/2.3.0/gems/arel-3.0.3/test/nodes/test_infix_operation.rb
active_mailer-0.0.10 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/arel-3.0.2/test/nodes/test_infix_operation.rb
judge-2.0.5 vendor/bundle/ruby/2.1.0/gems/arel-3.0.2/test/nodes/test_infix_operation.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/arel-3.0.3/test/nodes/test_infix_operation.rb
apl-library-0.0.90 vendor/bundle/ruby/1.9.1/gems/arel-3.0.3/test/nodes/test_infix_operation.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/1.8/gems/arel-3.0.3/test/nodes/test_infix_operation.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/1.9.1/gems/arel-3.0.3/test/nodes/test_infix_operation.rb
apl-library-0.0.90 vendor/bundle/ruby/1.8/gems/arel-3.0.3/test/nodes/test_infix_operation.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/2.1.0/gems/arel-3.0.3/test/nodes/test_infix_operation.rb
arel-3.0.3 test/nodes/test_infix_operation.rb
swipe-rails-0.0.5 vendor/bundle/gems/arel-3.0.2/test/nodes/test_infix_operation.rb
active_mailer-0.0.9 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/arel-3.0.2/test/nodes/test_infix_operation.rb
active_mailer-0.0.8 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/arel-3.0.2/test/nodes/test_infix_operation.rb
active_mailer-0.0.7 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/arel-3.0.2/test/nodes/test_infix_operation.rb
active_mailer-0.0.6 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/arel-3.0.2/test/nodes/test_infix_operation.rb
challah-1.0.0.beta3 vendor/bundle/gems/arel-3.0.2/test/nodes/test_infix_operation.rb
fc-webicons-0.0.4 vendor/bundle/ruby/1.9.1/gems/arel-3.0.2/test/nodes/test_infix_operation.rb
challah-1.0.0.beta2 vendor/bundle/gems/arel-3.0.2/test/nodes/test_infix_operation.rb
challah-1.0.0.beta vendor/bundle/gems/arel-3.0.2/test/nodes/test_infix_operation.rb
fc-webicons-0.0.3 vendor/bundle/ruby/1.9.1/gems/arel-3.0.2/test/nodes/test_infix_operation.rb