diff options
Diffstat (limited to 'test/nodes/test_or.rb')
-rw-r--r-- | test/nodes/test_or.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/nodes/test_or.rb b/test/nodes/test_or.rb new file mode 100644 index 0000000000..354d803110 --- /dev/null +++ b/test/nodes/test_or.rb @@ -0,0 +1,22 @@ +require 'spec_helper' + +module Arel + module Nodes + describe 'or' do + describe '#or' do + it 'makes an OR node' do + attr = Table.new(:users)[:id] + left = attr.eq(10) + right = attr.eq(11) + node = left.or right + check node.expr.left.must_equal left + check node.expr.right.must_equal right + + oror = node.or(right) + check oror.expr.left.must_equal node + check oror.expr.right.must_equal right + end + end + end + end +end |