spec/ngram_set_spec.rb in raingrams-0.1.0 vs spec/ngram_set_spec.rb in raingrams-0.1.1
- old
+ new
@@ -44,11 +44,20 @@
Ngram[:the, :dog],
Ngram[:dog, :jumped]
]
end
- it "should select ngrams which includes specified grams" do
- @ngrams.includes(:the, :dog).should == NgramSet[
+ it "should select ngrams which include any of the specified grams" do
+ @ngrams.including_any(:the, :dog).should == NgramSet[
Ngram[:the, :dog],
+ Ngram[:dog, :jumped],
+ Ngram[:through, :the],
+ Ngram[:the, :hoop]
+ ]
+ end
+
+ it "should select ngrams which include all of the specified grams" do
+ @ngrams.including_all(:the, :dog).should == NgramSet[
+ Ngram[:the, :dog]
]
end
end