Sha256: 64c3d54f322a73f7778fca8337bb1cd6825dacbb5240076345ccf124ba4b53e7

Contents?: true

Size: 1.06 KB

Versions: 3

Compression:

Stored size: 1.06 KB

Contents

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

describe RipperRubyParser::Parser do
  describe "#parse" do
    describe "for negated operators" do
      specify do
        "foo !~ bar".must_be_parsed_as s(:not,
                                         s(:call,
                                           s(:call, nil, :foo, s(:arglist)),
                                           :=~,
                                           s(:arglist,
                                             s(:call, nil, :bar, s(:arglist)))))
      end
    end

    describe "for boolean operators" do
      it "handles triple :and" do
        "foo and bar and baz and qux".
          must_be_parsed_as s(:and,
                              s(:call, nil, :foo, s(:arglist)),
                              s(:and,
                                s(:call, nil, :bar, s(:arglist)),
                                s(:and,
                                  s(:call, nil, :baz, s(:arglist)),
                                  s(:call, nil, :qux, s(:arglist)))))
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

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