1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/test/ripper/test_ripper.rb
nobu 0331e42be3 parse.y: freeze filename
* parse.y (ripper_initialize): filename can not be modified.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45397 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-03-24 13:19:57 +00:00

53 lines
869 B
Ruby

begin
require 'ripper'
require 'test/unit'
ripper_test = true
module TestRipper; end
rescue LoadError
end
class TestRipper::Ripper < Test::Unit::TestCase
def setup
@ripper = Ripper.new '1 + 1'
end
def test_column
assert_nil @ripper.column
end
def test_encoding
assert_equal Encoding::UTF_8, @ripper.encoding
end
def test_end_seen_eh
refute @ripper.end_seen?
end
def test_filename
assert_equal '(ripper)', @ripper.filename
filename = "ripper"
ripper = Ripper.new("", filename)
filename.clear
assert_equal "ripper", ripper.filename
end
def test_lineno
assert_nil @ripper.lineno
end
def test_parse
refute @ripper.parse
end
def test_yydebug
refute @ripper.yydebug
end
def test_yydebug_equals
@ripper.yydebug = true
assert @ripper.yydebug
end
end if ripper_test