README.md in api-tester-0.3.0 vs README.md in api-tester-0.3.1

- old
+ new

@@ -6,10 +6,13 @@ for prime time! To isolate your project from the changes, be sure to specify which gem version you use. This gem is intended to enable easy creation of tests for RESTful API services when given a contract. +When using, be sure to follow the documentation for the version of the gem you use. The documentation below +relates to the unpublished gem version actively under development + Check out [API Tester Example](https://github.com/araneforseti/example_api-tester) for an example in action # Feature Plan ## Under Development Check out our [Trello Board](https://trello.com/b/R3RtsJ2A/api-tester) to see progress and where we are headed! @@ -71,13 +74,13 @@ understanding the contract will change until the first stable release Define your contract and endpoints using ```ruby -require 'api-tester/definition/api_contract' +require 'api-tester/definition/contract' require 'api-tester/definition/endpoint' -contract = ApiTester::ApiContract.new "API Name" +contract = ApiTester::Contract.new "API Name" endpoint = ApiTester::Endpoint.new "Some name which is currently unused", "http://yourbase.com/api/endpoint" ``` Define methods on endpoints @@ -106,11 +109,11 @@ ```ruby request = ApiTester::Request.new.add_field(ApiTester::Field.new "fieldName") expected_response = ApiTester::Response.new(200).add_field(ApiTester::Field.new "fieldName") endpoint = ApiTester::Endpoint.new "Unused Name", "http://yourbase.com/api/endpoint" endpoint.add_method ApiTester::SupportedVerbs::GET, expected_response, request -contract = ApiContract.new "API Name" +contract = Contract.new "API Name" contract.add_endpoint endpoint config = ApiTester::Config().with_module(Format.new) expect(ApiTester.go(contract, config)).to be true ``` @@ -167,30 +170,33 @@ ## Custom Modules Do you want to do something with the definition which this gem currently does not support? You can create your own test module and add it to the config instance class! Just make sure it adheres to the following interface: ```ruby -module Name - def self.go contract, reports - # Your test code here - the reports object is where the reports are all stored +module CustomModule + def self.go contract + # Your test code here + # the contract object is the full definition created end def self.order # If your module needs to run first, put 0, if last, put 100. # Otherwise this can just be any number end end + +config.with_module(CustomModule) ``` # Reporting Right now the default reporting mechanism prints out to the console all the issues which were found. You can create your own reporting class (so long as it responds to the same methods) or just extend the current one and -override the print method. Then set the tester's report -tool: +override the print method. Then set the report +tool in the config: ```ruby -tester.with_reporter(new_reporter) +config.with_reporter(new_reporter) ``` # Development After checking out the repo, run `bin/setup` to install