Sha256: ca8c816f1b39db0deb3ee22ffade8a8edd5d146b4f7b3b0ff57fdf6ba44f2561

Contents?: true

Size: 914 Bytes

Versions: 14

Compression:

Stored size: 914 Bytes

Contents

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

describe FloatRandomInstruction do
  
  it_should_behave_like "every Nudge Instruction"
  
  before(:each) do
    @context = Interpreter.new
    @i1 = FloatRandomInstruction.new(@context)
  end
  
  describe "\#go" do
    before(:each) do
      @i1 = FloatRandomInstruction.new(@context)
      @context.clear_stacks
    end
      
    describe "\#cleanup" do
      it "should invoke Type#any_value" do
        @context.clear_stacks
        FloatType.should_receive(:any_value)
        @i1.go
      end
      
      it "should have a created a new instance of the right type and pushed it" do
        @context.clear_stacks
        @i1.go
        @context.stacks[:float].depth.should == 1
        result = @context.stacks[:float].peek
        result.value.should_not == nil
        result.type.should == :float
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

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