Sha256: 169f4cfeeb5fad1e17cc8ffe6169c5febda05cada362974895829f2a483ca3ac

Contents?: true

Size: 910 Bytes

Versions: 14

Compression:

Stored size: 910 Bytes

Contents

#encoding: utf-8
require File.join(File.dirname(__FILE__), "../../spec_helper")
include Nudge

describe BoolFlushInstruction do
  
  it_should_behave_like "every Nudge Instruction"
  
  before(:each) do
    @context = Interpreter.new
    @i1 = BoolFlushInstruction.new(@context)
  end
  
  
  describe "\#go" do
    before(:each) do
      @i1 = BoolFlushInstruction.new(@context)
      @context.clear_stacks
      @bool1 = ValuePoint.new("bool", "true")
    end
    
    describe "\#preconditions?" do
      it "should check that the :bool stack responds to #depth" do
        @i1.preconditions?.should == true
      end
    end
    
    describe "\#cleanup" do
      it "should remove all items on the stack" do
        11.times {@context.stacks[:bool].push(@bool1)}
        @context.stacks[:bool].depth.should == 11
        @i1.go
        @context.stacks[:bool].depth.should == 0
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

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