Skip to content

Instantly share code, notes, and snippets.

@kou
Created October 29, 2014 12:17
Show Gist options
  • Save kou/1bf17a2bc6e934be3075 to your computer and use it in GitHub Desktop.
Save kou/1bf17a2bc6e934be3075 to your computer and use it in GitHub Desktop.
脱minitest
Index: envutil.rb
===================================================================
--- envutil.rb (revision 48187)
+++ envutil.rb (working copy)
@@ -400,8 +400,11 @@
def assert_warning(pat, msg = nil)
stderr = EnvUtil.verbose_warning { yield }
- msg = message(msg) {diff pat, stderr}
- assert(pat === stderr, msg)
+ if pat.is_a?(Regexp)
+ assert_match(pat, stderr)
+ else
+ assert_equal(pat, stderr)
+ end
end
def assert_warn(*args)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment