1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/spec/ruby/library/ripper/sexp_spec.rb
2020-07-27 21:41:08 +02:00

13 lines
441 B
Ruby

require_relative '../../spec_helper'
require 'ripper'
describe "Ripper.sexp" do
it "returns an s-expression for a method declaration" do
expected = [:program,
[[:def,
[:@ident, "hello", [1, 4]],
[:params, nil, nil, nil, nil, nil, nil, nil],
[:bodystmt, [[:@int, "42", [1, 11]]], nil, nil, nil]]]]
Ripper.sexp("def hello; 42; end").should == expected
end
end