diff options
Diffstat (limited to 'spec/ruby/library/readline/history/shared/size.rb')
-rw-r--r-- | spec/ruby/library/readline/history/shared/size.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/ruby/library/readline/history/shared/size.rb b/spec/ruby/library/readline/history/shared/size.rb new file mode 100644 index 0000000000..1d6df86f78 --- /dev/null +++ b/spec/ruby/library/readline/history/shared/size.rb @@ -0,0 +1,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 |