From ea9878f86215487aa8f84495f96b3d235aa3dc93 Mon Sep 17 00:00:00 2001 From: Markus Schirp Date: Fri, 3 Jul 2015 15:25:50 +0000 Subject: [PATCH] Remove dead support code * The mutation verification is done by a Mutant::Meta feature --- spec/support/mutation_verifier.rb | 96 ------------------------------- 1 file changed, 96 deletions(-) delete mode 100644 spec/support/mutation_verifier.rb diff --git a/spec/support/mutation_verifier.rb b/spec/support/mutation_verifier.rb deleted file mode 100644 index 7e69aafa..00000000 --- a/spec/support/mutation_verifier.rb +++ /dev/null @@ -1,96 +0,0 @@ -class MutationVerifier - include Adamantium::Flat, Concord.new(:original_node, :expected, :generated) - - # Test if mutation was verified successfully - # - # @return [Boolean] - # - # @api private - # - def success? - unparser.success? && missing.empty? && unexpected.empty? - end - - # Return error report - # - # @return [String] - # - # @api private - # - def error_report - unless unparser.success? - return unparser.report - end - mutation_report - end - -private - - # Return unexpected mutations - # - # @return [Array] - # - # @api private - # - def unexpected - generated - expected - end - memoize :unexpected - - # Return mutation report - # - # @return [String] - # - # @api private - # - # rubocop:disable AbcSize - # - def mutation_report - message = ['Original-AST:', original_node.inspect, 'Original-Source:', Unparser.unparse(original_node)] - if missing.any? - message << 'Missing mutations:' - message << missing.map(&method(:format_mutation)).join("\n-----\n") - end - if unexpected.any? - message << 'Unexpected mutations:' - message << unexpected.map(&method(:format_mutation)).join("\n-----\n") - end - message.join("\n======\n") - end - - # Format mutation - # - # @return [String] - # - # @api private - # - def format_mutation(node) - [ - node.inspect, - Unparser.unparse(node) - ].join("\n") - end - - # Return missing mutations - # - # @return [Array] - # - # @api private - # - def missing - expected - generated - end - memoize :missing - - # Return unparser verifier - # - # @return [Unparser::CLI::Source] - # - # @api private - # - def unparser - Unparser::CLI::Source::Node.new(Unparser::Preprocessor.run(original_node)) - end - memoize :unparser - -end # MutationVerifier