Skip to content

Instantly share code, notes, and snippets.

@kyrylo
Created June 25, 2012 10:16
Show Gist options
  • Save kyrylo/2987788 to your computer and use it in GitHub Desktop.
Save kyrylo/2987788 to your computer and use it in GitHub Desktop.
it 'should keep correct old stack' do
#1
redirect_pry_io(InputTester.new("cd @", "cd -", @cs, "exit-all")) do
Pry.start(@o)
end
Pad.cs.old_stack.should == nil
#2
redirect_pry_io(InputTester.new("cd :mon_dogg", "cd @", @cs, "exit-all")) do
Pry.start(@o)
end
Pad.cs.old_stack.eval("self").should == @o
#3
redirect_pry_io(InputTester.new("cd :mon_dogg", "cd @", "cd -", @cs, "exit-all")) do
Pry.start(@o)
end
Pad.cs.old_stack.eval("self").should == :mon_dogg
end
end
# -------------------VERSUS-------------------
it 'should keep correct old stack' do
redirect_pry_io(InputTester.new("cd @", "cd -", @cs, "exit-all")) do
Pry.start(@o)
end
Pad.cs.old_stack.should == nil
redirect_pry_io(InputTester.new("cd :mon_dogg", "cd @", @cs, "exit-all")) do
Pry.start(@o)
end
Pad.cs.old_stack.eval("self").should == @o
redirect_pry_io(InputTester.new("cd :mon_dogg", "cd @", "cd -", @cs, "exit-all")) do
Pry.start(@o)
end
Pad.cs.old_stack.eval("self").should == :mon_dogg
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment