Sha256: 6013919097f19f0480448106838c9a9f72612fd3134580f15743d3d07020299b

Contents?: true

Size: 1.02 KB

Versions: 6

Compression:

Stored size: 1.02 KB

Contents

require 'pione/test-helper'

describe Pione::System::DomainDump do
  before do
    @env = TestHelper::Lang.env
    TestHelper::Lang.declaration!(@env, "$A := 1")
    TestHelper::Lang.declaration!(@env, "$B := 1.23")
    TestHelper::Lang.declaration!(@env, "$C := $A")
    TestHelper::Lang.declaration!(@env, "$D := true")
    @location = Location[Temppath.create].tap do |location|
      System::DomainDump.new(@env).write(location)
    end
  end

  it "should write a domain dump" do
    location = Location[Temppath.create]
    System::DomainDump.new(@env).write(location)
    location.should.exist
  end

  it "should load a domain dump" do
    env = System::DomainDump.load(@location).env
    env.variable_get(Lang::Variable.new("A")).should == TestHelper::Lang.expr("1")
    env.variable_get(Lang::Variable.new("B")).should == TestHelper::Lang.expr("1.23")
    env.variable_get(Lang::Variable.new("C")).should == TestHelper::Lang.expr("1")
    env.variable_get(Lang::Variable.new("D")).should == TestHelper::Lang.expr("true")
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
pione-0.5.0 test/system/spec_domain-dump.rb
pione-0.5.0.alpha.2 test/system/spec_domain-dump.rb
pione-0.5.0.alpha.1 test/system/spec_domain-dump.rb
pione-0.4.2 test/system/spec_domain-dump.rb
pione-0.4.1 test/system/spec_domain-dump.rb
pione-0.4.0 test/system/spec_domain-dump.rb