diff options
| author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-06-10 01:44:57 +0000 |
|---|---|---|
| committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-06-10 01:44:57 +0000 |
| commit | 473dc1c5c0957595f0e6ef43d29e214fddf02ec8 (patch) | |
| tree | 4331e5fe47e9924347e5f6c7aa09a70aa85ab847 /test/ruby/envutil.rb | |
| parent | ce4ecc6b13bbf521389f8d90d5ed8b42d2401751 (diff) | |
envutil.rb: use keyword argument
* test/ruby/envutil.rb (assert_valid_syntax): use keyword argument.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46389 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/envutil.rb')
| -rw-r--r-- | test/ruby/envutil.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/ruby/envutil.rb b/test/ruby/envutil.rb index e9a60ed5e0..dfcd0e0808 100644 --- a/test/ruby/envutil.rb +++ b/test/ruby/envutil.rb @@ -219,13 +219,13 @@ module Test module Unit module Assertions public - def assert_valid_syntax(code, fname = caller_locations(1, 1)[0], mesg = fname.to_s) + def assert_valid_syntax(code, fname = caller_locations(1, 1)[0], mesg = fname.to_s, verbose: nil) code = code.dup.force_encoding("ascii-8bit") code.sub!(/\A(?:\xef\xbb\xbf)?(\s*\#.*$)*(\n)?/n) { "#$&#{"\n" if $1 && !$2}BEGIN{throw tag, :ok}\n" } code.force_encoding(Encoding::UTF_8) - verbose, $VERBOSE = $VERBOSE, nil + verbose, $VERBOSE = $VERBOSE, verbose yield if defined?(yield) case when Array === fname |
