summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-05-21 14:47:21 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-05-21 14:47:21 +0000
commit6d3ef1b23867cce7fb6791327b9fcab36e010277 (patch)
tree0f58f8b35fb4fc2411b9ca54485a9ea3900c1101 /test
parent3c84bb31479840329e4d8953a5828781b07f9ab5 (diff)
merges r23362 from trunk into ruby_1_9_1.
-- * 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/branches/ruby_1_9_1@23514 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_rubyoptions.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/ruby/test_rubyoptions.rb b/test/ruby/test_rubyoptions.rb
index a540c70ac9..6db7ff32c4 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