From ec03f1be655cf44cf9760e633eda200d6a8c0c4b Mon Sep 17 00:00:00 2001 From: robert Date: Sat, 3 Jun 2017 13:50:31 +0100 Subject: [PATCH] fix 2.4 warning in edit command and specs about deprecated constant (Fixnum) --- lib/pry/commands/edit.rb | 2 +- spec/commands/edit_spec.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/pry/commands/edit.rb b/lib/pry/commands/edit.rb index f65cb23e..7b7df4ed 100644 --- a/lib/pry/commands/edit.rb +++ b/lib/pry/commands/edit.rb @@ -157,7 +157,7 @@ class Pry case opts[:i] when Range (_pry_.input_array[opts[:i]] || []).join - when Fixnum + when 1.class _pry_.input_array[opts[:i]] || "" else raise Pry::CommandError, "Not a valid range: #{opts[:i]}" diff --git a/spec/commands/edit_spec.rb b/spec/commands/edit_spec.rb index 39d1226b..24ff6321 100644 --- a/spec/commands/edit_spec.rb +++ b/spec/commands/edit_spec.rb @@ -388,8 +388,8 @@ describe "edit" do end it "should edit a multi-line expression as it occupies one line of _in_" do - pry_eval "class Fixnum\n def invert; -self; end\nend", "edit -i 1" - expect(@contents).to eq "class Fixnum\n def invert; -self; end\nend\n" + pry_eval "class #{1.class}\n def invert; -self; end\nend", "edit -i 1" + expect(@contents).to eq "class #{1.class}\n def invert; -self; end\nend\n" end it "should not work with a filename" do