Sha256: 23db201e016f057afacee1feaba6f67ee44516ccad51f3c3e5d35c90c748f762

Contents?: true

Size: 758 Bytes

Versions: 6

Compression:

Stored size: 758 Bytes

Contents

require 'spec_helper'

describe Solve::Solver::Serializer do
  it "deserializes a serialized solver to an equivalent solver" do
    graph = Solve::Graph.new

    graph.artifact("A", "1.0.0").depends("B", "1.0.0")
    graph.artifact("B", "1.0.0").depends("C", "1.0.0")
    graph.artifact("C", "1.0.0")

    demands = [["A", "1.0.0"]]

    solver = Solve::Solver.new(graph, demands)
    serializer = Solve::Solver::Serializer.new
    serialized = serializer.serialize(solver)
    deserialized = serializer.deserialize(serialized)

    solver.graph.should eql(deserialized.graph)
    solver.demands.should eql(deserialized.demands)

    result = solver.resolve
    deserialized_result = deserialized.resolve
    result.should eql(deserialized_result)
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
solve-1.2.1 spec/unit/solve/solver/serializer_spec.rb
solve-1.2.0 spec/unit/solve/solver/serializer_spec.rb
solve-1.1.0 spec/unit/solve/solver/serializer_spec.rb
solve-1.0.0.rc3 spec/unit/solve/solver/serializer_spec.rb
solve-1.0.0.rc2 spec/unit/solve/solver/serializer_spec.rb
solve-1.0.0.rc1 spec/unit/solve/solver/serializer_spec.rb