From 4744ec75658814fcf5b55924852dd1726c36aed9 Mon Sep 17 00:00:00 2001 From: Kyrylo Silin Date: Tue, 28 May 2019 21:14:50 +0300 Subject: spec/pry_defaults: silence unwanted deprecation warnings --- lib/pry/pry_instance.rb | 2 +- spec/pry_defaults_spec.rb | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/pry/pry_instance.rb b/lib/pry/pry_instance.rb index fd1fc800..9ccca364 100644 --- a/lib/pry/pry_instance.rb +++ b/lib/pry/pry_instance.rb @@ -478,7 +478,7 @@ class Pry unless @prompt_warn @prompt_warn = true - warn( + Kernel.warn( "warning: setting prompt with help of " \ "`Pry.config.prompt = [proc {}, proc {}]` is deprecated. " \ "Use Pry::Prompt API instead" diff --git a/spec/pry_defaults_spec.rb b/spec/pry_defaults_spec.rb index 816481ff..fa0b8c1a 100644 --- a/spec/pry_defaults_spec.rb +++ b/spec/pry_defaults_spec.rb @@ -13,6 +13,9 @@ describe "test Pry defaults" do end describe "input" do + # Silence deprecation warnings. + before { allow(Kernel).to receive(:warn) } + it 'should set the input default, and the default should be overridable' do Pry.config.input = InputTester.new("5") Pry.config.output = @str_output -- cgit v1.2.1