aboutsummaryrefslogtreecommitdiffstats
path: root/spec/rubyspec/library/readline/history/shared/size.rb
blob: 1d6df86f78cc19877c7feaa87b7602fec1ef9a69 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
describe :readline_history_size, shared: true do
  it "returns the size of the history" do
    Readline::HISTORY.send(@method).should == 0
    Readline::HISTORY.push("1", "2", "")
    Readline::HISTORY.send(@method).should == 3

    Readline::HISTORY.pop
    Readline::HISTORY.send(@method).should == 2

    Readline::HISTORY.pop
    Readline::HISTORY.pop
    Readline::HISTORY.send(@method).should == 0
  end
end