Sha256: 79095a43de080b36e7330831272c19262b856a0a5eaf08c15a293411ed8b0ee3

Contents?: true

Size: 762 Bytes

Versions: 7

Compression:

Stored size: 762 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.artifacts("A", "1.0.0").depends("B", "1.0.0")
    graph.artifacts("B", "1.0.0").depends("C", "1.0.0")
    graph.artifacts("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

7 entries across 7 versions & 1 rubygems

Version Path
solve-0.8.2 spec/unit/solve/solver/serializer_spec.rb
solve-0.8.1 spec/unit/solve/solver/serializer_spec.rb
solve-0.8.0 spec/unit/solve/solver/serializer_spec.rb
solve-0.7.0 spec/unit/solve/solver/serializer_spec.rb
solve-0.6.1 spec/unit/solve/solver/serializer_spec.rb
solve-0.6.0 spec/unit/solve/solver/serializer_spec.rb
solve-0.5.0 spec/unit/solve/solver/serializer_spec.rb