predicate 1.3.1 → 1.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/predicate/nodes/in.rb +1 -1
- data/lib/predicate/version.rb +1 -1
- data/spec/predicate/test_evaluate.rb +18 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0fa56aaf631881d7fa0b83d7d0353e5e1fd10518
|
4
|
+
data.tar.gz: 19cd5e6f8b3e863db2e553ebe57aa41a5431bc7e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4bf57668af7cacea1d5ff462164bc44437cff7d15f54935550e77aacf24709faf31f94d5c504aea178ab219b8dd50ffa649716d8ee240fd87f024f41ea56159a
|
7
|
+
data.tar.gz: 6dfd2865bad700185ef9360de2ca8718352b77d32ef9c4995f8d486273aaeb815984144ce005fc9b8e6c4890d61018f00d0119af8f3da1619f8f85e4e3b5bc7a
|
data/lib/predicate/nodes/in.rb
CHANGED
data/lib/predicate/version.rb
CHANGED
@@ -62,6 +62,24 @@ class Predicate
|
|
62
62
|
end
|
63
63
|
end
|
64
64
|
|
65
|
+
context 'on an in predicate' do
|
66
|
+
let(:predicate){
|
67
|
+
Predicate.in(:x, [8,9])
|
68
|
+
}
|
69
|
+
|
70
|
+
describe "on x == 2" do
|
71
|
+
let(:scope){ { :x => [2] } }
|
72
|
+
|
73
|
+
it{ expect(predicate.evaluate(scope)).to be_falsy }
|
74
|
+
end
|
75
|
+
|
76
|
+
describe "on x == 8" do
|
77
|
+
let(:scope){ { :x => 8 } }
|
78
|
+
|
79
|
+
it{ expect(predicate.evaluate(scope)).to be_truthy }
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
65
83
|
context 'on an intersect predicate' do
|
66
84
|
let(:predicate){
|
67
85
|
Predicate.intersect(:x, [8,9])
|