Sha256: a26ad7d3a3c22e37193ca10d262a01871d64011acea85e9ae20636170c402478
Contents?: true
Size: 743 Bytes
Versions: 39
Compression:
Stored size: 743 Bytes
Contents
require 'support/parser_helpers' describe "The yield keyword" do it "should return s(:yield) when no arguments given" do parsed("yield").should == [:yield] end it "appends arguments onto end of s(:yield) without an arglist" do parsed("yield 1").should == [:yield, [:int, 1]] parsed("yield 1, 2").should == [:yield, [:int, 1], [:int, 2]] parsed("yield 1, *2").should == [:yield, [:int, 1], [:splat, [:int, 2]]] end it "accepts parans for any number of arguments" do parsed("yield()").should == [:yield] parsed("yield(1)").should == [:yield, [:int, 1]] parsed("yield(1, 2)").should == [:yield, [:int, 1], [:int, 2]] parsed("yield(1, *2)").should == [:yield, [:int, 1], [:splat, [:int, 2]]] end end
Version data entries
39 entries across 39 versions & 3 rubygems