This repository has been archived by the owner on Jun 27, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Now including antivirus tests on Travis.
Fixed bug in AF::Datastream decorator Removed `installed?' method from Antivirus module Factored out FileContentDatastream tests into new spec module Load antivirus service in DulHydra initializer
- Loading branch information
1 parent
d1d3ee6
commit 0de78a6
Showing
10 changed files
with
83 additions
and
56 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,18 @@ | ||
language: ruby | ||
before_install: | ||
- sudo apt-get update -qq | ||
- sudo apt-get install -qq clamav | ||
- sudo freshclam -v | ||
rvm: | ||
- 2.0.0 | ||
before_script: | ||
- "cp config/log4r.yml.sample config/log4r.yml" | ||
bundler_args: --without development production --deployment | ||
cache: bundler | ||
script: "bundle exec rake dul_hydra:ci:build" | ||
notifications: | ||
email: | ||
- [email protected] | ||
# To exclude antivirus tests: | ||
# env: | ||
# - SPEC_OPTS="--tag ~antivirus" | ||
# bundler_args: --without development production --deployment |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,3 +55,5 @@ | |
end | ||
|
||
Blacklight::Configuration.default_values[:http_method] = :post | ||
|
||
DulHydra::Services::Antivirus.load! |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module DulHydra | ||
module Datastreams | ||
module AntivirusBehavior | ||
|
||
end | ||
end | ||
end |
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
require 'spec_helper' | ||
require 'tempfile' | ||
|
||
describe DulHydra::Datastreams::FileContentDatastream do | ||
let(:obj) { FileContentObject.create } | ||
let(:pid_prefix) { obj.pid.sub(':', '_') } | ||
let(:ds) { obj.datastreams['content'] } | ||
before(:all) do | ||
class FileContentObject < ActiveFedora::Base | ||
has_file_datastream name: 'content', type: DulHydra::Datastreams::FileContentDatastream | ||
end | ||
end | ||
before(:each) do | ||
obj.content.content = fixture_file_upload("library-devil.tiff", "image/tiff") | ||
obj.save! | ||
end | ||
after(:each) { ActiveFedora::Base.destroy_all } | ||
after(:all) { Object.send(:remove_const, :FileContentObject) } | ||
it "should have a default file prefix, file extension, and file name" do | ||
expect(ds.default_file_prefix).to eq("#{pid_prefix}_content") | ||
expect(ds.default_file_extension).to eq("tiff") | ||
expect(ds.default_file_name).to eq("#{pid_prefix}_content.tiff") | ||
end | ||
context "#write_content" do | ||
it "should write the content to a file" do | ||
Tempfile.new('content', :encoding => 'ascii-8bit') do |tmpfile| | ||
tmppath = tmpfile.path | ||
ds.write_content(tmpfile) | ||
ds.size.should == File.size(tmppath) | ||
end | ||
end | ||
end | ||
end |
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
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