From f694d9e7c332cf4d9bce6742b440bf97308cefb5 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Mon, 13 Dec 2010 22:16:29 -0800 Subject: adding tests for factory methods --- test/test_factory_methods.rb | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 test/test_factory_methods.rb (limited to 'test') diff --git a/test/test_factory_methods.rb b/test/test_factory_methods.rb new file mode 100644 index 0000000000..89b10236d1 --- /dev/null +++ b/test/test_factory_methods.rb @@ -0,0 +1,27 @@ +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, :three + assert_kind_of Nodes::Join, join + assert_equal :three, join.constraint + end + + def test_create_on + on = @factory.create_on :one + assert_instance_of Nodes::On, on + assert_equal :one, on.expr + end + end + end +end -- cgit v1.2.3