Skip to content

Commit

Permalink
Move empty line test
Browse files Browse the repository at this point in the history
  • Loading branch information
rf- committed Sep 5, 2012
1 parent 7a0aaae commit db11320
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
11 changes: 0 additions & 11 deletions test/test_default_commands/test_input.rb
Original file line number Diff line number Diff line change
Expand Up @@ -519,17 +519,6 @@ def next_input
out.should =~ /b\n\d+:.*c\n\d+:.*d/
end

it "should not contain empty lines" do
redirect_pry_io(InputTester.new(":place_holder", "2 + 2", "", "", "3 + 3", "hist", "exit-all"), @str_output) do
pry
end

a = @str_output.string.each_line.to_a.index{|line| line.include?("2 + 2") }
b = @str_output.string.each_line.to_a.index{|line| line.include?("3 + 3") }

(a + 1).should == b
end

it "should store a call with `--replay` flag" do
redirect_pry_io(InputTester.new(":banzai", "hist --replay 1",
"hist", "exit-all"), @str_output) do
Expand Down
6 changes: 6 additions & 0 deletions test/test_pry_history.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@
Pry.history << '_ += 1'
Pry.history.to_a.grep('_ += 1').count.should == 1
end

it "should not record empty lines" do
c = Pry.history.to_a.count
Pry.history << ''
Pry.history.to_a.count.should == c
end
end

describe ".load_history" do
Expand Down

0 comments on commit db11320

Please sign in to comment.