Sha256: 67c870faec91a6ec652106efb59375774bb231df21bd1147f7d89e0920ece63f

Contents?: true

Size: 965 Bytes

Versions: 14

Compression:

Stored size: 965 Bytes

Contents

require File.join(File.dirname(__FILE__), "../../spec_helper")
include Nudge


describe NameNextInstruction do
  
  it_should_behave_like "every Nudge Instruction"
  
  before(:each) do
    @context = Interpreter.new
    @i1 = NameNextInstruction.new(@context)
  end
  
  
  describe "\#go" do
    before(:each) do
      @i1 = NameNextInstruction.new(@context)
      @context.reset
    end
    
    describe "\#preconditions?" do
      it "should always be ready to go" do
        @i1.preconditions?.should == true
      end
    end
    
    describe "\#cleanup" do
      it "should push a new ReferencePoint onto :exec, with an incremented value" do
        @context.last_name.should == "refAAAAA"
        @i1.go
        @context.last_name.should == "refAAAAB"
        @context.stacks[:exec].depth.should == 1
        @i1.go
        @context.last_name.should == "refAAAAC"
        @context.stacks[:exec].peek.value.should == "refAAAAC"
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
nudge-0.2.9 spec/instructions/name/name_next_spec.rb
nudge-0.2.8 spec/instructions/name/name_next_spec.rb
nudge-0.2.7 spec/instructions/name/name_next_spec.rb
nudge-0.2.6 spec/instructions/name/name_next_spec.rb
nudge-0.2.5 spec/instructions/name/name_next_spec.rb
nudge-0.2.4 spec/instructions/name/name_next_spec.rb
nudge-0.2.3 spec/instructions/name/name_next_spec.rb
nudge-0.2.2 spec/instructions/name/name_next_spec.rb
nudge-0.2.1 spec/instructions/name/name_next_spec.rb
nudge-0.2.0 spec/instructions/name/name_next_spec.rb
nudge-0.1.3 spec/instructions/name/name_next_spec.rb
nudge-0.1.2 spec/instructions/name/name_next_spec.rb
nudge-0.1.1 spec/instructions/name/name_next_spec.rb
nudge-0.1.0 spec/instructions/name/name_next_spec.rb