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-output-scalyr-0.1.9 vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/spec/compiler/nonterminal_symbol_spec.rb
logstash-output-scalyr-0.1.8 vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/spec/compiler/nonterminal_symbol_spec.rb
logstash-output-scalyr-0.1.7 vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/spec/compiler/nonterminal_symbol_spec.rb
logstash-output-scalyr-0.1.6 vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/spec/compiler/nonterminal_symbol_spec.rb
logstash-output-newrelic-1.2.0 vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/spec/compiler/nonterminal_symbol_spec.rb
logstash-filter-csharp-0.2.1 vendor/bundle/jruby/2.3.0/gems/treetop-1.4.15/spec/compiler/nonterminal_symbol_spec.rb
logstash-filter-csharp-0.2.1 vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/spec/compiler/nonterminal_symbol_spec.rb
logstash-filter-csharp-0.2.0 vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/spec/compiler/nonterminal_symbol_spec.rb
logstash-filter-csharp-0.2.0 vendor/bundle/jruby/2.3.0/gems/treetop-1.4.15/spec/compiler/nonterminal_symbol_spec.rb
logstash-output-scalyr-0.1.5 vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/spec/compiler/nonterminal_symbol_spec.rb
logstash-output-scalyr-0.1.4 vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/spec/compiler/nonterminal_symbol_spec.rb
logstash-output-scalyr-0.1.3 vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/spec/compiler/nonterminal_symbol_spec.rb
logstash-output-scalyr-0.1.2 vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/spec/compiler/nonterminal_symbol_spec.rb
logstash-filter-device_detection-1.0.7-java vendor/bundle/jruby/1.9/gems/treetop-1.4.15/spec/compiler/nonterminal_symbol_spec.rb
mrcooper-logstash-output-azuresearch-0.2.2 vendor/jruby/2.5.0/gems/treetop-1.4.15/spec/compiler/nonterminal_symbol_spec.rb
logstash-output-icinga-1.1.0 vendor/jruby/1.9/gems/treetop-1.4.15/spec/compiler/nonterminal_symbol_spec.rb
logstash-output-icinga-1.1.0 vendor/jruby/2.3.0/gems/treetop-1.4.15/spec/compiler/nonterminal_symbol_spec.rb
logstash-filter-cache-redis-0.3.1 vendor/bundle/jruby/1.9/gems/treetop-1.4.15/spec/compiler/nonterminal_symbol_spec.rb
logstash-filter-cache-redis-0.3.0 vendor/bundle/jruby/1.9/gems/treetop-1.4.15/spec/compiler/nonterminal_symbol_spec.rb
logstash-filter-cache-redis-0.2.0 vendor/bundle/jruby/1.9/gems/treetop-1.4.15/spec/compiler/nonterminal_symbol_spec.rb