Verified Commit 807e4ca3 authored by Peter Leitzen's avatar Peter Leitzen
Browse files

Enable deprecation warnings in specs programmatically

Note that `Warning#[]=` is has been added in Ruby 2.7.

This is equivalent to `export RUBYOPT=-W:deprecated`.
parent 0440b9df
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -3,6 +3,9 @@
require "gitlab-labkit"
require "rspec-parameterized"

# Warning#[]= is supported since Ruby 2.7
Warning[:deprecated] = true if Warning.respond_to?(:[]=)

RSpec.configure do |config|
  config.expect_with :rspec do |expectations|
    expectations.include_chain_clauses_in_custom_matcher_descriptions = true