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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6bc7af57627674ee68eeb2188c15cb7fac4ca303
4
- data.tar.gz: 8d67321358cb55f75e0ec9e3b6fe384c50d92043
3
+ metadata.gz: 0fa56aaf631881d7fa0b83d7d0353e5e1fd10518
4
+ data.tar.gz: 19cd5e6f8b3e863db2e553ebe57aa41a5431bc7e
5
5
  SHA512:
6
- metadata.gz: 2db5604d2d50abb5625ac3cb061a88426f6554ffaf5240cda6d10aba5c53cb471c39f47baaf963481251f12a6965fab4681e94b4ad950f08659449ccf40ba5d9
7
- data.tar.gz: b8df86b7744a96eab44c125fec5bda9e453f69c6c9710440b04bcdebfdbfbe761999ed5787dabed5d8941d1d76c7373cef006a0c7419474983a9e9594c218e91
6
+ metadata.gz: 4bf57668af7cacea1d5ff462164bc44437cff7d15f54935550e77aacf24709faf31f94d5c504aea178ab219b8dd50ffa649716d8ee240fd87f024f41ea56159a
7
+ data.tar.gz: 6dfd2865bad700185ef9360de2ca8718352b77d32ef9c4995f8d486273aaeb815984144ce005fc9b8e6c4890d61018f00d0119af8f3da1619f8f85e4e3b5bc7a
@@ -52,7 +52,7 @@ class Predicate
52
52
  end
53
53
 
54
54
  def evaluate(tuple)
55
- values.include?(left.evaluate(tuple))
55
+ values.include?(identifier.evaluate(tuple))
56
56
  end
57
57
 
58
58
  end
@@ -2,7 +2,7 @@ class Predicate
2
2
  module Version
3
3
  MAJOR = 1
4
4
  MINOR = 3
5
- TINY = 1
5
+ TINY = 2
6
6
  end
7
7
  VERSION = "#{Version::MAJOR}.#{Version::MINOR}.#{Version::TINY}"
8
8
  end
@@ -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])
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: predicate
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1
4
+ version: 1.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bernard Lambeau