Sha256: 9da23be69d0d192328a6f3473efc1e1dcc5466bb4ca7726b08f6ea4ab9e6fa21

Contents?: true

Size: 1.02 KB

Versions: 120

Compression:

Stored size: 1.02 KB

Contents

require 'helper'

module Arel
  module FactoryMethods
    class TestFactoryMethods < MiniTest::Unit::TestCase
      class Factory
        include Arel::FactoryMethods
      end

      def setup
        @factory = Factory.new
      end

      def test_create_join
        join = @factory.create_join :one, :two
        assert_kind_of Nodes::Join, join
        assert_equal :two, join.right
      end

      def test_create_on
        on = @factory.create_on :one
        assert_instance_of Nodes::On, on
        assert_equal :one, on.expr
      end

      def test_create_true
        true_node = @factory.create_true
        assert_instance_of Nodes::True, true_node
      end

      def test_create_false
        false_node = @factory.create_false
        assert_instance_of Nodes::False, false_node
      end

      def test_lower
        lower = @factory.lower :one
        assert_instance_of Nodes::NamedFunction, lower
        assert_equal 'LOWER', lower.name
        assert_equal [:one], lower.expressions
      end
    end
  end
end

Version data entries

120 entries across 102 versions & 14 rubygems

Version Path
mdg-1.0.1 vendor/bundle/ruby/2.3.0/gems/arel-3.0.3/test/test_factory_methods.rb
active_mailer-0.0.10 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/arel-3.0.2/test/test_factory_methods.rb
judge-2.0.5 vendor/bundle/ruby/2.1.0/gems/arel-3.0.2/test/test_factory_methods.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/test_factory_methods.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/test_factory_methods.rb
apl-library-0.0.90 vendor/bundle/ruby/1.8/gems/arel-3.0.3/test/test_factory_methods.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/test_factory_methods.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/arel-3.0.3/test/test_factory_methods.rb
apl-library-0.0.90 vendor/bundle/ruby/1.9.1/gems/arel-3.0.3/test/test_factory_methods.rb
arel-4.0.2 test/test_factory_methods.rb
arel-5.0.0 test/test_factory_methods.rb
arel-3.0.3 test/test_factory_methods.rb
arel-4.0.1 test/test_factory_methods.rb
challah-1.0.0 vendor/bundle/gems/arel-4.0.0/test/test_factory_methods.rb
swipe-rails-0.0.5 vendor/bundle/gems/arel-3.0.2/test/test_factory_methods.rb
active_mailer-0.0.9 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/arel-3.0.2/test/test_factory_methods.rb
active_mailer-0.0.8 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/arel-3.0.2/test/test_factory_methods.rb
active_mailer-0.0.7 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/arel-3.0.2/test/test_factory_methods.rb
active_mailer-0.0.6 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/arel-3.0.2/test/test_factory_methods.rb
challah-1.0.0.beta3 vendor/bundle/gems/arel-3.0.2/test/test_factory_methods.rb