minitest-reporters-ws 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ M2ZiN2JhNzMyOWE1NWE1OTc2YjdhOWZlZDIyZTkyYTQwNDY1ZGZlNQ==
5
+ data.tar.gz: !binary |-
6
+ YWFlMWRmZmRmNTAyMjE5MDQ1ZjUzZjNkYjcxOTUyY2QyMmY2ZTIxNA==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ NDJiMDcyNTRmMWJjNWEwN2U5ZjdiNTNiNjg4ODg0MmZmNDk2MzkyOTdhMzYx
10
+ NGM0N2RjM2MzOWIzZGZkNjA1MTNlYmMyNTRkODI3MWYxMjAxNjk1ZWY5ZjY5
11
+ M2JiYWMxZDg4ZWI4Njc2MzZkZTlmYTViZGE2YWViMjlmZmFkZmI=
12
+ data.tar.gz: !binary |-
13
+ MmZmMzY5MzZlYmZjNDcyMGI3MDZlZWExYmQwMTI0YmNiNjU2YTVjMWI4OTk5
14
+ NmQ5MGQ1YjE5NDE5MDAzZGZiM2RiYWE2Y2UwNDFjMjAwN2E4MTFhNzQ2YzVi
15
+ ODhkZjRlYzQwOTc1OGIxZDIxZGRhZDI4MzgwMDg5Yzk3OTJlYzI=
@@ -0,0 +1,19 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
18
+ .idea/
19
+ bin/
data/Gemfile ADDED
@@ -0,0 +1,34 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in minitest-reporters-fail.gemspec
4
+ gemspec
5
+
6
+ group :development do
7
+ gem 'guard'
8
+ gem 'guard-minitest'
9
+
10
+ gem 'pry'
11
+ gem 'rake'
12
+ gem 'minitest'
13
+ gem 'minitest-matchers'
14
+
15
+ gem 'minitest-reporters'
16
+ gem 'mocha'
17
+ gem 'hashie', git: 'https://github.com/intridea/hashie'
18
+
19
+ gem 'rspec-web', git: 'https://github.com/dcunited001/rspec-web'
20
+ end
21
+
22
+ if RbConfig::CONFIG['target_os'] =~ /darwin/i
23
+ gem 'rb-fsevent', '>= 0.3.2'
24
+ gem 'growl', '~> 1.0.3'
25
+ end
26
+ if RbConfig::CONFIG['target_os'] =~ /linux/i
27
+ gem 'rb-inotify', '>= 0.5.1'
28
+ gem 'libnotify', '~> 0.1.3'
29
+ end
30
+ if RbConfig::CONFIG['target_os'] =~ /mswin|mingw/i
31
+ gem 'win32console', :require => false
32
+ gem 'rb-fchange', '~> 0.0.2', :require => false
33
+ gem 'rb-notifu', '~> 0.0.4', :require => false
34
+ end
@@ -0,0 +1,6 @@
1
+ guard 'minitest', :notify => true do
2
+ # with Minitest::Spec
3
+ watch(%r|^spec/(.*)_spec\.rb|)
4
+ watch(%r|^lib/(.*)\.rb|) { |m| "spec/#{m[1]}_spec.rb" }
5
+ watch(%r|^spec/spec_helper\.rb|) { "spec" }
6
+ end
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013 David Conner
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,34 @@
1
+ Minitest::Reporters::Ws
2
+ =======================
3
+
4
+ The Minitest Formatter is working, but I need to work with the
5
+ sinatra app to change the formatting of the results.
6
+
7
+ ### Minitest Websocket Reporter
8
+
9
+ > ala https://github.com/RyanScottLewis/rspec-web
10
+
11
+ Add this to test/support/minitest_reporters.rb:
12
+
13
+ ```ruby
14
+ # may want to skip this for CI!
15
+ require "minitest/reporters"
16
+ require 'minitest/reporters/ws'
17
+ emoji = {
18
+ 'P' => "\u{1F49A} ", # heart
19
+ 'E' => "\u{1f525} ", # flame
20
+ 'F' => "\u{1f4a9} ", # poop
21
+ 'S' => "\u{1f37a} "} # beer
22
+
23
+ Minitest::Reporters.use! Minitest::Reporters::Ws::Reporter.new(emoji: emoji)
24
+ ```
25
+
26
+ To run tests:
27
+
28
+ ```shell
29
+ bundle install --binstubs
30
+ rspec-web
31
+ guard
32
+ # [enter]
33
+ ```
34
+
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,19 @@
1
+ #require 'minitest/unit'
2
+ require 'ansi/code'
3
+ require 'minitest/reporters'
4
+
5
+ require 'json'
6
+ require 'timeout'
7
+ require 'web_socket'
8
+
9
+ module Minitest
10
+ module Reporters
11
+ module Ws
12
+ end
13
+ end
14
+ end
15
+
16
+ require 'minitest/reporters/ws/messages'
17
+ require 'minitest/reporters/ws/formatting'
18
+ require 'minitest/reporters/ws/client'
19
+ require 'minitest/reporters/ws/reporter'
@@ -0,0 +1,63 @@
1
+ module Minitest::Reporters::Ws
2
+ class Client
3
+ DEFAULT_CONFIG = { 'host' => "localhost", 'port' => "10081" }
4
+
5
+ attr_accessor :no_server
6
+ attr_accessor :socket
7
+ attr_accessor :host, :port
8
+
9
+ def initialize(opts = {})
10
+ init_config(opts.delete(:yml), opts.delete(:config), opts.delete(:env))
11
+ init_socket
12
+ identify
13
+ end
14
+
15
+ def identify
16
+ data = { receiver: "server", method: "identify", arguments: ["rspec"] }
17
+ @socket.send(data.to_json) if connected?
18
+ end
19
+
20
+ def send_msg(data)
21
+ @socket.send(data.to_json) if connected?
22
+ end
23
+
24
+ def close
25
+ # hmmm, i want to leave the connection open
26
+ data = { receiver: "server", method: "disconnect", arguments: ["rspec"] }
27
+ @socket.send(data.to_json) if connected?
28
+ @socket.close if connected?
29
+ end
30
+
31
+ def connected?
32
+ !!socket
33
+ end
34
+
35
+ private
36
+
37
+ def init_socket
38
+ @timestamp = Time.now.to_i
39
+ @socket = begin
40
+ WebSocket.new("ws://localhost:10081")
41
+ rescue => ex
42
+ puts ex.message
43
+ nil
44
+ end
45
+ end
46
+
47
+ def init_config(file, conf, env = 'test')
48
+ config = conf
49
+ config = read_conf(file, env) if file
50
+ config ||= DEFAULT_CONFIG
51
+
52
+ @host = config['host']
53
+ @port = config['port'].to_i
54
+ end
55
+
56
+ def read_conf(filename, env)
57
+ YAML::load(File.open(filename))[env]
58
+ end
59
+
60
+ end
61
+ end
62
+
63
+
@@ -0,0 +1,84 @@
1
+ module Minitest::Reporters::Ws
2
+ module Formatting
3
+ INFO_PADDING = 8
4
+
5
+ def get_description(runner, test)
6
+ "#{test.suite}: <b>#{test.test}</b>"
7
+ end
8
+
9
+ def print_time(test)
10
+ total_time = Time.now - (runner.test_start_time || Time.now)
11
+ " (%.2fs)" % total_time
12
+ end
13
+
14
+ def print_info(e)
15
+ #puts 'fdsa'
16
+ e.message.each_line { |line| print_with_info_padding(line) }
17
+
18
+ trace = filter_backtrace(e.backtrace)
19
+ trace.each { |line| print_with_info_padding(line) }
20
+ end
21
+
22
+ # TODO: fix printing
23
+
24
+ def print_pass(suite, test, test_runner)
25
+ unless @client.connected?
26
+ # do nothing
27
+ end
28
+ end
29
+
30
+ def print_skip(suite, test, test_runner)
31
+ puts @emoji['S'] + yellow { " SKIP #{suite}" }
32
+ puts yellow { " #{print_time(test)} #{test}" }
33
+ puts print_info(test_runner.exception) unless @client.connected?
34
+ end
35
+
36
+ def print_fail(suite, test, test_runner)
37
+ puts @emoji['F'] + red { " FAIL #{suite}" }
38
+ puts red { " #{print_time(test)} #{test}" }
39
+ puts print_info(test_runner.exception) unless @client.connected?
40
+ end
41
+
42
+ def print_err(suite, test, test_runner)
43
+ puts @emoji['E'] + red { " ERROR #{suite}" }
44
+ puts red { " #{print_time(test)} #{test}" }
45
+ puts print_info(test_runner.exception) unless @client.connected?
46
+ end
47
+
48
+ def print_after_suite(suite)
49
+ puts "#{@test_count} Tests - #{suite}"
50
+ %w(P E F S).each do |status|
51
+ print("#{@emoji[status]} => " + @emoji[status]*@results[status] + " #{@results[status]}")
52
+ puts;
53
+ end
54
+ puts;
55
+ end
56
+
57
+ def print_after_suites
58
+ puts "FINISHED - #{runner.test_count} tests ran"
59
+ %w(P E F S).each do |status|
60
+ print("#{@emoji[status]} => " + @emoji[status]*@suites_results[status] + " #{@suites_results[status]}")
61
+ puts;
62
+ end
63
+ end
64
+
65
+ def err_info(e)
66
+ err = ""
67
+ e.message.each_line { |line| err += "<p>#{line}</p>" }
68
+
69
+ trace = filter_backtrace(e.backtrace)
70
+ trace.each { |line| err += "<p>#{line}</p>" }
71
+
72
+ err
73
+ end
74
+
75
+ def pad(str, size)
76
+ ' ' * size + str
77
+ end
78
+
79
+ def print_with_info_padding(line)
80
+ puts pad(line, INFO_PADDING)
81
+ end
82
+ end
83
+ end
84
+
@@ -0,0 +1,67 @@
1
+ module Minitest::Reporters::Ws
2
+ module Messages
3
+
4
+ def messages
5
+ { start_new_iteration: { receiver: "web", method: "startNewIteration" },
6
+ add_to_passing: { receiver: "web", method: "addToPassing" },
7
+ add_to_pending: { receiver: "web", method: "addToPending" },
8
+ add_to_erring: { receiver: "web", method: "addToFailing" },
9
+ add_to_failing: { receiver: "web", method: "addToFailing" } }
10
+ end
11
+
12
+ def start_new_iteration(test_count = 420)
13
+ @client.send_msg(messages[:start_new_iteration].merge arguments: [@timestamp, test_count])
14
+ end
15
+
16
+ def add_to_passing(test)
17
+ @client.send_msg(prep_result(test, :add_to_passing))
18
+ end
19
+
20
+ def add_to_pending(test)
21
+ @client.send_msg(prep_result(test, :add_to_pending))
22
+ end
23
+
24
+ def add_to_failing(test)
25
+ @client.send_msg(prep_result(test, :add_to_failing))
26
+ end
27
+
28
+ def add_to_erring(test)
29
+ # for now, treating erring the same as failing
30
+ @client.send_msg(prep_result(test, :add_to_erring))
31
+ end
32
+
33
+ private
34
+
35
+ def prep_result(test, key)
36
+ test_data = example_to_hash(test)
37
+ messages[key].merge arguments: [@timestamp, test_data]
38
+ end
39
+
40
+ # TODO: fix formatting
41
+
42
+ def example_to_hash(meta)
43
+ # the runner is the Minitest::Runner
44
+ # which Minitest::Reporter modifies to work
45
+
46
+ m = meta[:metadata]
47
+ t = meta[:test]
48
+ r = meta[:runner]
49
+
50
+ ex = t.exception ? err_info(t.exception) : nil
51
+ desc = get_description(r,t)
52
+ #desc += ex if ex
53
+
54
+ # TODO: format times
55
+ { framework: :minitest,
56
+ started_at: r.test_start_time,
57
+ finished_at: Time.now, # convert to_i? & add? @timestamp + t.time
58
+ run_time: t.time,
59
+ file_path: "/mock/me/some/data", # not in minitest_reporters?
60
+ line_number: 9876, # not in minitest_reporters?
61
+ assertions: t.assertions,
62
+ exception: ex || '',
63
+ description: desc }
64
+
65
+ end
66
+ end
67
+ end
@@ -0,0 +1,177 @@
1
+ module Minitest::Reporters::Ws
2
+ # A reporter based on rspec-web by RyanScottLewis
3
+ #
4
+ # @see https://github.com/RyanScottLewis/rspec-web
5
+ class Reporter
6
+ include ::Minitest::Reporter
7
+ include ::ANSI::Code
8
+ include Formatting
9
+ include Messages
10
+
11
+ EMOJI = {
12
+ 'P' => "\u{1F49A} ", # heart
13
+ 'E' => "\u{1f525} ", # flame
14
+ 'F' => "\u{1f4a9} ", # poop
15
+ 'S' => "\u{1f37a} " } # beer
16
+
17
+ attr_accessor :timestamp
18
+ attr_accessor :client
19
+ attr_accessor :metadata
20
+
21
+ # MUTEX on MiniTest::ReporterRunner?
22
+
23
+ def initialize(opts = {})
24
+ @emoji = EMOJI.merge(opts.fetch(:emoji, {}))
25
+
26
+ init_counts
27
+ init_suite_counts
28
+ init_client
29
+ set_timestamp
30
+ end
31
+
32
+ def init_client
33
+ conf = ::Minitest::Reporters::Ws::Client::DEFAULT_CONFIG
34
+ find_or_create_client(conf)
35
+ end
36
+
37
+ # MINITEST HOOKS
38
+
39
+ def before_suites(suite, type)
40
+ set_metadata
41
+ start_new_iteration(metadata[:test_count])
42
+ init_suite_counts
43
+ @client.identify
44
+ end
45
+
46
+ def after_suites(suites, type)
47
+ print_after_suites
48
+ @client.close
49
+ end
50
+
51
+ def before_suite(suite)
52
+ init_counts
53
+ end
54
+
55
+ def after_suite(suite)
56
+ if @test_count > 1
57
+ @suites_results.each_key { |k| @suites_results[k] += @results[k] }
58
+ print_after_suite(suite)
59
+ end
60
+ end
61
+
62
+ def before_test(suite,test)
63
+ #FIX_FOR_ZEUS!! (which seems to want to run tests twice)
64
+ # on the second run,
65
+ # these are still nil,
66
+ # for some reason
67
+ # oh i wish i knew why!
68
+ @test_count ||= 0
69
+ @suite_test_count ||= 0
70
+ end
71
+
72
+ def after_test(suite,test)
73
+ @test_count += 1
74
+ @suite_test_count += 1
75
+ end
76
+
77
+ # MINITEST PASS/FAIL/ERROR/SKIP
78
+
79
+ def pass(suite, test, test_runner)
80
+ @results['P'] += 1
81
+ print_pass(suite,test,test_runner)
82
+ add_to_passing(to_metadata(runner, test_runner))
83
+ end
84
+
85
+ def skip(suite, test, test_runner)
86
+ @results['S'] += 1
87
+ print_skip(suite,test,test_runner)
88
+ add_to_pending(to_metadata(runner, test_runner))
89
+ end
90
+
91
+ def failure(suite, test, test_runner)
92
+ @results['F'] += 1
93
+ print_fail(suite,test,test_runner)
94
+ add_to_failing(to_metadata(runner, test_runner))
95
+ end
96
+
97
+ def error(suite, test, test_runner)
98
+ @results['E'] += 1
99
+ print_err(suite,test,test_runner)
100
+ add_to_erring(to_metadata(runner, test_runner))
101
+ end
102
+
103
+ # wanted this to be defined as a module accessor,
104
+ # so zeus will create the initial client
105
+ # when it initially loads up the minitest_helper
106
+ # then subsequent test runs will use the same client
107
+
108
+ def global_client
109
+ ::Minitest::Reporters::Ws.class_variable_get("@@client")
110
+ end
111
+
112
+ def global_client=(c)
113
+ ::Minitest::Reporters::Ws.class_variable_set("@@client", c) unless global_client?
114
+ end
115
+
116
+ def global_client?
117
+ ::Minitest::Reporters::Ws.class_variable_defined?("@@client")
118
+ end
119
+
120
+ def find_or_create_client(config = {})
121
+ @client = if global_client?
122
+ global_client
123
+ else
124
+ ::Minitest::Reporters::Ws::Client.new(config: config)
125
+ end
126
+ end
127
+
128
+ private
129
+
130
+ def unit_runner
131
+ ::Minitest::Unit.runner
132
+ end
133
+
134
+ def set_metadata
135
+ @metadata = {
136
+ test_options: unit_runner.options,
137
+ test_count: unit_runner.test_count,
138
+ #replace @timestamp?
139
+ #start_time: unit_runner.suites_start_time.to_i
140
+ }
141
+
142
+ # updated after tests run
143
+ #[runner.test_count,
144
+ # runner.assertion_count,
145
+ # runner.failures,
146
+ # runner.errors,
147
+ # runner.skips]
148
+ end
149
+
150
+ def set_timestamp
151
+ @timestamp = Time.now.to_i
152
+ end
153
+
154
+ def init_count_hash
155
+ { 'P' => 0,
156
+ 'E' => 0,
157
+ 'F' => 0,
158
+ 'S' => 0 }
159
+ end
160
+
161
+ def init_suite_counts
162
+ @suites_test_count = 0
163
+ @suites_results = init_count_hash
164
+ end
165
+
166
+ def init_counts
167
+ @test_count = 0
168
+ @results = init_count_hash
169
+ end
170
+
171
+ def to_metadata(runner, test_runner = nil)
172
+ { minitest: metadata,
173
+ test: test_runner,
174
+ runner: runner }
175
+ end
176
+ end
177
+ end
@@ -0,0 +1,47 @@
1
+ # coding: utf-8
2
+ $:.push File.expand_path('../lib', __FILE__)
3
+
4
+ Gem::Specification.new do |s|
5
+ s.name = "minitest-reporters-ws"
6
+ s.version = "0.0.1"
7
+
8
+ s.name = "minitest-reporters-ws"
9
+ s.authors = ["David Conner"]
10
+ s.email = ["dconner.pro@gmail.com"]
11
+ s.description = %q{A Minitest Reporter that Outputs to a Websocket}
12
+ s.summary = %q{A Minitest Reporter that Outputs to a Websocked!}
13
+ s.homepage = "https://github.com/dcunited001/minitest-reporters-ws"
14
+ s.license = "MIT"
15
+
16
+ s.files = `git ls-files`.split($/)
17
+ s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ s.test_files = s.files.grep(%r{^(test|spec|features)/})
19
+ s.require_paths = ["lib"]
20
+
21
+ if s.respond_to? :specification_version then
22
+ s.specification_version = 1
23
+
24
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
25
+ s.add_runtime_dependency(%q<minitest-reporters>, ["~> 0.14"])
26
+ s.add_runtime_dependency(%q<em-websocket>, ["~> 0.3"])
27
+ s.add_runtime_dependency(%q<web-socket-ruby>, ["~> 0.1"])
28
+ s.add_runtime_dependency(%q<ansi>, ["~> 1.4"])
29
+ s.add_runtime_dependency(%q<version>, ["~> 1.0"])
30
+ else
31
+ s.add_dependency(%q<minitest-reporters>, ["~> 0.14"])
32
+ s.add_dependency(%q<em-websocket>, ["~> 0.3"])
33
+ s.add_dependency(%q<web-socket-ruby>, ["~> 0.1"])
34
+ s.add_dependency(%q<ansi>, ["~> 1.4"])
35
+ s.add_dependency(%q<version>, ["~> 1.0"])
36
+ end
37
+ else
38
+ s.add_dependency(%q<minitest-reporters>, ["~> 0.14"])
39
+ s.add_dependency(%q<em-websocket>, ["~> 0.3"])
40
+ s.add_dependency(%q<web-socket-ruby>, ["~> 0.1"])
41
+ s.add_dependency(%q<ansi>, ["~> 1.4"])
42
+ s.add_dependency(%q<version>, ["~> 1.0"])
43
+ end
44
+
45
+ s.add_development_dependency "bundler", "~> 1.3"
46
+ s.add_development_dependency "rake"
47
+ end
@@ -0,0 +1,6 @@
1
+ development:
2
+ host: localhost
3
+ port: 10081
4
+ test:
5
+ host: localhost
6
+ port: 10081
@@ -0,0 +1,21 @@
1
+ require 'spec_helper'
2
+
3
+ describe Minitest::Reporters::Ws::Client do
4
+ subject { CLIENT.new(yml: YML) }
5
+
6
+ it '\'s spec\'n out man' do
7
+ 'spec'.wont_equal 'none'
8
+ end
9
+
10
+ describe "#initialize" do
11
+ before do
12
+ WebSocket.expects(:new)
13
+ end
14
+
15
+ it 'reads the correct config' do
16
+ subject.host.must_equal 'localhost'
17
+ subject.port.must_equal 10081
18
+ end
19
+ end
20
+
21
+ end
@@ -0,0 +1,5 @@
1
+ require 'spec_helper'
2
+
3
+ describe Minitest::Reporters::Ws::Messages do
4
+
5
+ end
@@ -0,0 +1,7 @@
1
+ require 'spec_helper'
2
+
3
+ describe Minitest::Reporters::Ws::Reporter do
4
+ it '\'s spec\'n out man' do
5
+ 'spec'.wont_equal 'none'
6
+ end
7
+ end
@@ -0,0 +1,40 @@
1
+ require 'spec_helper_integration'
2
+
3
+ describe "Passing Tests" do
4
+ it "passes 1" do
5
+ 1.must_equal 1
6
+ end
7
+ it "passes 2" do
8
+ 2.must_equal 2
9
+ end
10
+ it "passes 3" do
11
+ 3.must_equal 3
12
+ end
13
+ end
14
+
15
+ describe "Failing Tests" do
16
+ it "skips 1" do
17
+ skip "testing"
18
+ end
19
+ it "fails 1" do
20
+ 1.must_equal 3
21
+ end
22
+ it "passes 2" do
23
+ 2.must_equal 2
24
+ end
25
+ it "fails 3" do
26
+ 3.must_equal 1
27
+ end
28
+ end
29
+
30
+ describe "Err the Tests" do
31
+ it "errors 1" do
32
+ ['Intermitt Ant, the Evil', nil].sample.each_char { |c| c.to_s }
33
+ end
34
+ it "errors 2" do
35
+ UndefDaConstant
36
+ end
37
+ it "errors 3" do
38
+ nil.blah
39
+ end
40
+ end
@@ -0,0 +1,25 @@
1
+ # encoding: utf-8
2
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
3
+
4
+ require "minitest/spec"
5
+ require "mocha/setup"
6
+ require "pry"
7
+
8
+ require "minitest/reporters"
9
+ require 'minitest/reporters/ws'
10
+
11
+ WS = Minitest::Reporters::Ws::Reporter
12
+ CLIENT = Minitest::Reporters::Ws::Client
13
+ YML = File.join(File.dirname(__FILE__), 'config', 'ws_reporter.yml')
14
+
15
+ def root_path
16
+ File.dirname(__FILE__)
17
+ end
18
+
19
+ emoji = {
20
+ 'P' => "\u{1F49A} ", # heart
21
+ 'E' => "\u{1f525} ", # flame
22
+ 'F' => "\u{1f4a9} ", # poop
23
+ 'S' => "\u{1f37a} "} # beer
24
+
25
+ Minitest::Reporters.use! Minitest::Reporters::Ws::Reporter.new(emoji: emoji)
@@ -0,0 +1,13 @@
1
+ require 'spec_helper'
2
+
3
+ # in test/support/minitest_reporters.rb
4
+ #require "minitest/reporters"
5
+ #require 'minitest/reporters/ws'
6
+ #
7
+ #emoji = {
8
+ # 'P' => "\u{1F49A} ", # heart
9
+ # 'E' => "\u{1f525} ", # flame
10
+ # 'F' => "\u{1f4a9} ", # poop
11
+ # 'S' => "\u{1f37a} "} # beer
12
+
13
+ #Minitest::Reporters.use! Minitest::Reporters::Ws::Reporter.new(emoji: emoji)
metadata ADDED
@@ -0,0 +1,168 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: minitest-reporters-ws
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - David Conner
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-03-10 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.14'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '0.14'
27
+ - !ruby/object:Gem::Dependency
28
+ name: em-websocket
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: '0.3'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: '0.3'
41
+ - !ruby/object:Gem::Dependency
42
+ name: web-socket-ruby
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ~>
46
+ - !ruby/object:Gem::Version
47
+ version: '0.1'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: '0.1'
55
+ - !ruby/object:Gem::Dependency
56
+ name: ansi
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: '1.4'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ~>
67
+ - !ruby/object:Gem::Version
68
+ version: '1.4'
69
+ - !ruby/object:Gem::Dependency
70
+ name: version
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ~>
74
+ - !ruby/object:Gem::Version
75
+ version: '1.0'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ~>
81
+ - !ruby/object:Gem::Version
82
+ version: '1.0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: bundler
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ~>
88
+ - !ruby/object:Gem::Version
89
+ version: '1.3'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ~>
95
+ - !ruby/object:Gem::Version
96
+ version: '1.3'
97
+ - !ruby/object:Gem::Dependency
98
+ name: rake
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ! '>='
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ! '>='
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ description: A Minitest Reporter that Outputs to a Websocket
112
+ email:
113
+ - dconner.pro@gmail.com
114
+ executables: []
115
+ extensions: []
116
+ extra_rdoc_files: []
117
+ files:
118
+ - .gitignore
119
+ - Gemfile
120
+ - Guardfile
121
+ - LICENSE.txt
122
+ - README.md
123
+ - Rakefile
124
+ - lib/minitest/reporters/ws.rb
125
+ - lib/minitest/reporters/ws/client.rb
126
+ - lib/minitest/reporters/ws/formatting.rb
127
+ - lib/minitest/reporters/ws/messages.rb
128
+ - lib/minitest/reporters/ws/reporter.rb
129
+ - minitest-reporters-ws.gemspec
130
+ - spec/config/ws_reporter.yml
131
+ - spec/minitest/reporters/ws/client_spec.rb
132
+ - spec/minitest/reporters/ws/messages_spec.rb
133
+ - spec/minitest/reporters/ws/reporter_spec.rb
134
+ - spec/minitest/reporters/ws_spec.rb
135
+ - spec/spec_helper.rb
136
+ - spec/spec_helper_integration.rb
137
+ homepage: https://github.com/dcunited001/minitest-reporters-ws
138
+ licenses:
139
+ - MIT
140
+ metadata: {}
141
+ post_install_message:
142
+ rdoc_options: []
143
+ require_paths:
144
+ - lib
145
+ required_ruby_version: !ruby/object:Gem::Requirement
146
+ requirements:
147
+ - - ! '>='
148
+ - !ruby/object:Gem::Version
149
+ version: '0'
150
+ required_rubygems_version: !ruby/object:Gem::Requirement
151
+ requirements:
152
+ - - ! '>='
153
+ - !ruby/object:Gem::Version
154
+ version: '0'
155
+ requirements: []
156
+ rubyforge_project:
157
+ rubygems_version: 2.0.0
158
+ signing_key:
159
+ specification_version: 1
160
+ summary: A Minitest Reporter that Outputs to a Websocked!
161
+ test_files:
162
+ - spec/config/ws_reporter.yml
163
+ - spec/minitest/reporters/ws/client_spec.rb
164
+ - spec/minitest/reporters/ws/messages_spec.rb
165
+ - spec/minitest/reporters/ws/reporter_spec.rb
166
+ - spec/minitest/reporters/ws_spec.rb
167
+ - spec/spec_helper.rb
168
+ - spec/spec_helper_integration.rb