Sha256: b45854c1f20065d3467cb08791c8558dc835ebdba53e2ff2903931d6df8d170f

Contents?: true

Size: 658 Bytes

Versions: 2

Compression:

Stored size: 658 Bytes

Contents

if respond_to?(:require_relative, true)
  require_relative 'common'
else
  require File.dirname(__FILE__) + '/common'
end

describe RestGraph do
  after do
    reset_webmock
    RR.verify
  end

  it 'could be serialized with lighten' do
    marshal = RUBY_VERSION >= '1.9' ? Marshal : nil
    [YAML, marshal].compact.each{ |engine|
      test = lambda{ |obj| engine.load(engine.dump(obj)) }
        rg = RestGraph.new(:log_handler => lambda{})
      lambda{ test[rg] }.should.raise(TypeError)
      test[rg.lighten].should == rg.lighten
      lambda{ test[rg] }.should.raise(TypeError)
      rg.lighten!
      test[rg.lighten].should == rg
    }
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rest-graph-1.5.0 test/test_serialize.rb
rest-graph-1.4.6 test/test_serialize.rb