Browse files

Set up controlled environment, Rubinius::Debugger::Frame#run spec

  • Loading branch information...
1 parent bb58246 commit 190fd4b7c38ff80268d30fa46cbd666a26d72154 @txus committed Jun 4, 2011
Showing with 30 additions and 0 deletions.
  1. +30 −0 spec/debugger/frame_spec.rb
View
30 spec/debugger/frame_spec.rb
@@ -0,0 +1,30 @@
+require File.expand_path('../spec_helper', __FILE__)
+
+describe "Rubinius::Debugger::Frame" do
+ before do
+ compiled_method = def ten
+ a + 7
+ end
+
+ variable_scope = Rubinius::VariableScope.new
+ variable_scope.set_eval_local(:a, 3)
+ variable_scope.instance_eval { @method = compiled_method }
+
+ location = Rubinius::Location.new
+ location.instance_eval do
+ @variables = variable_scope
+ @method = compiled_method
+ @static_scope = compiled_method.scope
+ end
+
+ @debugger = mock('debugger')
+ @frame = Rubinius::Debugger::Frame.new(@debugger, 1, location)
+ end
+
+ describe "#run" do
+ it 'runs the code within the frame binding' do
+ @frame.run('a + 3').should == 6
+ end
+ end
+
+end

0 comments on commit 190fd4b

Please sign in to comment.