From b99b4d4249f24915c478ca1b5f762db632f89da5 Mon Sep 17 00:00:00 2001 From: tbpgr Date: Sun, 11 Jan 2015 03:54:27 +0900 Subject: [PATCH] Fix history clear bag(No re-init @original_lines) --- lib/pry/history.rb | 1 + spec/history_spec.rb | 1 + 2 files changed, 2 insertions(+) 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 6b33bb1f..e00d2f3e 100644 --- a/spec/history_spec.rb +++ b/spec/history_spec.rb @@ -53,6 +53,7 @@ describe Pry do Pry.history.to_a.size.should > 0 Pry.history.clear Pry.history.to_a.size.should == 0 + Pry.history.original_lines.should == 0 end it "doesn't affect the contents of the history file" do