Sha256: 93c370d5a74a952d277a2f26182c10234953808aca55e6c73799c52ff277323a
Contents?: true
Size: 638 Bytes
Versions: 4
Compression:
Stored size: 638 Bytes
Contents
require 'spec_helper' module Sexpr module Grammar describe Matching, "compile_rule" do include Matching it 'keep alternatives unchanged' do compile_rule(:hello, Matcher::Alternative.new([]) ).should be_a(Matcher::Alternative) end it 'keep terminals unchanged' do compile_rule(:hello, Matcher::Terminal.new(true) ).should be_a(Matcher::Terminal) end it 'keep creates a Rule englobing sequences' do compiled = compile_rule(:hello, Matcher::Sequence.new([]) ) compiled.should be_a(Matcher::Rule) compiled.name.should eq(:hello) end end end end
Version data entries
4 entries across 4 versions & 1 rubygems