minitest-sprint 1.0.0 → 1.1.0

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
  SHA1:
3
- metadata.gz: dac4be94f52606b2b9b7525fd720a79944af2daf
4
- data.tar.gz: 7dd38463d9b03efedf75c82a37b0d8158b33d52b
3
+ metadata.gz: 39fd43af973b488a096f56c1aa32a3a8584be410
4
+ data.tar.gz: 0064c58eb738f8c218f4f8664d11c609b7ca733b
5
5
  SHA512:
6
- metadata.gz: 4c367395bda1d3cc9c33ffdffc79ca13d3418aff5743db650244d2aec69376463091debbbcda3b6c597654347c0aaae315447655e715db6345e3fb6d36387992
7
- data.tar.gz: 735acfe4195ab89049c711eb08e2e4fa3c4fd4df1bf91ee0ee7fbbd9fb56c2bcfc407fbea36fe08551dc4099158495d5353ca72ec9ede6d083cf631cab27d87f
6
+ metadata.gz: c8adb465087c6f2633052ececb5c2817af17fec07e96c9f637c448fbb369be76f42603fa9cdd52acadea9fbbfc518e3dcaa8f6f3b8996e5ba08997f4d5ad03c3
7
+ data.tar.gz: e4e2b0e2876dc4d7474a5e02a669f7d4cda0bc7c5ea27560774c3070abe4b9d3307297d9bcd2ce37bd28ed2bc23a5eedcf11a760c60366019e6f7fd3ef914600
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -1,3 +1,10 @@
1
+ === 1.1.0 / 2015-03-09
2
+
3
+ * 2 minor enhancements:
4
+
5
+ * Added minitest/complete for cmdline test name completion. (tenderlove)
6
+ * bin/minitest now directly loads tests, supports specifying files and minitest args.
7
+
1
8
  === 1.0.0 / 2015-01-23
2
9
 
3
10
  * 1 major enhancement
@@ -5,6 +5,7 @@ README.rdoc
5
5
  Rakefile
6
6
  bin/minitest
7
7
  lib/minitest/binstub_reporter.rb
8
+ lib/minitest/complete.rb
8
9
  lib/minitest/rake_reporter.rb
9
10
  lib/minitest/sprint.rb
10
11
  lib/minitest/sprint_plugin.rb
@@ -8,14 +8,38 @@ rdoc :: http://docs.seattlerb.org/minitest-sprint
8
8
  Runs (Get it? It's fast!) your tests and makes it easier to rerun individual
9
9
  failures.
10
10
 
11
+ === Tab Completion
12
+
13
+ Add this to your .bashrc (or .zshrc?--someone please confirm with a PR):
14
+
15
+ $ complete -o bashdefault -f -C 'ruby --disable-gems $(gem which minitest/complete)' minitest
16
+
17
+ Running individual minitest tests will now have tab completion for the
18
+ method names. When running tests, just hit tab after -n. For example:
19
+
20
+ $ minitest test/test_whatever.rb -n test_thingy<TAB><TAB>
21
+ test_thingy_error
22
+ test_thingy_error_teardown
23
+ test_thingy_failing
24
+ test_thingy_failing_filtered
25
+ ... etc ...
26
+
11
27
  == FEATURES/PROBLEMS:
12
28
 
13
- * TEENY implementation. Probably too TEENY.
14
- * bin/minitest's implementation is currently tongue-in-cheek. PR's welcome.
29
+ * TEENY implementation.
30
+ * Includes a script for commandline autocompletion of test names.
31
+ * Includes extra plugins to print out failure re-run commands.
32
+ * One for the minitest commandline runner. (--binstub)
33
+ * One for rake test runners. (--rake)
15
34
 
16
35
  == SYNOPSIS:
17
36
 
18
- % minitest
37
+ $ minitest test/test_whatever.rb -n test_thingy<TAB><TAB>
38
+ test_thingy_error
39
+ test_thingy_error_teardown
40
+ test_thingy_failing
41
+ test_thingy_failing_filtered
42
+ ... etc ...
19
43
 
20
44
  == REQUIREMENTS:
21
45
 
@@ -1,9 +1,15 @@
1
1
  #!/usr/bin/ruby -w
2
2
 
3
- # yes, this is mostly tongue in cheek. If you want it to do more, improve it.
3
+ $:.unshift "test"
4
+ $:.unshift "lib"
4
5
 
5
- if ARGV.empty? then
6
- exec "rake"
7
- else
8
- exec "rake N=\"#{ARGV.first}\" #{ARGV[1..-1].join " "}"
6
+ require "minitest/autorun"
7
+
8
+ files, args = ARGV.partition { |f| File.exist? f }
9
+ files = Dir["test/**/{test_*,*_test}.rb"] if files.empty?
10
+
11
+ ARGV.replace args
12
+
13
+ files.each do |f|
14
+ require "./#{f}"
9
15
  end
@@ -4,7 +4,7 @@ module Minitest
4
4
  class BinstubReporter < SprintReporter
5
5
  def print_list
6
6
  results.each do |result|
7
- puts " minitest #{result.class}##{result.name}"
7
+ puts " minitest -n #{result.class}##{result.name}"
8
8
  end
9
9
  end
10
10
  end
@@ -0,0 +1,35 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # see instructions in the readme for use
4
+
5
+ require 'optparse'
6
+ require 'shellwords'
7
+
8
+ argv = Shellwords.split(ENV['COMP_LINE']).drop 1
9
+ options = {}
10
+
11
+ begin
12
+ OptionParser.new do |opts|
13
+ opts.on("-n", "--name [METHOD]", "Test method") do |m|
14
+ options[:method] = m
15
+ end
16
+ end.parse!(argv)
17
+ rescue
18
+ retry # ignore options passed to Ruby
19
+ end
20
+
21
+ file = argv.find { |f| File.file?(f) && !File.directory?(f) }
22
+
23
+ exit unless options.key?(:method) && file
24
+
25
+ require 'ripper'
26
+
27
+ methods = []
28
+ K = Class.new(Ripper) { define_method(:on_def) { |n,_,_| methods << n } }
29
+
30
+ begin
31
+ K.parse File.read(file), file, 1
32
+ methods = methods.grep(/^#{options[:method]}/) if options[:method]
33
+ puts methods.join("\n")
34
+ rescue # give up on parse errors
35
+ end
@@ -1,3 +1,3 @@
1
1
  class Minitest::Sprint
2
- VERSION = "1.0.0"
2
+ VERSION = "1.1.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minitest-sprint
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Davis
@@ -29,7 +29,7 @@ cert_chain:
29
29
  xJcC6UN6NHMOVMyAXsr2HR0gRRx4ofN1LoP2KhXzSr8UMvQYlwPmE0N5GQv1b5AO
30
30
  VpzF30vNaJK6ZT7xlIsIlwmH
31
31
  -----END CERTIFICATE-----
32
- date: 2015-02-04 00:00:00.000000000 Z
32
+ date: 2015-03-09 00:00:00.000000000 Z
33
33
  dependencies:
34
34
  - !ruby/object:Gem::Dependency
35
35
  name: minitest
@@ -94,6 +94,7 @@ files:
94
94
  - Rakefile
95
95
  - bin/minitest
96
96
  - lib/minitest/binstub_reporter.rb
97
+ - lib/minitest/complete.rb
97
98
  - lib/minitest/rake_reporter.rb
98
99
  - lib/minitest/sprint.rb
99
100
  - lib/minitest/sprint_plugin.rb
metadata.gz.sig CHANGED
Binary file