1 # Copyright 2007-2014 Greg Hurrell. All rights reserved.
2 # Licensed under the terms of the BSD 2-clause license.
6 describe Walrat::NotPredicate do
7 it 'complains on trying to parse a nil string' do
9 Walrat::NotPredicate.new('irrelevant').parse nil
10 end.to raise_error(ArgumentError, /nil string/)
13 it 'can be compared for equality' do
14 Walrat::NotPredicate.new('foo').
15 should eql(Walrat::NotPredicate.new('foo')) # same
16 Walrat::NotPredicate.new('foo').
17 should_not eql(Walrat::NotPredicate.new('bar')) # different
18 Walrat::NotPredicate.new('foo').
19 should_not eql(Walrat::Predicate.new('foo')) # different class