File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -229,6 +229,19 @@ def main
229229 #
230230 # See IRB@Customizing+the+IRB+Prompt for more information.
231231 attr_accessor :prompt_c
232+
233+ # TODO: Remove this when developing v2.0
234+ def prompt_n
235+ warn "IRB::Context#prompt_n is deprecated and will be removed in the next major release."
236+ ""
237+ end
238+
239+ # TODO: Remove this when developing v2.0
240+ def prompt_n = ( _ )
241+ warn "IRB::Context#prompt_n= is deprecated and will be removed in the next major release."
242+ ""
243+ end
244+
232245 # Can be either the default <code>IRB.conf[:AUTO_INDENT]</code>, or the
233246 # mode set by #prompt_mode=
234247 #
Original file line number Diff line number Diff line change @@ -90,6 +90,18 @@ def test_eval_input_raise2x
9090 ] , out )
9191 end
9292
93+ def test_prompt_n_deprecation
94+ irb = IRB ::Irb . new ( IRB ::WorkSpace . new ( Object . new ) )
95+
96+ out , err = capture_output do
97+ irb . context . prompt_n = "foo"
98+ irb . context . prompt_n
99+ end
100+
101+ assert_include err , "IRB::Context#prompt_n is deprecated"
102+ assert_include err , "IRB::Context#prompt_n= is deprecated"
103+ end
104+
93105 def test_output_to_pipe
94106 require 'stringio'
95107 input = TestInputMethod . new ( [ "n=1" ] )
You can’t perform that action at this time.
0 commit comments