Class: OnlyofficeRspecResultParser::ResultParser
- Inherits:
-
Object
- Object
- OnlyofficeRspecResultParser::ResultParser
- Defined in:
- lib/onlyoffice_rspec_result_parser/rspec_result_parser.rb
Overview
Class with stored data about rspec result
Class Attribute Summary collapse
-
.example_index ⇒ Object
Returns the value of attribute example_index.
Class Method Summary collapse
-
.get_failed_cases_count_from_html(html_path) ⇒ Integer
Get failed count.
-
.get_total_result_of_rspec_html(html_path) ⇒ Integer
Get total case count.
-
.parse_metadata(file) ⇒ RspecResult
Result of parsing.
-
.parse_rspec_html(html_path) ⇒ Object
(also: parse_rspec_html_string)
Parse rspec html.
-
.parse_test_result(page, with_describe_info: true) ⇒ RspecResult
Result of parsing.
Class Attribute Details
.example_index ⇒ Object
Returns the value of attribute example_index.
18 19 20 |
# File 'lib/onlyoffice_rspec_result_parser/rspec_result_parser.rb', line 18 def example_index @example_index end |
Class Method Details
.get_failed_cases_count_from_html(html_path) ⇒ Integer
Get failed count
40 41 42 43 44 45 46 |
# File 'lib/onlyoffice_rspec_result_parser/rspec_result_parser.rb', line 40 def get_failed_cases_count_from_html(html_path) page = Nokogiri::HTML(read_file(html_path)) result = RspecResult.new(page).parse_page return 0 unless result.valid_html? result.failed_count end |
.get_total_result_of_rspec_html(html_path) ⇒ Integer
Get total case count
51 52 53 54 55 56 57 |
# File 'lib/onlyoffice_rspec_result_parser/rspec_result_parser.rb', line 51 def get_total_result_of_rspec_html(html_path) page = Nokogiri::HTML(read_file(html_path)) result = RspecResult.new(page).parse_page return '' unless result.valid_html? result.total end |
.parse_metadata(file) ⇒ RspecResult
Returns result of parsing.
30 31 32 33 |
# File 'lib/onlyoffice_rspec_result_parser/rspec_result_parser.rb', line 30 def (file) page = Nokogiri::HTML(read_file(file)) parse_test_result(page, with_describe_info: false) end |
.parse_rspec_html(html_path) ⇒ Object Also known as: parse_rspec_html_string
Parse rspec html
23 24 25 26 |
# File 'lib/onlyoffice_rspec_result_parser/rspec_result_parser.rb', line 23 def parse_rspec_html(html_path) page = Nokogiri::HTML(read_file(html_path)) parse_test_result(page) end |
.parse_test_result(page, with_describe_info: true) ⇒ RspecResult
Returns result of parsing.
63 64 65 66 |
# File 'lib/onlyoffice_rspec_result_parser/rspec_result_parser.rb', line 63 def parse_test_result(page, with_describe_info: true) ResultParser.example_index = 0 RspecResult.new(page).parse_page(with_describe_info: with_describe_info) end |