From a0901920325eddda423babfa3976554c244e6616 Mon Sep 17 00:00:00 2001 From: mame Date: Thu, 7 May 2009 12:44:25 +0000 Subject: [PATCH] * 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 --- ChangeLog | 5 +++++ test/ruby/test_rubyoptions.rb | 11 +++++++++++ 2 files changed, 16 insertions(+) diff --git a/ChangeLog b/ChangeLog index e2ae91272b..c3e6e64d59 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Thu May 7 21:42:51 2009 Yusuke Endoh + + * 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 * array.c (rb_ary_flatten_bang): returns nil if nothing changed. diff --git a/test/ruby/test_rubyoptions.rb b/test/ruby/test_rubyoptions.rb index bc47033a0c..8a1e9a8335 100644 --- a/test/ruby/test_rubyoptions.rb +++ b/test/ruby/test_rubyoptions.rb @@ -284,4 +284,15 @@ class TestRubyOptions < Test::Unit::TestCase assert_in_out_err(%w(- -#=foo), "#!ruby -s\n", [], /invalid name for global variable - -# \(NameError\)/) 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