Skip to content

Commit

Permalink
Added console rake task for testing. Added VTFile test for scan uploa…
Browse files Browse the repository at this point in the history
…d - this adds a GET request to the tests which did not previously exist.
  • Loading branch information
jporter-dev committed Oct 26, 2017
1 parent d8c2eb9 commit 2bf57c0
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Rakefile
Expand Up @@ -49,6 +49,14 @@ task :clean do
system "rm -rf coverage"
end

task :console do
require 'irb'
require 'irb/completion'
require 'uirusu' # You know what to do.
ARGV.clear
IRB.start
end

task :default => [:test]

Rake::TestTask.new("test") do |t|
Expand Down
11 changes: 11 additions & 0 deletions test/functional/vtfile_test.rb
Expand Up @@ -54,6 +54,17 @@ def test_return_XX_results_for_hash_FD287794107630FA3116800E617466A9
assert_equal 55, result.results.size
end

def test_return_scan_upload_url
if @app_test.config.empty? || @app_test.config['virustotal']['api-key'] == nil
skip
end

#return a JSON response containing an upload URL
result = Uirusu::VTFile.scan_upload_url @app_test.config['virustotal']['api-key']

assert_includes result.keys, "upload_url"
end

def test_return_additional_info_for_hash_FD287794107630FA3116800E617466A9
# Skip the test if we dont have a API key
if @app_test.config.empty? || @app_test.config['virustotal']['api-key'] == nil || !@app_test.config['virustotal']['private']
Expand Down

0 comments on commit 2bf57c0

Please sign in to comment.