Sha256: 21a1905c7749508724eb4d9b548e6f14a33d78e2b18d62b2f77106c6cfdb5928

Contents?: true

Size: 875 Bytes

Versions: 2

Compression:

Stored size: 875 Bytes

Contents

require 'spec_helper'

module ParenthesizedExpressionSpec
  describe "An unadorned expression inside of parentheses" do
    testing_expression '("foo")'
  
    it "should behave as normal" do
      parse('foo').should_not be_nil
    end
  end

  describe "A prefixed-expression inside of parentheses" do
    testing_expression '(!"foo")'
  
    it "should behave as normal" do
      parse('foo') do |result|
	result.should be_nil
	parser.terminal_failures.size.should == 1
      end
    end
  end

  describe "An expression with code both inside and outside parentheses" do
    testing_expression '("foo" { def inner; end } ) { def outer; end} '
    it "should extend both code modules " do
      parse('foo') do |result|
	skip "Arbitrarily nested modules are not yet compiled"
	result.should respond_to(:inner)
	result.should respond_to(:outer)
      end
    end
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
treetop-1.6.5 spec/compiler/parenthesized_expression_spec.rb
treetop-1.6.4 spec/compiler/parenthesized_expression_spec.rb