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