lib/daigaku/test_result.rb in daigaku-0.0.2 vs lib/daigaku/test_result.rb in daigaku-0.1.0

- old
+ new

@@ -3,12 +3,10 @@ class TestResult require 'json' attr_reader :examples, :example_count, :failure_count - TEST_PASSED_MESSAGE = "Your code passed all tests. Congratulations!" - def initialize(result_json) @result = begin JSON.parse(result_json, symbolize_names: true) rescue syntax_error_json @@ -33,13 +31,17 @@ end end def summary if passed? - TEST_PASSED_MESSAGE + "Your code passed all tests. #{Daigaku::Congratulator.message}" else build_failed_summary end + end + + def summary_lines + summary.lines.map(&:strip) end private def build_failed_summary