summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorBrian Graham <bcgraham+github@gmail.com>2019-07-31 22:37:22 -0400
committerBrian Graham <bcgraham+github@gmail.com>2019-08-09 16:07:59 -0400
commit113670040c5fa890004dbd59dfd336d829d336e5 (patch)
tree2323c11da3529b4115521477da2b175f2d7246d0 /spec
parent846b7ecb6f804d4192cc44a673c2a85b73f1f0b7 (diff)
downloadpry-113670040c5fa890004dbd59dfd336d829d336e5.tar.gz
Allow negative ranges in hist --show
Remove duplicate `opts[:show]` check in hist.
Diffstat (limited to 'spec')
-rw-r--r--spec/commands/hist_spec.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/commands/hist_spec.rb b/spec/commands/hist_spec.rb
index 2fbbffb6..3563d3e9 100644
--- a/spec/commands/hist_spec.rb
+++ b/spec/commands/hist_spec.rb
@@ -132,6 +132,15 @@ describe "hist" do
expect(out).to match(/b\n\d+:.*c\n\d+:.*d/)
end
+ it 'should show lines between offsets A and B with the --show switch' do
+ ("a".."f").each do |v|
+ @hist.push v
+ end
+
+ out = @t.eval 'hist --show -4..-2'
+ expect(out).to eq "3: c\n4: d\n5: e\n"
+ end
+
it "should store a call with `--replay` flag" do
@t.eval ":banzai"
@t.eval "hist --replay 1"