mirror of
https://github.com/pry/pry.git
synced 2022-11-09 12:35:05 -05:00
Add input_array.pop!
For pry-de's ,- command.
This commit is contained in:
parent
0b5b06d906
commit
845ea285be
2 changed files with 10 additions and 0 deletions
|
@ -89,6 +89,11 @@ class Pry
|
|||
((@count - size)...@count).map { |n| @hash[n] }
|
||||
end
|
||||
|
||||
def pop!
|
||||
@hash.delete @count - 1
|
||||
@count -= 1
|
||||
end
|
||||
|
||||
def inspect
|
||||
"#<#{self.class} size=#{size} first=#{@count - size} max_size=#{max_size}>"
|
||||
end
|
||||
|
|
|
@ -59,4 +59,9 @@ describe Pry::HistoryArray do
|
|||
12.times { |n| @array << n }
|
||||
@array.entries.compact.size.should == 10
|
||||
end
|
||||
|
||||
it 'should pop!' do
|
||||
@populated.pop!
|
||||
@populated.to_a.should == [1, 2, 3]
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue