Sha256: 6c22cba7f5d0fe5a23836e10adc5ef61b0f7d5d7d954e60129c0ebd6fd3d7983

Contents?: true

Size: 1008 Bytes

Versions: 262

Compression:

Stored size: 1008 Bytes

Contents

require '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

262 entries across 217 versions & 32 rubygems

Version Path
classiccms-0.5.9 vendor/bundle/gems/treetop-1.4.10/spec/compiler/nonterminal_symbol_spec.rb
challah-0.7.0 vendor/bundle/gems/treetop-1.4.10/spec/compiler/nonterminal_symbol_spec.rb
challah-0.7.0.pre2 vendor/bundle/gems/treetop-1.4.10/spec/compiler/nonterminal_symbol_spec.rb
classiccms-0.5.8 vendor/bundle/gems/treetop-1.4.10/spec/compiler/nonterminal_symbol_spec.rb
classiccms-0.5.7 vendor/bundle/gems/treetop-1.4.10/spec/compiler/nonterminal_symbol_spec.rb
classiccms-0.5.6 vendor/bundle/gems/treetop-1.4.10/spec/compiler/nonterminal_symbol_spec.rb
classiccms-0.5.5 vendor/bundle/gems/treetop-1.4.10/spec/compiler/nonterminal_symbol_spec.rb
challah-0.7.0.pre vendor/bundle/gems/treetop-1.4.10/spec/compiler/nonterminal_symbol_spec.rb
classiccms-0.5.2 vendor/bundle/gems/treetop-1.4.10/spec/compiler/nonterminal_symbol_spec.rb
classiccms-0.5.1 vendor/bundle/gems/treetop-1.4.10/spec/compiler/nonterminal_symbol_spec.rb
classiccms-0.5.0 vendor/bundle/gems/treetop-1.4.10/spec/compiler/nonterminal_symbol_spec.rb
classiccms-0.4.2 vendor/bundle/gems/treetop-1.4.10/spec/compiler/nonterminal_symbol_spec.rb
classiccms-0.4.1 vendor/bundle/gems/treetop-1.4.10/spec/compiler/nonterminal_symbol_spec.rb
classiccms-0.4.0 vendor/bundle/gems/treetop-1.4.10/spec/compiler/nonterminal_symbol_spec.rb
classiccms-0.3.9 vendor/bundle/gems/treetop-1.4.10/spec/compiler/nonterminal_symbol_spec.rb
challah-0.6.2 vendor/bundle/gems/treetop-1.4.10/spec/compiler/nonterminal_symbol_spec.rb
sunrise-cms-0.3.3 vendor/bundle/ruby/1.9.1/gems/rails-uploader-0.0.1/vendor/bundle/ruby/1.9.1/gems/treetop-1.4.10/spec/compiler/nonterminal_symbol_spec.rb
sunrise-cms-0.3.3 vendor/bundle/ruby/1.9.1/gems/treetop-1.4.10/spec/compiler/nonterminal_symbol_spec.rb
initforthe-cookies-0.0.1 vendor/bundle/gems/treetop-1.4.10/spec/compiler/nonterminal_symbol_spec.rb
sunrise-cms-0.3.2 vendor/bundle/ruby/1.9.1/gems/rails-uploader-0.0.1/vendor/bundle/ruby/1.9.1/gems/treetop-1.4.10/spec/compiler/nonterminal_symbol_spec.rb