Sha256: 426980d69f4c860c5dac8ecbec71d99681429603e4af6e4c8ca0836b5789f803

Contents?: true

Size: 701 Bytes

Versions: 1

Compression:

Stored size: 701 Bytes

Contents

describe CmdBlock do

  it "should evaluate all inner commands" do
    program = Program.new [], nil
    context = ProgramExecutionContext.for program
    cmd_block = CmdBlock.new [
      Poner.new(Rojo.new), Poner.new(Verde.new),
      Poner.new(Negro.new), Poner.new(Azul.new)]
    cmd_block.evaluate context
    expect(context.head.are_there_balls?(Rojo.new)).to be_true
    expect(context.head.are_there_balls?(Azul.new)).to be_true
    expect(context.head.are_there_balls?(Negro.new)).to be_true
    expect(context.head.are_there_balls?(Verde.new)).to be_true
  end

  it "builds an empty command block" do
    expect(CmdBlock.new []).to be_empty
    expect(CmdBlock.empty).to be_empty
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gobstones-0.0.1.1 spec/lang/commands/cmd_block_spec.rb