summaryrefslogtreecommitdiff
path: root/Rakefile
blob: 5e23751a2cebd18a83a8fed6a5584f83829a197c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
require 'rubygems'
require 'opentox-ruby'

if File.exists? "auth.rb"
  require "auth"
else
  #exit "Please create an authenticatio
    TEST_USER = "guest"
    TEST_PW   = "guest"
end

task ARGV[0] do
  puts "Environment: #{ENV["RACK_ENV"]}"
  puts "Test: "+ARGV[0]+".rb"
  require "./"+ARGV[0]+".rb"
end

task :setup do
  @@subjectid = OpenTox::Authorization.authenticate(TEST_USER,TEST_PW) 
  @@classification_training_dataset = OpenTox::Dataset.create_from_csv_file("data/hamster_carcinogenicity.csv", @@subjectid)
  @@regression_training_dataset = OpenTox::Dataset.create_from_csv_file("data/EPAFHM.csv", @@subjectid)
end

task :teardown do
  @@classification_training_dataset.delete(@@subjectid)
  @@regression_training_dataset.delete(@@subjectid)
  OpenTox::Authorization.logout(@@subjectid)
end

class Exception
  def message
   errorCause ? errorCause.to_yaml : to_s
  end
end

[:all, :feature, :dataset, :fminer, :lazar, :authorization].each do |t|
  task :teardown => t
  task t => :setup 
end