diff options
Diffstat (limited to 'spec/support/helpers.rb')
-rw-r--r-- | spec/support/helpers.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/support/helpers.rb b/spec/support/helpers.rb index a5ff292f01..151c99c3ff 100644 --- a/spec/support/helpers.rb +++ b/spec/support/helpers.rb @@ -48,6 +48,16 @@ module Spec Bundler.feature_flag.error_on_stderr? ? last_command.stderr : last_command.stdout end + MAJOR_DEPRECATION = /^\[DEPRECATED\]\s*/.freeze + + def err_without_deprecations + last_command.stderr.gsub(/#{MAJOR_DEPRECATION}.+[\n]?/, "") + end + + def deprecations + err.split("\n").select {|l| l =~ MAJOR_DEPRECATION }.join("\n").split(MAJOR_DEPRECATION) + end + def exitstatus last_command.exitstatus end |