Sha256: b5b28c868bd5d6479be94a69b73b9ce179b6262887feab388a16dce502bf7a82

Contents?: true

Size: 724 Bytes

Versions: 9

Compression:

Stored size: 724 Bytes

Contents

require 'helper'

module Arel
  class TestNode < MiniTest::Unit::TestCase
    def test_all_nodes_are_nodes
      Nodes.constants.map { |k|
        Nodes.const_get(k)
      }.grep(Class).each do |klass|
        next if Nodes::SqlLiteral == klass
        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

9 entries across 9 versions & 2 rubygems

Version Path
square-arel-2.0.9.20110222133018 test/nodes/test_node.rb
arel-2.0.9 test/nodes/test_node.rb
arel-2.0.9.rc1 test/nodes/test_node.rb
arel-2.0.8 test/nodes/test_node.rb
arel-2.0.8.beta.20110131120940 test/nodes/test_node.rb
arel-2.0.7 test/nodes/test_node.rb
arel-2.0.7.beta.20110110114925 test/nodes/test_node.rb
arel-2.0.6 test/nodes/test_node.rb
arel-2.0.5 test/nodes/test_node.rb