Updated MSpec source to 46e80081.
[rbx.git] / spec / debugger / commands / down_frame_spec.rb
blob23c2f10b9af647e2b54c6edf882e1f77a4a56849
1 require File.dirname(__FILE__) + "/../spec_helper.rb"
2 require 'debugger/interface'
4 describe "DownFrame#execute" do
5   before :each do
6     @dbg = mock('Debugger')
7     @interface = mock('Interface')
8     @up = Debugger::DownFrame.new
9   end
11   it "moves the eval context down the specified number of frames" do
12     ctxt = MethodContext.current
13     @interface.should_receive(:eval_context).at_least(:once).and_return ctxt.sender.sender.sender
14     @interface.should_receive(:debug_context).at_least(:once).and_return ctxt
15     @interface.should_receive(:eval_context=).with(ctxt.sender)
16     @up.execute(@dbg, @interface, @up.command_regexp.match("down 2"))
17   end
19   it "does not move the eval context past the current frame" do
20     ctxt = MethodContext.current
21     @interface.should_receive(:eval_context).at_least(:once).and_return ctxt.sender
22     @interface.should_receive(:debug_context).at_least(:once).and_return ctxt
23     @interface.should_receive(:eval_context=).with(ctxt)
24     @up.execute(@dbg, @interface, @up.command_regexp.match("down 2"))
25   end
26 end