Sha256: 889e4fe0f3babac36dc4db63205d61b7c029834618849bb5a8a04c32dc57268f
Contents?: true
Size: 630 Bytes
Versions: 26
Compression:
Stored size: 630 Bytes
Contents
require 'spec_helper' describe "The return keyword" do it "should return s(:return) when given no arguments" do opal_parse("return").should == [:return] end it "returns s(:return) with the direct argument when given one argument" do opal_parse("return 1").should == [:return, [:lit, 1]] opal_parse("return *2").should == [:return, [:splat, [:lit, 2]]] end it "returns s(:return) with an s(:array) when args size > 1" do opal_parse("return 1, 2").should == [:return, [:array, [:lit, 1], [:lit, 2]]] opal_parse("return 1, *2").should == [:return, [:array, [:lit, 1], [:splat, [:lit, 2]]]] end end
Version data entries
26 entries across 26 versions & 1 rubygems