1
0
Fork 0
mirror of https://github.com/pry/pry.git synced 2022-11-09 12:35:05 -05:00

Fix warning generated by editor action

This commit is contained in:
Matijs van Zuijlen 2015-01-23 12:15:40 +01:00
parent 3376e6a0db
commit d4e4d4d8f6

View file

@ -550,7 +550,11 @@ describe "edit" do
before do
Pry.config.editor = lambda do |file, line|
lines = File.read(file).lines.to_a
lines[1] = ":maybe\n"
lines[1] = if lines[2] =~ /end/
":maybe\n"
else
"_foo = :maybe\n"
end
File.open(file, 'w') do |f|
f.write(lines.join)
end
@ -688,7 +692,7 @@ describe "edit" do
def_before.should eq '_foo = :possibly'
def_after.should eq '_foo = :possibly'
@patched_def.should eq ':maybe'
@patched_def.should eq '_foo = :maybe'
end
end
end