minitest-reporters-turn_reporter 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +9 -0
- data/.travis.yml +4 -0
- data/Gemfile +4 -0
- data/README.md +36 -0
- data/Rakefile +1 -0
- data/bin/console +14 -0
- data/bin/setup +7 -0
- data/lib/minitest/reporters/turn_reporter.rb +87 -0
- data/minitest-reporters-turn_reporter.gemspec +23 -0
- metadata +94 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 96049034b7aebc8c184fda3f091c563d0e6a4ad7
|
4
|
+
data.tar.gz: b831bbe354fb21212dba9255673145ddfd69ad98
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 65c357d426748c12d9455e7aa327f382c12955ca5df2bbbd9ea0bda6fb76b93be3fd2f3524c597243eeafa7c75152464a55f9420721b16e26f8122859cc8b2d0
|
7
|
+
data.tar.gz: 12949f1cd313ea7d9e1f20029e764a8f20f19c064ea6c2f3e106eebbcd588e3e3649ffa07d46bde51d28ebaae4d8f4d9182db8f76bf1ca253b2874d4840a8649
|
data/.gitignore
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/README.md
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
# Minitest::Reporters::TurnReporter
|
2
|
+
|
3
|
+
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/minitest/reporters/turn_reporter`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
|
+
|
5
|
+
TODO: Delete this and the text above, and describe your gem
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'minitest-reporters-turn_reporter'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install minitest-reporters-turn_reporter
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
TODO: Write usage instructions here
|
26
|
+
|
27
|
+
## Development
|
28
|
+
|
29
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake false` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
30
|
+
|
31
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
32
|
+
|
33
|
+
## Contributing
|
34
|
+
|
35
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/minitest-reporters-turn_reporter.
|
36
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "minitest/reporters/turn_reporter"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start
|
data/bin/setup
ADDED
@@ -0,0 +1,87 @@
|
|
1
|
+
require "ansi/code"
|
2
|
+
require "minitest/reporters"
|
3
|
+
|
4
|
+
module Minitest
|
5
|
+
module Reporters
|
6
|
+
|
7
|
+
# Turn-like reporter that reads like a spec.
|
8
|
+
#
|
9
|
+
# Based upon TwP's turn (MIT License) and paydro's monkey-patch.
|
10
|
+
#
|
11
|
+
# @see https://github.com/TwP/turn turn
|
12
|
+
# @see https://gist.github.com/356945 paydro's monkey-patch
|
13
|
+
class TurnReporter < ::Minitest::Reporters::BaseReporter
|
14
|
+
include ANSI::Code
|
15
|
+
include ::Minitest::RelativePosition
|
16
|
+
|
17
|
+
def start
|
18
|
+
super
|
19
|
+
puts "Started"
|
20
|
+
puts
|
21
|
+
end
|
22
|
+
|
23
|
+
def report
|
24
|
+
super
|
25
|
+
puts "Finished in %.5fs" % total_time
|
26
|
+
print "\e[37m%d tests\e[0m" % count
|
27
|
+
print ", "
|
28
|
+
print_with_color :green, "%d passed", passes
|
29
|
+
print ", "
|
30
|
+
print_with_color :red, "%d failures", failures
|
31
|
+
print ", "
|
32
|
+
print_with_color :yellow, "%d errors", errors
|
33
|
+
print ", "
|
34
|
+
print_with_color :cyan, "%d skips", skips
|
35
|
+
print ", "
|
36
|
+
print "%d assertions" % assertions
|
37
|
+
puts
|
38
|
+
end
|
39
|
+
|
40
|
+
def record(test)
|
41
|
+
super
|
42
|
+
print " "
|
43
|
+
print_colored_status(test)
|
44
|
+
print(" (%.2fs) " % test.time)
|
45
|
+
print test.name.gsub(/^test_: /, "")
|
46
|
+
puts
|
47
|
+
if !test.skipped? && test.failure
|
48
|
+
print_info(test.failure)
|
49
|
+
puts
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
def print_colored_status(test)
|
54
|
+
if test.passed?
|
55
|
+
print(green { pad_mark( result(test).to_s.upcase ) })
|
56
|
+
elsif test.skipped?
|
57
|
+
print(cyan { pad_mark( result(test).to_s.upcase ) })
|
58
|
+
elsif test.error?
|
59
|
+
print(yellow { pad_mark( result(test).to_s.upcase ) })
|
60
|
+
else
|
61
|
+
print(red { pad_mark( result(test).to_s.upcase ) })
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
protected
|
66
|
+
|
67
|
+
def passes
|
68
|
+
count - (failures + errors + skips)
|
69
|
+
end
|
70
|
+
|
71
|
+
def print_with_color(color, message, count)
|
72
|
+
message = message % count
|
73
|
+
message = send(color) { message } unless count.zero?
|
74
|
+
print message
|
75
|
+
end
|
76
|
+
|
77
|
+
def before_suite(suite)
|
78
|
+
puts "\e[4m#{suite}\e[0m"
|
79
|
+
end
|
80
|
+
|
81
|
+
def after_suite(suite)
|
82
|
+
puts
|
83
|
+
end
|
84
|
+
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path("../lib", __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = "minitest-reporters-turn_reporter"
|
7
|
+
spec.version = "0.1.0"
|
8
|
+
spec.authors = ["Bob Lail"]
|
9
|
+
spec.email = ["bob.lail@cph.org"]
|
10
|
+
|
11
|
+
spec.summary = %q{A Minitest Reporter that formats test output like Turn}
|
12
|
+
spec.homepage = "https://github.com/concordia-publishing-house/minitest-reporters-turn_reporter"
|
13
|
+
|
14
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
15
|
+
spec.bindir = "exe"
|
16
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
17
|
+
spec.require_paths = ["lib"]
|
18
|
+
|
19
|
+
spec.add_dependency "minitest-reporters"
|
20
|
+
|
21
|
+
spec.add_development_dependency "bundler", "~> 1.10"
|
22
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
23
|
+
end
|
metadata
ADDED
@@ -0,0 +1,94 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: minitest-reporters-turn_reporter
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Bob Lail
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-09-07 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: minitest-reporters
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.10'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.10'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '10.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '10.0'
|
55
|
+
description:
|
56
|
+
email:
|
57
|
+
- bob.lail@cph.org
|
58
|
+
executables: []
|
59
|
+
extensions: []
|
60
|
+
extra_rdoc_files: []
|
61
|
+
files:
|
62
|
+
- ".gitignore"
|
63
|
+
- ".travis.yml"
|
64
|
+
- Gemfile
|
65
|
+
- README.md
|
66
|
+
- Rakefile
|
67
|
+
- bin/console
|
68
|
+
- bin/setup
|
69
|
+
- lib/minitest/reporters/turn_reporter.rb
|
70
|
+
- minitest-reporters-turn_reporter.gemspec
|
71
|
+
homepage: https://github.com/concordia-publishing-house/minitest-reporters-turn_reporter
|
72
|
+
licenses: []
|
73
|
+
metadata: {}
|
74
|
+
post_install_message:
|
75
|
+
rdoc_options: []
|
76
|
+
require_paths:
|
77
|
+
- lib
|
78
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
84
|
+
requirements:
|
85
|
+
- - ">="
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: '0'
|
88
|
+
requirements: []
|
89
|
+
rubyforge_project:
|
90
|
+
rubygems_version: 2.2.2
|
91
|
+
signing_key:
|
92
|
+
specification_version: 4
|
93
|
+
summary: A Minitest Reporter that formats test output like Turn
|
94
|
+
test_files: []
|