mirror of
https://github.com/pry/pry.git
synced 2022-11-09 12:35:05 -05:00
fix 2.4 warning in edit command and specs about deprecated constant (Fixnum)
This commit is contained in:
parent
efef49da8a
commit
ec03f1be65
2 changed files with 3 additions and 3 deletions
|
@ -157,7 +157,7 @@ class Pry
|
||||||
case opts[:i]
|
case opts[:i]
|
||||||
when Range
|
when Range
|
||||||
(_pry_.input_array[opts[:i]] || []).join
|
(_pry_.input_array[opts[:i]] || []).join
|
||||||
when Fixnum
|
when 1.class
|
||||||
_pry_.input_array[opts[:i]] || ""
|
_pry_.input_array[opts[:i]] || ""
|
||||||
else
|
else
|
||||||
raise Pry::CommandError, "Not a valid range: #{opts[:i]}"
|
raise Pry::CommandError, "Not a valid range: #{opts[:i]}"
|
||||||
|
|
|
@ -388,8 +388,8 @@ describe "edit" do
|
||||||
end
|
end
|
||||||
|
|
||||||
it "should edit a multi-line expression as it occupies one line of _in_" do
|
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"
|
pry_eval "class #{1.class}\n def invert; -self; end\nend", "edit -i 1"
|
||||||
expect(@contents).to eq "class Fixnum\n def invert; -self; end\nend\n"
|
expect(@contents).to eq "class #{1.class}\n def invert; -self; end\nend\n"
|
||||||
end
|
end
|
||||||
|
|
||||||
it "should not work with a filename" do
|
it "should not work with a filename" do
|
||||||
|
|
Loading…
Reference in a new issue