Sha256: 69998638867c1120f530ccf4777e538c20942073ff408a70a8cc9a06b34befe3
Contents?: true
Size: 1.03 KB
Versions: 76
Compression:
Stored size: 1.03 KB
Contents
require File.expand_path("#{File.dirname(__FILE__)}/../spec_helper") module NonterminalSymbolSpec describe "A nonterminal symbol followed by a block" do testing_expression 'foo { def a_method; end }' parser_class_under_test.class_eval do def _nt_foo '_nt_foo called' end end it "compiles to a method call, extending its results with the anonymous module for the block" do result = parse('') result.should == '_nt_foo called' result.should respond_to(:a_method) end end module TestModule def a_method end end describe "a non-terminal followed by a module declaration" do testing_expression 'foo <NonterminalSymbolSpec::TestModule>' parser_class_under_test.class_eval do def _nt_foo '_nt_foo called' end end it "compiles to a method call, extending its results with the anonymous module for the block" do result = parse('') result.should == '_nt_foo called' result.should respond_to(:a_method) end end end
Version data entries
76 entries across 76 versions & 7 rubygems