minitest-failed 0.1.0 → 0.2.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
  SHA1:
3
- metadata.gz: 89b1e41805e7a99eafc8c50314a37d12c7823df0
4
- data.tar.gz: 539a831461c9abf1c607bf1269680cca1666bea0
3
+ metadata.gz: ff216c09b2ace8a88f97880e02dfb64b5bb42283
4
+ data.tar.gz: c775f68ba4b9c500c97ee5796c01e3147852d11c
5
5
  SHA512:
6
- metadata.gz: 221a382605d55fc8c38d9cacae98ebb1d920df7bfbd72c4ad092ec7b870a768c820fb39f5a062ffc5cdfaa7c38c238bd28776a59de46816b6cab3eb6097e6f8f
7
- data.tar.gz: a15739b62c8d48add3a44af2b6ca5700e84e7af8a9a43d5fd602a01ea397b40e5183e22a3d09838f99a91cd4b12fb484483d942864c793d60d8f22fdddc3c5c4
6
+ metadata.gz: f0faf71d6e13f1deab55b7ea1a699565e2d6121d47d4b815a599c427a282d99ba05829c680bc2e3d66948d986dd7f8b2e1dc00aedbc346289ec6c2b28809135c
7
+ data.tar.gz: e70626324cd85e3e047b30678b63abf8144bf392ef877704487f7a5d43342d4ab3a3eb7049dcdb5def9808b5ae278fc680c38c71849ffa94898c02a390335d44
data/README.md CHANGED
@@ -37,10 +37,10 @@ or short alias
37
37
 
38
38
  ## Inspired by projects:
39
39
 
40
- https://github.com/fnando/minitest-utils
41
- https://github.com/grosser/single_test
42
- https://github.com/gma/tconsole
43
- https://github.com/qrush/m
40
+ * https://github.com/fnando/minitest-utils
41
+ * https://github.com/grosser/single_test
42
+ * https://github.com/gma/tconsole
43
+ * https://github.com/qrush/m
44
44
 
45
45
  ## Development
46
46
 
@@ -5,21 +5,16 @@ module Minitest
5
5
  require 'minitest/failed/config'
6
6
  require 'minitest/failed/file_reporter'
7
7
  require 'minitest/failed/io'
8
+ require 'minitest/failed/railtie'
8
9
 
9
10
  def self.get_files_and_tests
10
11
  string = IO.read_from_file
11
-
12
12
  return nil unless string
13
13
 
14
14
  array = string.split(/rake|TEST=| TESTOPTS=|\"|\\|--name=/).map(&:strip).reject(&:empty?)
15
15
  array.partition { |v| v.end_with?('rb') }
16
16
  end
17
17
 
18
- def self.configure
19
- @config = Minitest::Failed::Config.new
20
- yield @config
21
- end
22
-
23
18
  def self.config
24
19
  @config ||= Minitest::Failed::Config.new
25
20
  end
@@ -15,20 +15,16 @@ module Minitest
15
15
 
16
16
  private
17
17
 
18
- def indent(text)
19
- text.gsub(/^/, ' ')
20
- end
21
-
22
18
  def display_replay_command(result)
23
19
  location = find_test_file(result)
24
20
  return if location.empty?
25
21
 
26
- %[rake TEST=#{location} TESTOPTS="--name=#{result.name}"]
22
+ %(rake TEST=#{location} TESTOPTS="--name=#{result.name}")
27
23
  end
28
24
 
29
25
  def find_test_file(result)
30
26
  filter_backtrace(result.failure.backtrace)
31
- .find {|line| line.match(%r((test|spec)/.*?_(test|spec).rb)) }
27
+ .find { |line| line.match(%r((test|spec)/.*?_(test|spec).rb)) }
32
28
  .to_s
33
29
  .gsub(/:\d+.*?$/, '')
34
30
  end
@@ -36,7 +32,7 @@ module Minitest
36
32
  def backtrace(backtrace)
37
33
  backtrace = filter_backtrace(backtrace).map {|line| location(line, true) }
38
34
  return if backtrace.empty?
39
- indent(backtrace.join("\n")).gsub(/^(\s+)/, "\\1# ")
35
+ backtrace.join("\n").gsub(/^(\s+)/, "\\1# ")
40
36
  end
41
37
 
42
38
  def location(location, include_line_number = false)
@@ -0,0 +1,9 @@
1
+ module Minitest
2
+ module Failed
3
+ class Railtie < ::Rails::Railtie
4
+ rake_tasks do
5
+ load(File.expand_path(File.join(File.dirname(__FILE__), './tasks.rb')))
6
+ end
7
+ end
8
+ end
9
+ end
@@ -1,5 +1,5 @@
1
1
  module Minitest
2
2
  module Failed
3
- VERSION = "0.1.0"
3
+ VERSION = "0.2.0"
4
4
  end
5
5
  end
@@ -14,14 +14,6 @@ Gem::Specification.new do |spec|
14
14
  spec.homepage = 'http://github.com/artempartos/minitest-failed'
15
15
  spec.license = 'MIT'
16
16
 
17
- # Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
18
- # delete this section to allow pushing this gem to any host.
19
- # if spec.respond_to?(:metadata)
20
- # spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com'"
21
- # else
22
- # raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
23
- # end
24
-
25
17
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
26
18
  spec.bindir = "exe"
27
19
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minitest-failed
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Artem Petrov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-12-14 00:00:00.000000000 Z
11
+ date: 2015-12-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest
@@ -72,10 +72,10 @@ files:
72
72
  - lib/minitest/failed/config.rb
73
73
  - lib/minitest/failed/file_reporter.rb
74
74
  - lib/minitest/failed/io.rb
75
+ - lib/minitest/failed/railtie.rb
75
76
  - lib/minitest/failed/tasks.rb
76
77
  - lib/minitest/failed/version.rb
77
78
  - lib/minitest/failed_plugin.rb
78
- - lib/minitest/tasks/minitest-failed_tasks.rake
79
79
  - minitest-failed.gemspec
80
80
  homepage: http://github.com/artempartos/minitest-failed
81
81
  licenses:
@@ -97,9 +97,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
97
97
  version: '0'
98
98
  requirements: []
99
99
  rubyforge_project:
100
- rubygems_version: 2.4.3
100
+ rubygems_version: 2.4.6
101
101
  signing_key:
102
102
  specification_version: 4
103
103
  summary: Minitest failed test runner
104
104
  test_files: []
105
- has_rdoc:
@@ -1 +0,0 @@
1
- load(File.expand_path(File.join(File.dirname(__FILE__), '../failed/tasks.rb')))