class Crispr::Runner
def self.run_mutation(path:, mutated_source:)
-
(Boolean)
- true if the mutation was killed (test suite failed), false otherwise
Parameters:
-
mutated_source
(String
) -- the mutated version of the file's source code -
path
(String
) -- the path to the source file to mutate
def self.run_mutation(path:, mutated_source:) original_source = File.read(path) begin File.write(path, mutated_source) stdout, stderr, status = Open3.capture3("bundle exec rspec") killed = !status.success? puts stdout unless status.success? puts stderr unless status.success? killed ensure File.write(path, original_source) end end