Sha256: fbefcdaa238d2fb9c8a4a827473a1a057b3d55444ed0d133aa93c2e48b135120

Contents?: true

Size: 386 Bytes

Versions: 1

Compression:

Stored size: 386 Bytes

Contents

describe SingleAssignment do

  let(:context) { ExecutionContext.new }
  let(:a) { VarName.new 'a' }

  it "should associate the var name with the evaluated expression" do
    assign = SingleAssignment.new a, Add.new(3.to_gbs_num, 4.to_gbs_num)
    assign.evaluate context
    expect(context.has_variable_named?('a')).to be_true
    expect(context.get(a)).to eq(7.to_gbs_num)
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

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