summaryrefslogtreecommitdiffstats
path: root/test/ruby/test_rubyoptions.rb
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-05-07 12:44:25 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-05-07 12:44:25 +0000
commit3748c9c787619f76a62d8c4a2a34f2ad1852e75d (patch)
treeeb85a826bb02448f0a4eb619874e7459da6685a5 /test/ruby/test_rubyoptions.rb
parent15678c15c7eb1d94c2f7f2f068c2e928f368133d (diff)
downloadruby-3748c9c787619f76a62d8c4a2a34f2ad1852e75d.tar.gz
ruby-3748c9c787619f76a62d8c4a2a34f2ad1852e75d.tar.xz
ruby-3748c9c787619f76a62d8c4a2a34f2ad1852e75d.zip
* test/ruby/test_rubyoptions.rb (test_indentation_check): add a test
for indentation check. [ruby-dev:38382] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23362 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_rubyoptions.rb')
-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 bc47033a0..8a1e9a833 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