Sha256: 34e45944a683f1595c7e29e82ac3a78044eac3390733bc02c220a420eef32207

Contents?: true

Size: 912 Bytes

Versions: 73

Compression:

Stored size: 912 Bytes

Contents

require 'helper'

module Arel
  class TestNode < MiniTest::Unit::TestCase
    def test_includes_factory_methods
      assert Node.new.respond_to?(:create_join)
    end

    def test_all_nodes_are_nodes
      Nodes.constants.map { |k|
        Nodes.const_get(k)
      }.grep(Class).each do |klass|
        next if Nodes::SqlLiteral == klass
        next if Nodes::BindParam == klass
        next if klass.name =~ /^Arel::Nodes::Test/
        assert klass.ancestors.include?(Nodes::Node), klass.name
      end
    end

    def test_each
      list = []
      node = Nodes::Node.new
      node.each { |n| list << n }
      assert_equal [node], list
    end

    def test_generator
      list = []
      node = Nodes::Node.new
      node.each.each { |n| list << n }
      assert_equal [node], list
    end

    def test_enumerable
      node = Nodes::Node.new
      assert_kind_of Enumerable, node
    end
  end
end

Version data entries

73 entries across 60 versions & 13 rubygems

Version Path
mdg-1.0.1 vendor/bundle/ruby/2.3.0/gems/arel-3.0.3/test/nodes/test_node.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_node.rb
judge-2.0.5 vendor/bundle/ruby/2.1.0/gems/arel-3.0.2/test/nodes/test_node.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/arel-3.0.3/test/nodes/test_node.rb
apl-library-0.0.90 vendor/bundle/ruby/1.9.1/gems/arel-3.0.3/test/nodes/test_node.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_node.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_node.rb
apl-library-0.0.90 vendor/bundle/ruby/1.8/gems/arel-3.0.3/test/nodes/test_node.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_node.rb
arel-4.0.2 test/nodes/test_node.rb
arel-5.0.0 test/nodes/test_node.rb
arel-3.0.3 test/nodes/test_node.rb
arel-4.0.1 test/nodes/test_node.rb
challah-1.0.0 vendor/bundle/gems/arel-4.0.0/test/nodes/test_node.rb
swipe-rails-0.0.5 vendor/bundle/gems/arel-3.0.2/test/nodes/test_node.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_node.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_node.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_node.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_node.rb
challah-1.0.0.beta3 vendor/bundle/gems/arel-3.0.2/test/nodes/test_node.rb