Sha256: 0c70bc89e9cc632b3ece2c88ffb0213acfc78a0b44d1556cd0727ab8968a07e5
Contents?: true
Size: 578 Bytes
Versions: 26
Compression:
Stored size: 578 Bytes
Contents
require 'spec_helper' describe "The unless keyword" do it "returns s(:if) with reversed true and false bodies" do opal_parse("unless 10; 20; end").should == [:if, [:lit, 10], nil, [:lit, 20]] opal_parse("unless 10; 20; 30; end").should == [:if, [:lit, 10], nil, [:block, [:lit, 20], [:lit, 30]]] opal_parse("unless 10; 20; else; 30; end").should == [:if, [:lit, 10], [:lit, 30], [:lit, 20]] end it "returns s(:if) with reversed true and false bodies for prefix unless" do opal_parse("20 unless 10").should == [:if, [:lit, 10], nil, [:lit, 20]] end end
Version data entries
26 entries across 26 versions & 1 rubygems