mirror of
https://github.com/lloeki/rebel.git
synced 2025-12-06 10:04:39 +01:00
Raw#is
This commit is contained in:
parent
3d18261e05
commit
892b21eaf8
2 changed files with 7 additions and 0 deletions
|
|
@ -98,6 +98,7 @@ module Rebel::SQL
|
|||
end
|
||||
end
|
||||
alias == eq
|
||||
alias is eq
|
||||
|
||||
def ne(n)
|
||||
case n
|
||||
|
|
|
|||
|
|
@ -15,6 +15,12 @@ class TestRaw < Minitest::Test
|
|||
assert_str_equal(Rebel::SQL.name(:foo).eq(1).or(Rebel::SQL.name(:bar).eq(2)), '"foo" = 1 OR "bar" = 2')
|
||||
end
|
||||
|
||||
def test_is
|
||||
assert_str_equal(Rebel::SQL.name(:foo).is(nil), '"foo" IS NULL')
|
||||
assert_str_equal(Rebel::SQL.name(:foo).is(42), '"foo" = 42')
|
||||
assert_str_equal(Rebel::SQL.name(:foo).is(Rebel::SQL.name(:bar)), '"foo" = "bar"')
|
||||
end
|
||||
|
||||
def test_eq
|
||||
assert_str_equal(Rebel::SQL.name(:foo).eq(nil), '"foo" IS NULL')
|
||||
assert_str_equal(Rebel::SQL.name(:foo) == nil, '"foo" IS NULL')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue