Skip to content
Permalink
Browse files

Add a basic test of /validators

  • Loading branch information
iay committed May 23, 2018
1 parent 23a6fef commit f9fb1ac40174bc32c2c66ad86931031ae5726659
Showing with 36 additions and 1 deletion.
  1. +1 −1 Gemfile.lock
  2. +14 −0 Rakefile
  3. +9 −0 lib/get_api.rb
  4. +12 −0 test/test_get_validators.rb
@@ -1,7 +1,7 @@
PATH
remote: ../inc-validator-client-ruby
specs:
inc-validator-client (1.0.0)
inc-validator-client (1.0.1)
json (~> 2.1, >= 2.1.0)
typhoeus (~> 1.0, >= 1.0.1)
@@ -1,3 +1,17 @@
task :cop do
system 'bundle exec rubocop'
end

def runTest(s)
puts "Running test #{s}."
system "bundle exec ruby -I lib test/test_#{s}.rb"
puts 'Done.'
end

task :test_get_validators do
runTest 'get_validators'
end

task :default => %[test_get_validators] do
puts 'All tests done.'
end
@@ -0,0 +1,9 @@
require 'inc-validator-client'

ValidatorClient.configure do |config|
config.host = 'localhost:8080'
end

def getApi()
ValidatorClient::ValidationApi.new
end
@@ -0,0 +1,12 @@
require 'get_api'

begin
# lists available validators
result = getApi().get_validators
puts "Validators detected: #{result.length}"
result.each do |val|
puts " #{val.validator_id}: #{val.description}"
end
rescue ValidatorClient::ApiError => e
puts "Exception when calling ValidationApi->get_validators: #{e}"
end

0 comments on commit f9fb1ac

Please sign in to comment.
You can’t perform that action at this time.