Sha256: 04db6f4d6ed0126db2795258e26e0e0779cc07159a51c442ba768efc992f1dc2
Contents?: true
Size: 867 Bytes
Versions: 13
Compression:
Stored size: 867 Bytes
Contents
require 'spec_helper' class MagicResource extend NSConnector::Attaching def initialize upstream_store end def self.type_id 'magic' end end class MagicTarget extend NSConnector::Attaching def initialize upstream_store end def self.type_id 'target' end end describe NSConnector::Attaching do it 'attach! works' do NSConnector::Restlet.should_receive(:execute!).with({ :action => 'attach', :type_id => 'magic', :target_type_id => 'target', :attachee_id => 42, :data => [1,2,3], :attributes => nil, }) MagicResource.attach!(MagicTarget, 42, [1,2,3]) end it 'detach! works' do NSConnector::Restlet.should_receive(:execute!).with({ :action => 'detach', :type_id => 'magic', :target_type_id => 'target', :attachee_id => 42, :data => [1,2,3] }) MagicResource.detach!(MagicTarget, 42, [1,2,3]) end end
Version data entries
13 entries across 13 versions & 1 rubygems