Basic functionality via minitest

This commit is contained in:
domaindrivendev
2016-02-16 17:32:05 -08:00
parent 007b82a9e4
commit f9225a8a22
12 changed files with 445 additions and 14 deletions

View File

@@ -0,0 +1,25 @@
require 'swagger_rails/testing/example_builder'
module SwaggerRails
class TestVisitor
def initialize(swagger)
@swagger = swagger
end
def run_test(path_template, http_method, test, &block)
example = ExampleBuilder.new(path_template, http_method, @swagger)
example.instance_exec(&block) if block_given?
test.send(http_method,
example.path,
example.params,
example.headers
)
test.assert_response(example.expected_status)
end
end
end