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 +4 -4
- data/Gemfile.lock +1 -1
- data/bin/console +1 -1
- data/lib/crude_mutant.rb +4 -1
- data/lib/crude_mutant/result.rb +3 -2
- data/lib/crude_mutant/result_printer.rb +1 -1
- data/lib/crude_mutant/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3078bc639db1c38af71a60a4fed4952abf1cca8e1ede5b0eb810bfe58b5f6a8b
|
4
|
+
data.tar.gz: ae8c6c18e1b85079366c5a0917ec2a3676cb11d66ed1281ef319559870bc6c45
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ea20b86bf343acb971dbbb9b24a569e6e1297a62937da58471bd3a10f88b2c634a903af9509e8ff48db248ecd507436349278075a09d019cb461d69a0a6f0903
|
7
|
+
data.tar.gz: e654d94165e1ca67c5357f62fe99bfc2789b7af02963e37557dbdbe489f0a76ba50b420f426f2eac541c5a96f0453e8106cba55c094dfc1b7c57a62779f401fe
|
data/Gemfile.lock
CHANGED
data/bin/console
CHANGED
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
|
|
data/lib/crude_mutant/result.rb
CHANGED
@@ -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
|
|
data/lib/crude_mutant/version.rb
CHANGED