1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* test/ruby/test_rubyoptions.rb (test_indentation_check): add a test

for indentation check.  [ruby-dev:38382]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23362 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
mame 2009-05-07 12:44:25 +00:00
parent 94ee3e7e02
commit a090192032
2 changed files with 16 additions and 0 deletions

View file

@ -1,3 +1,8 @@
Thu May 7 21:42:51 2009 Yusuke Endoh <mame@tsg.ne.jp>
* test/ruby/test_rubyoptions.rb (test_indentation_check): add a test
for indentation check. [ruby-dev:38382]
Thu May 7 16:40:09 2009 Nobuyoshi Nakada <nobu@ruby-lang.org> Thu May 7 16:40:09 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* array.c (rb_ary_flatten_bang): returns nil if nothing changed. * array.c (rb_ary_flatten_bang): returns nil if nothing changed.

View file

@ -284,4 +284,15 @@ class TestRubyOptions < Test::Unit::TestCase
assert_in_out_err(%w(- -#=foo), "#!ruby -s\n", [], assert_in_out_err(%w(- -#=foo), "#!ruby -s\n", [],
/invalid name for global variable - -# \(NameError\)/) /invalid name for global variable - -# \(NameError\)/)
end end
def test_indentation_check
t = Tempfile.new(["test_ruby_test_rubyoption", ".rb"])
t.puts "begin"
t.puts " end"
t.close
assert_in_out_err(["-w", t.path], "", [], /:2: warning: mismatched indentations at 'end' with 'begin' at 1/)
assert_in_out_err(["-wr", t.path, "-e", ""], "", [], /:2: warning: mismatched indentations at 'end' with 'begin' at 1/)
ensure
t.close(true) if t
end
end end