Commit 890f960

mokha <mokha@cisco.com>
2019-06-15 17:11:50
ensure space after not operator
1 parent 55ab239
Changed files (2)
lib
scim
spec
scim
lib/scim/kit/v2/filter.rb
@@ -85,7 +85,7 @@ module Scim
         rule(:presence) { str('pr') }
         rule(:and_op) { str('and') }
         rule(:or_op) { str('or') }
-        rule(:not_op?) { str('not').repeat(0, 1).as(:not) }
+        rule(:not_op?) { str('not').repeat(0, 1).as(:not) >> space }
         rule(:falsey) { str('false') }
         rule(:truthy) { str('true') }
         rule(:null) { str('null') }
spec/scim/kit/v2/filter_spec.rb
@@ -153,6 +153,12 @@ RSpec.describe Scim::Kit::V2::Filter do
     specify { expect(subject.parse_with_debug(x)).to be_truthy }
   end
 
+  specify { 
+    result = subject.parse_with_debug('userName pr and not (userName eq "hello@example.com")')
+    puts result.inspect
+    expect(result).to be_truthy
+  }
+
   [
     '"Tsuyoshi"',
     '"hello@example.org"',