spec/cli/parser/literal_spec.rb in opal-0.6.0 vs spec/cli/parser/literal_spec.rb in opal-0.6.1
- old
+ new
@@ -92,9 +92,14 @@
it "supports 1.9 style hash keys" do
parsed("{ a: 1 }").should == [:hash, [:sym, :a], [:int, 1]]
parsed("{ a: 1, b: 2 }").should == [:hash, [:sym, :a], [:int, 1], [:sym, :b], [:int, 2]]
end
+
+ it "parses hash arrows without spaces around arguments" do
+ parsed("{1=>2}").should == [:hash, [:int, 1], [:int, 2]]
+ parsed("{:foo=>2}").should == [:hash, [:sym, :foo], [:int, 2]]
+ end
end
describe "parsing regexps" do
it "parses a regexp" do
parsed("/lol/").should == [:regexp, 'lol', nil]