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
logstash-filter-cache-redis-0.1.0 vendor/bundle/jruby/1.9/gems/treetop-1.4.15/spec/compiler/nonterminal_symbol_spec.rb
logstash-filter-csharp-0.1.0 vendor/bundle/jruby/2.3.0/gems/treetop-1.4.15/spec/compiler/nonterminal_symbol_spec.rb
logstash-filter-htmlentities-0.1.0 vendor/bundle/jruby/1.9/gems/treetop-1.4.15/spec/compiler/nonterminal_symbol_spec.rb
logstash-output-icinga-1.0.0 vendor/jruby/1.9/gems/treetop-1.4.15/spec/compiler/nonterminal_symbol_spec.rb
logstash-filter-zabbix-0.1.2 vendor/bundle/jruby/1.9/gems/treetop-1.4.15/spec/compiler/nonterminal_symbol_spec.rb
logstash-filter-zabbix-0.1.1 vendor/bundle/jruby/1.9/gems/treetop-1.4.15/spec/compiler/nonterminal_symbol_spec.rb
logstash-input-fifo-0.9.1 vendor/bundle/jruby/1.9/gems/treetop-1.4.15/spec/compiler/nonterminal_symbol_spec.rb
logstash-input-fifo-0.9.0 vendor/bundle/jruby/1.9/gems/treetop-1.4.15/spec/compiler/nonterminal_symbol_spec.rb
logstash-input-salesforce-3.0.0 vendor/jruby/1.9/gems/treetop-1.4.15/spec/compiler/nonterminal_symbol_spec.rb
ivanvc-logstash-input-s3-3.1.1.4 vendor/local/gems/treetop-1.4.15/spec/compiler/nonterminal_symbol_spec.rb
ivanvc-logstash-input-s3-3.1.1.3 vendor/local/gems/treetop-1.4.15/spec/compiler/nonterminal_symbol_spec.rb
ivanvc-logstash-input-s3-3.1.1.2 vendor/local/gems/treetop-1.4.15/spec/compiler/nonterminal_symbol_spec.rb
logstash-filter-delta-1.1.0 vendor/bundle/jruby/2.2.0/gems/treetop-1.4.15/spec/compiler/nonterminal_symbol_spec.rb
logstash-filter-delta-1.0.1 vendor/bundle/jruby/2.2.0/gems/treetop-1.4.15/spec/compiler/nonterminal_symbol_spec.rb
logstash-filter-base64-1.0.4 vendor/bundle/jruby/2.2.0/gems/treetop-1.4.15/spec/compiler/nonterminal_symbol_spec.rb
logstash-filter-base64-1.0.3 vendor/bundle/jruby/2.2.0/gems/treetop-1.4.15/spec/compiler/nonterminal_symbol_spec.rb
logstash-filter-delta-1.0.0 vendor/bundle/jruby/2.2.0/gems/treetop-1.4.15/spec/compiler/nonterminal_symbol_spec.rb
logstash-filter-base64-1.0.2 vendor/bundle/jruby/2.3.0/gems/treetop-1.4.15/spec/compiler/nonterminal_symbol_spec.rb
logstash-filter-base64-1.0.1 vendor/bundle/jruby/2.3.0/gems/treetop-1.4.15/spec/compiler/nonterminal_symbol_spec.rb
logstash-filter-base64-1.0.0 vendor/bundle/jruby/2.3.0/gems/treetop-1.4.15/spec/compiler/nonterminal_symbol_spec.rb