Class: ResponseJsonSyntaxChecker
- Defined in:
- lib/plugins/plug01_response_json_syntax_checker.rb
Instance Method Summary collapse
-
#check ⇒ Object
checks if the given testcase body represents syntactically valid JSON.
Methods inherited from Checker
available_plugins, #initialize
Constructor Details
This class inherits a constructor from Checker
Instance Method Details
#check ⇒ Object
checks if the given testcase body represents syntactically valid JSON
4 5 6 7 8 9 10 11 |
# File 'lib/plugins/plug01_response_json_syntax_checker.rb', line 4 def check result = Result.new(@testcase, @response) if not valid_json?(@response.body) result.succeeded = false result. = "expected valid JSON in body\n got --#{@response.body[1..400]}-- #{@response.body.class}" end result end |