Skip to content

Instantly share code, notes, and snippets.

@palexander
Created September 17, 2013 22:58
Show Gist options
  • Save palexander/6601843 to your computer and use it in GitHub Desktop.
Save palexander/6601843 to your computer and use it in GitHub Desktop.
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