Sha256: 8e673e01d6e9f38ee4016c45126ac0132a2c00b326572e01ecfe1f537a74b6a1
Contents?: true
Size: 1.25 KB
Versions: 14
Compression:
Stored size: 1.25 KB
Contents
#encoding: utf-8 require File.join(File.dirname(__FILE__), "../../spec_helper") include Nudge describe CodeNullQInstruction do it_should_behave_like "every Nudge Instruction" before(:each) do @context = Interpreter.new @i1 = CodeNullQInstruction.new(@context) end describe "\#go" do before(:each) do @context = Interpreter.new @i1 = CodeNullQInstruction.new(@context) end describe "\#preconditions?" do it "should need at least one item on the :code stack" do @context.stacks[:code].push(ValuePoint.new("code","block {}")) @i1.preconditions?.should == true end end describe "\#cleanup" do it "should push a :bool that is false when the :code value isn't 'block {}'" do @context.stacks[:code].push(ValuePoint.new("code","ref x")) @i1.go @context.stacks[:bool].depth.should == 1 @context.stacks[:bool].peek.value.should == false end it "should push a :bool that's true when the top :code item is 'block {}" do @context.stacks[:code].push(ValuePoint.new("code","block {}")) @i1.go @context.stacks[:bool].depth.should == 1 @context.stacks[:bool].peek.value.should == true end end end end
Version data entries
14 entries across 14 versions & 1 rubygems