crude-mutant 0.2.2 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 30c70ccce932ab3310d011413c98acd642aa980de6b6ffd188b2ad76ab524122
4
- data.tar.gz: 0f40c8889e26dc985309775435efaa3cd6c920deefd655bf221ec445200f5adb
3
+ metadata.gz: 3078bc639db1c38af71a60a4fed4952abf1cca8e1ede5b0eb810bfe58b5f6a8b
4
+ data.tar.gz: ae8c6c18e1b85079366c5a0917ec2a3676cb11d66ed1281ef319559870bc6c45
5
5
  SHA512:
6
- metadata.gz: fe717c339d38bba664d6f0482453563dc313f81f118096edd75bf17a757d48b57d1bc49eca112ffe2d2ed24339d291e5de61cc4a4c7691f3b788c378c5ab3486
7
- data.tar.gz: 13635ad04411c19140c8ac3c37e93fd9bab5d002381ba8bd77e15938b6006afe51474948aec8e8ae2a1ed2b1026b79baa69145a4bdcc538c367f46d8c3ac2244
6
+ metadata.gz: ea20b86bf343acb971dbbb9b24a569e6e1297a62937da58471bd3a10f88b2c634a903af9509e8ff48db248ecd507436349278075a09d019cb461d69a0a6f0903
7
+ data.tar.gz: e654d94165e1ca67c5357f62fe99bfc2789b7af02963e37557dbdbe489f0a76ba50b420f426f2eac541c5a96f0453e8106cba55c094dfc1b7c57a62779f401fe
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- crude-mutant (0.2.2)
4
+ crude-mutant (0.2.3)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/bin/console CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  require "bundler/setup"
4
- require "crude/mutant"
4
+ require "crude-mutant"
5
5
 
6
6
  # You can add fixtures and/or initialization code here to make experimenting
7
7
  # with your gem easier. You can also use a different console, if you like.
data/lib/crude_mutant.rb CHANGED
@@ -18,6 +18,7 @@ module CrudeMutant
18
18
 
19
19
  class << self
20
20
  def start(file_path, test_command, &block)
21
+ start_time = Time.now.to_f
21
22
  file = FileLoader.load(file_path)
22
23
  num_lines_in_file = file.lines_in_file
23
24
 
@@ -57,8 +58,10 @@ module CrudeMutant
57
58
  FileWriter.write(file_path, file.contents_as_array)
58
59
  end
59
60
 
61
+ stop_time = Time.now.to_f
62
+ total_time = stop_time - start_time
60
63
  ResultPrinter.print(
61
- Result.new(file_path, test_runs)
64
+ Result.new(file_path, test_runs, total_time)
62
65
  )
63
66
  end
64
67
 
@@ -2,11 +2,12 @@
2
2
 
3
3
  module CrudeMutant
4
4
  class Result
5
- attr_reader :file_path, :run_results
5
+ attr_reader :file_path, :run_results, :total_time
6
6
 
7
- def initialize(file_path, run_results)
7
+ def initialize(file_path, run_results, total_time)
8
8
  @file_path = file_path
9
9
  @run_results = run_results
10
+ @total_time = total_time
10
11
  end
11
12
 
12
13
  def successful_runs_even_with_mutations
@@ -29,7 +29,7 @@ module CrudeMutant
29
29
  end
30
30
 
31
31
  stream.print "\n"
32
- stream.print "Finished mutating #{result.file_path}. ^^^ Results above ^^^\n"
32
+ stream.print "Finished mutating #{result.file_path} in #{result.total_time.round(2)} seconds. ^^^ Results above ^^^\n"
33
33
  stream.print "Performed #{result.run_results.size} line mutations in total.\n"
34
34
  stream.print "There are #{red(result.successful_runs_even_with_mutations.size)} #{red('problematic lines')}:\n"
35
35
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CrudeMutant
4
- VERSION = "0.2.2"
4
+ VERSION = "0.2.3"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: crude-mutant
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kelly Sutton