Sha256: cfed081eb5690cb61462ef022a171ab5758279fdfe5baeab0701613bb2632535
Contents?: true
Size: 749 Bytes
Versions: 16
Compression:
Stored size: 749 Bytes
Contents
require "spec_helper" describe "Marshaling of ApiClient objects" do ConnectionProc = Proc.new {} AlwaysProc = Proc.new {} class Entity < ApiClient::Base connection &ConnectionProc always &AlwaysProc def mutated_state? @state == "mutated" end def mutate_state! @state = "mutated" end end it "is marshallable by default" do scope = Entity.params(:foo => 1).headers("token" => "aaa").options("some" => "option") entity = scope.build :key => "value" entity.mutated_state?.should == false entity.mutate_state! entity.mutated_state?.should == true reloaded = Marshal.load(Marshal.dump(entity)) reloaded.should == entity reloaded.mutated_state?.should == true end end
Version data entries
16 entries across 16 versions & 1 rubygems