Created
March 5, 2012 19:34
-
-
Save wmene/1980535 to your computer and use it in GitHub Desktop.
assembly modules
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Dor | |
module Itemizable | |
attr_accessor :cm | |
def persist_content_md | |
... | |
end | |
end | |
end | |
module Dor | |
module Checksumable | |
include Itemizable | |
def compute_checksums_new | |
@cm | |
file_nodes = content_metadata.xpath(......) | |
file_nodes.each|| | |
end | |
end | |
end | |
module Dor | |
class AssemblyItem | |
include Dor::Itemizable | |
include Dor::Checksumable | |
end | |
end | |
# in spec/dor/checksumable_spec.rb | |
class ChecksumItem | |
include Dor::Checksumable | |
end | |
describe Checksumable | |
desc '#compute_checksums_new' | |
it 'computes new checksums' | |
item = ChecksumItem.new | |
item.cm = Nokogiri::Xml('<contentMetadata .....>') | |
item.compute_checksum | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment