Created
September 17, 2013 22:58
-
-
Save palexander/6601843 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
require 'rack' | |
class TestPull < LinkedData::TestCase | |
def self.before_suite | |
# CREATE FILE OBJECT: | |
file = File.new("../some/file.owl") | |
@@thread = Thread.new do | |
Rack::Server.start( | |
app: lambda do |e| | |
[200, {'Content-Type' => 'text/plain'}, [file.read]] | |
end, | |
Port: 4567 | |
) | |
end | |
end | |
def self.after_suite | |
Thread.kill(@@thread) | |
end | |
def test_pull | |
os = LinkedData::Models::OntologySubmission.new({ | |
ontology: o, | |
hasOntologyLanguage: @of, | |
pullLocation: RDF::IRI.new("http://localhost:4567/"), | |
submissionId: o.next_submission_id, | |
contact: [@contact], | |
released: DateTime.now - 5 | |
}) | |
os.save | |
orig_file = File.new(os.uploadFilePath) | |
pull_file, filename = os.download_ontology_file | |
compare_md5(orig_file, pull_file) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment