Sha256: 3ff0ba7e5845e04ea571c43e092b51210ca5383f5a4616fb70679896e12d4cb4
Contents?: true
Size: 479 Bytes
Versions: 5
Compression:
Stored size: 479 Bytes
Contents
require 'spec_helper' module Sexpr::Matcher describe Reference, "match?" do let(:grammar){ {:hello => Terminal.new(/^[a-z]+$/)} } let(:rule) { Reference.new :hello, grammar } it 'returns true on match' do rule.should be_match("hello") (rule === "hello").should be_true end it 'returns false on no match' do rule.should_not be_match("12") rule.should_not be_match(nil) rule.should_not be_match([]) end end end
Version data entries
5 entries across 5 versions & 1 rubygems