diff --git a/lib/pry/history.rb b/lib/pry/history.rb index 494a6b70..1fff3b0b 100644 --- a/lib/pry/history.rb +++ b/lib/pry/history.rb @@ -57,6 +57,7 @@ class Pry # history file. def clear @clearer.call + @original_lines = 0 @history = [] end diff --git a/spec/history_spec.rb b/spec/history_spec.rb index f682c47e..4c0cc2fd 100644 --- a/spec/history_spec.rb +++ b/spec/history_spec.rb @@ -53,6 +53,7 @@ describe Pry do Pry.history.to_a.size.should be > 0 Pry.history.clear Pry.history.to_a.size.should eq 0 + Pry.history.original_lines.should eq 0 end it "doesn't affect the contents of the history file" do