crude-mutant 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 19c815febd49e6c18227d79fb6bbfa5631daffd774815f463b03d6a388477977
4
- data.tar.gz: 37a01fd449bb4f6936b6339a8a4a67f01e5361420a1071964f0f5df4fbac8937
3
+ metadata.gz: e1d22dde8953db74b48cd4c0bca71e803d4c5fbf490638a7e13b8c5a84d4d03f
4
+ data.tar.gz: b0e0d539020fd0cc2cd76d84ebf1e09b7cdb2533fd546b3a528efbdc2544f16e
5
5
  SHA512:
6
- metadata.gz: 51e74c6a4b27d632a04773826254ed7bf66467761ba989a6c8a7183fe42e016603d416cd15f7503e63b93533a1c2267350c6fbcb26159d880cadbf9d2589d77b
7
- data.tar.gz: e59ec07800f047ae6f676d358ee2605597617a58a945644feb77376e670c3d19b82848d7e1924f252d5d86532974306295b13dc5c3a5e3215689a383a9df24aa
6
+ metadata.gz: 7d396763825de1a0dd548365d3bb3baa26a35832f777de6553b2dab1d89fe1ecd11fc6d527e1d23253242c7540f5dad0278f62cf4484f8953946738509dca68d
7
+ data.tar.gz: 6e113726b3e9dcd783e01ec188012fca59316d8b6ae5d644d2f4de01867876ec5e2b71f27dcd432609edd73e535e7dd99f7eda4710f50824f47970de66e46336
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- crude-mutant (0.4.0)
4
+ crude-mutant (0.5.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/exe/cm CHANGED
@@ -11,6 +11,8 @@ Options = Struct.new(
11
11
  :use_json_printer,
12
12
  :section,
13
13
  :section_total,
14
+ :test_command,
15
+ :file_to_mutate,
14
16
  )
15
17
 
16
18
  args = Options.new(false, 1, 1)
@@ -28,6 +30,14 @@ OptionParser.new do |opts|
28
30
  opts.on("-sSECTION_TOTAL", "--name=SECTION_TOTAL", "Number of total sectionswhen parallelizing") do |s|
29
31
  args.section_total = s
30
32
  end
33
+
34
+ opts.on("-cTEST_COMMAND", "--name=TEST_COMMAND", "Test command to run") do |t|
35
+ args.test_command = t
36
+ end
37
+
38
+ opts.on("-fFILE_TO_MUTATE", "--file=FILE_TO_MUTATE", "File to mutate for each run") do |t|
39
+ args.file_to_mutate = t
40
+ end
31
41
  end.parse!
32
42
 
33
43
  if !file_to_mutate || !test_command
@@ -41,9 +51,9 @@ end
41
51
  printer = args.use_json_printer ? :json : :standard
42
52
 
43
53
  if printer == :json
44
- CrudeMutant.start(file_to_mutate, test_command, result_printer: printer, section: args.section, total_sections: args.section_total)
54
+ CrudeMutant.start(args.file_to_mutate, args.test_command, result_printer: printer, section: args.section, total_sections: args.section_total)
45
55
  else
46
- CrudeMutant.start(file_to_mutate, test_command, result_printer: printer, section: args.section, total_sections: args.section_total) do |progress|
56
+ CrudeMutant.start(args.file_to_mutate, args.test_command, result_printer: printer, section: args.section, total_sections: args.section_total) do |progress|
47
57
  clear_string = ' ' * CrudeMutant::TerminalCalculator.new.calculate_length
48
58
  $stdout.print clear_string
49
59
  $stdout.print "\r"
data/exe/crude-mutant CHANGED
@@ -4,18 +4,17 @@
4
4
  require "crude-mutant"
5
5
  require "optparse"
6
6
 
7
- file_to_mutate = ARGV.pop
8
- test_command = ARGV.pop
9
-
10
7
  Options = Struct.new(
11
8
  :use_json_printer,
12
9
  :section,
13
10
  :section_total,
11
+ :test_command,
12
+ :file_to_mutate,
14
13
  )
15
14
 
16
15
  args = Options.new(false, 1, 1)
17
16
  OptionParser.new do |opts|
18
- opts.banner = "Usage: crude-mutant [options] [test command] [file to mutate]"
17
+ opts.banner = "Usage: crude-mutant [options]"
19
18
 
20
19
  opts.on("-j", "--json", "Print JSON out to STDOUT") do |v|
21
20
  args.use_json_printer = v
@@ -28,22 +27,30 @@ OptionParser.new do |opts|
28
27
  opts.on("-sSECTION_TOTAL", "--name=SECTION_TOTAL", "Number of total sectionswhen parallelizing") do |s|
29
28
  args.section_total = s
30
29
  end
30
+
31
+ opts.on("-cTEST_COMMAND", "--test_command=TEST_COMMAND", "Test command to run") do |t|
32
+ args.test_command = t
33
+ end
34
+
35
+ opts.on("-fFILE_TO_MUTATE", "--file=FILE_TO_MUTATE", "File to mutate for each run") do |t|
36
+ args.file_to_mutate = t
37
+ end
31
38
  end.parse!
32
39
 
33
- if !file_to_mutate || !test_command
34
- puts "Usage: crude-mutant [test command] [file to mutate]"
40
+ if !args.file_to_mutate || !args.test_command
41
+ puts "Usage: crude-mutant [options]"
35
42
  puts ""
36
43
  puts "Example:"
37
- puts " crude-mutant \"bundle exec rspec\" app/models/post.rb"
44
+ puts " crude-mutant --test_command=\"bundle exec rspec\" --file=app/models/post.rb"
38
45
  exit(1)
39
46
  end
40
47
 
41
48
  printer = args.use_json_printer ? :json : :standard
42
49
 
43
50
  if printer == :json
44
- CrudeMutant.start(file_to_mutate, test_command, result_printer: printer, section: args.section, total_sections: args.section_total)
51
+ CrudeMutant.start(args.file_to_mutate, args.test_command, result_printer: printer, section: args.section, total_sections: args.section_total)
45
52
  else
46
- CrudeMutant.start(file_to_mutate, test_command, result_printer: printer, section: args.section, total_sections: args.section_total) do |progress|
53
+ CrudeMutant.start(args.file_to_mutate, args.test_command, result_printer: printer, section: args.section, total_sections: args.section_total) do |progress|
47
54
  clear_string = ' ' * CrudeMutant::TerminalCalculator.new.calculate_length
48
55
  $stdout.print clear_string
49
56
  $stdout.print "\r"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CrudeMutant
4
- VERSION = "0.4.0"
4
+ VERSION = "0.5.0"
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.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kelly Sutton