Sha256: 2fdf4f91a30788cf6d488dc5895c72320cb59fb6f3b02be2fcc3b2603f7fa19e
Contents?: true
Size: 764 Bytes
Versions: 26
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, [:lit, 1]] opal_parse("yield 1, 2").should == [:yield, [:lit, 1], [:lit, 2]] opal_parse("yield 1, *2").should == [:yield, [:lit, 1], [:splat, [:lit, 2]]] end it "accepts parans for any number of arguments" do opal_parse("yield()").should == [:yield] opal_parse("yield(1)").should == [:yield, [:lit, 1]] opal_parse("yield(1, 2)").should == [:yield, [:lit, 1], [:lit, 2]] opal_parse("yield(1, *2)").should == [:yield, [:lit, 1], [:splat, [:lit, 2]]] end end
Version data entries
26 entries across 26 versions & 1 rubygems