From 6a1ab0195e5b69321f1153abd02d4979a4c4ed1f Mon Sep 17 00:00:00 2001 From: Seiichi KONDO Date: Wed, 25 Mar 2020 09:21:31 +0900 Subject: [PATCH] Update to support pry 0.13 --- pry-inline.gemspec | 2 +- test/test_inline.rb | 60 ++++++++++++++++++++++++++++++--------------- 2 files changed, 41 insertions(+), 21 deletions(-) diff --git a/pry-inline.gemspec b/pry-inline.gemspec index 60e02a8..189d570 100644 --- a/pry-inline.gemspec +++ b/pry-inline.gemspec @@ -18,7 +18,7 @@ Gem::Specification.new do |spec| spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } spec.require_paths = ['lib'] - spec.add_dependency 'pry', '> 0.10.0', '<= 0.12.2' + spec.add_dependency 'pry', '> 0.10.0', '<= 0.13' spec.add_dependency 'unicode', '~> 0.4.4' spec.add_development_dependency 'bundler', '~> 1.10' spec.add_development_dependency 'rake', '~> 12.3' diff --git a/test/test_inline.rb b/test/test_inline.rb index 5b3361e..50eb9b0 100644 --- a/test/test_inline.rb +++ b/test/test_inline.rb @@ -14,13 +14,14 @@ def greet end actual = output_of_whereami { greet } - assert_equal <10} @binding = binding end EOF + assert { actual.end_with?(expected) } end test 'assignment of global variable' do @@ -115,12 +121,13 @@ def assign_class_variable end actual = output_of_whereami { assign_class_variable } - assert_equal <10} @binding = binding end EOF + assert { actual.end_with?(expected) } end test 'assignment of var args' do @@ -129,11 +136,12 @@ def use_var_args(*args) end actual = output_of_whereami { use_var_args(1, 2, 3) } - assert_equal <"u"} @binding = binding end EOF + assert { actual.end_with?(expected) } end test 'too long function' do @@ -217,7 +228,7 @@ def too_long_function i += 1 end actual = output_of_whereami { too_long_function } - assert_equal < #{lineno + 2}: @binding = binding #{lineno + 3}: message #{lineno + 4}: end EOF + assert { actual.end_with?(expected) } end test 'too long debug info' do @@ -258,12 +271,13 @@ def too_long_debug_info actual = output_of_whereami(terminal_width: 40) { too_long_debug_info } # <= 40 - assert_equal < #{lineno + 2}: @binding = binding #{lineno + 3}: end EOF + assert { actual.end_with?(expected) } end test 'too long debug info including wide characters' do @@ -294,12 +309,13 @@ def too_long_debug_info_including_wide_characters too_long_debug_info_including_wide_characters end # <= 40 - assert_equal < e # e: # @binding = binding end EOF + assert { actual.end_with?(expected) } end private