spec/parser_spec.rb in nydp-0.4.6 vs spec/parser_spec.rb in nydp-0.5.0

- old
+ new

@@ -139,12 +139,12 @@ it "should spot numbers hiding in special syntax" do parsed = parse("foo.2:3:4") expect(parsed.inspect).to eq "(colon-syntax (dot-syntax foo 2) 3 4)" - expect(parsed.map &:class).to eq [Nydp::Symbol, Nydp::Pair, Fixnum, Fixnum] - expect(parsed.cdr.car.map &:class).to eq [Nydp::Symbol, Nydp::Symbol, Fixnum] + expect(parsed.map &:class).to eq [Nydp::Symbol, Nydp::Pair, Integer, Integer] + expect(parsed.cdr.car.map &:class).to eq [Nydp::Symbol, Nydp::Symbol, Integer] end it "should handle prefix and postfix syntax also" do parsed = parse(".foo123:") expect(parsed.inspect).to eq "(colon-syntax (dot-syntax || foo123) ||)" @@ -261,11 +261,11 @@ end it "parses a string with a simple interpolation" do str = "foo " empty = "" - expect(parse '"foo ~foo"').to eq pair_list([string_pieces, str, foo, empty]) + expect(parse '"foo ~foo"').to eq pair_list([string_pieces, str, foo]) end it "parses a string with a more complex interpolation" do strf = "foo " strb = " bar" @@ -282,10 +282,10 @@ expect(parse '"foo ~(foo "foo ~foo bar" bar) bar"').to eq pair_list([string_pieces, strf, expr, strb]) end it "parses a string with only an interpolation" do empty = "" - expect(parse '"~foo"').to eq pair_list([string_pieces, empty, foo, empty]) + expect(parse '"~foo"').to eq foo end it "should even parse comments" do txt = "(def foo (bar) ; here's a comment