diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-11-23 16:24:41 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-11-23 16:24:41 -0800 |
commit | 76932b99d60b28f93c88c9a95873ba8524c9e370 (patch) | |
tree | 92bf234127eca9f013e6ff22903c7ff363387e5f /test/nodes | |
parent | 3e928ee400d083e7391474c61c8fcef74f0c848a (diff) | |
download | rails-76932b99d60b28f93c88c9a95873ba8524c9e370.tar.gz rails-76932b99d60b28f93c88c9a95873ba8524c9e370.tar.bz2 rails-76932b99d60b28f93c88c9a95873ba8524c9e370.zip |
adding a "not" factory method for creating Not nodes
Diffstat (limited to 'test/nodes')
-rw-r--r-- | test/nodes/test_not.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/nodes/test_not.rb b/test/nodes/test_not.rb new file mode 100644 index 0000000000..7dffdea0c8 --- /dev/null +++ b/test/nodes/test_not.rb @@ -0,0 +1,20 @@ +require 'helper' + +module Arel + module Nodes + describe 'not' do + describe '#not' do + it 'makes a NOT node' do + attr = Table.new(:users)[:id] + left = attr.eq(10) + right = attr.eq(11) + node = left.or right + node.expr.left.must_equal left + node.expr.right.must_equal right + + knot = node.or(right).not + end + end + end + end +end |