Sha256: 6fa3a9ac3bf0ec28916c549813f26a809b5900621af0bced7418646ffe01b221

Contents?: true

Size: 1.18 KB

Versions: 4

Compression:

Stored size: 1.18 KB

Contents

require File.expand_path('../test_helper.rb', File.dirname(__FILE__))

describe RipperRubyParser::Parser do
  describe "#parse" do
    describe "for calls to super" do
      specify { "super".must_be_parsed_as s(:zsuper) }
      specify { "super foo".must_be_parsed_as s(:super,
                                                s(:call, nil, :foo, s(:arglist))) }
      specify {
        "super foo, bar".must_be_parsed_as s(:super,
                                             s(:call, nil, :foo, s(:arglist)),
                                             s(:call, nil, :bar, s(:arglist))) }
      specify {
        "super foo, *bar".must_be_parsed_as s(:super,
                                              s(:call, nil, :foo, s(:arglist)),
                                              s(:splat,
                                                s(:call, nil, :bar, s(:arglist)))) }
      specify {
        "super foo, *bar, &baz".
          must_be_parsed_as s(:super,
                              s(:call, nil, :foo, s(:arglist)),
                              s(:splat, s(:call, nil, :bar, s(:arglist))),
                              s(:block_pass, s(:call, nil, :baz, s(:arglist)))) }
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ripper_ruby_parser-0.0.8 test/unit/parser_method_calls_test.rb
ripper_ruby_parser-0.0.7 test/unit/parser_method_calls_test.rb
ripper_ruby_parser-0.0.6 test/unit/parser_method_calls_test.rb
ripper_ruby_parser-0.0.5 test/unit/parser_method_calls_test.rb