rfc 0.0.1 → 0.0.2

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
  SHA256:
3
- metadata.gz: 403f0fc9c271ab60489c370779dbf3ea096ccd2ddb0deb0871654407e6726ba5
4
- data.tar.gz: b10d9f3b9e05ff98b3a5bc2ee2dcc2c466f45f0d4ee679b80aec70f5918959e5
3
+ metadata.gz: 297ec5e3f1c71f1ae090bb6dcac575c14d22be9d2f6051b8533a2dfcc58a8ff1
4
+ data.tar.gz: 5af5cee83d8ca484e24662ae1d9bfda413e8524af52fefc19170cbfe68837a9b
5
5
  SHA512:
6
- metadata.gz: b80db7ac8762d1fd44ace501bdd655771b5c65150574e2c11481a8e78e8a31e96e0c7f0830f8b8a9e149cb3caf2f69c5ee7d9a8df3fee7f3325acb07161e698d
7
- data.tar.gz: 2ceaa5bff8edba75680c9e4bb24e9d41233f8fa3d8db8858d8fd796724dc3f0b33e31082e8ffb419fc6671292dd4c4eedf5641d2e5d2b606d7412ccd58c27935
6
+ metadata.gz: 46361628712b25416b775339ea16dbe6b2675885853376736855d843efffba0f2448f883c89e01ed2275b90f08888dd84b21cbff01cc5d850bdbcbd2783203da
7
+ data.tar.gz: 54f205faa1feaf4cac10dd51a47ec8a3afbc58c99d794a194c866b4802bc38657f55e3627c84186014034a354699ab1f28ed408a6c0614a73bfd465884646afd
data/LICENSE CHANGED
@@ -1,7 +1,11 @@
1
1
  The MIT License (MIT)
2
2
  =====================
3
3
 
4
- Copyright (c) 2018 Oleg Pudeyev
4
+ Copyright (c) 2018-2019 Oleg Pudeyev
5
+ Copyright (c) 2012 Chad Humphries, David Chelimsky, Myron Marston
6
+ Copyright (c) 2009 Chad Humphries, David Chelimsky
7
+ Copyright (c) 2006 David Chelimsky, The RSpec Development Team
8
+ Copyright (c) 2005 Steven Baker
5
9
 
6
10
  Permission is hereby granted, free of charge, to any person obtaining
7
11
  a copy of this software and associated documentation files (the
data/README.md CHANGED
@@ -13,6 +13,21 @@ It has the following features;
13
13
  - Timestamped percentage progress output
14
14
  - No output overwrites or terminal manipulation
15
15
 
16
+ ## Announce Formatter (Announce)
17
+
18
+ This formatter is similar to the standard RSpec documentation formatter,
19
+ but prints the description of each test prior to executing it.
20
+ It is intended primarily for debugging, where a breakpoint might be hit
21
+ by global test setup code as well as a specific test, or by multiple tests.
22
+
23
+ This formatter reports failures at the end of the test run, like
24
+ RSpec's documentation formatter does.
25
+
26
+ ## Announce Insta-Failing Formatter (AIF)
27
+
28
+ This is the announce formatter with insta-fail feature. It reports
29
+ failures as soon as they happen, after each example is executed.
30
+
16
31
  ## License
17
32
 
18
33
  MIT
@@ -0,0 +1,3 @@
1
+ require 'rfc/version'
2
+ require 'rfc/announce'
3
+ require 'rfc/riff'
@@ -0,0 +1,29 @@
1
+ require 'rfc/announce'
2
+
3
+ module Rfc
4
+ class AIF < Announce
5
+ RSpec::Core::Formatters.register self,
6
+ :example_group_started, :example_group_finished,
7
+ :start, :example_started,
8
+ :example_passed, :example_pending, :example_failed,
9
+ :dump_failures, :dump_summary
10
+
11
+ def start(notification)
12
+ @failed_count = 0
13
+ end
14
+
15
+ def example_failed(failure)
16
+ @failed_count += 1
17
+
18
+ output.puts failure.fully_formatted(@failed_count)
19
+ output.puts
20
+ end
21
+
22
+ def dump_failures(notification)
23
+ end
24
+
25
+ def dump_summary(summary)
26
+ end
27
+
28
+ end
29
+ end
@@ -0,0 +1,77 @@
1
+ require 'rspec/core'
2
+ RSpec::Support.require_rspec_core "formatters/base_text_formatter"
3
+ RSpec::Support.require_rspec_core "formatters/console_codes"
4
+
5
+ module Rfc
6
+ class Announce < RSpec::Core::Formatters::BaseTextFormatter
7
+ RSpec::Core::Formatters.register self,
8
+ :example_group_started, :example_group_finished,
9
+ :example_started,
10
+ :example_passed, :example_pending, :example_failed
11
+
12
+ def initialize(output)
13
+ super
14
+ @group_level = 0
15
+ end
16
+
17
+ def example_group_started(notification)
18
+ output.puts if @group_level == 0
19
+ output.puts "#{current_indentation}#{notification.group.description.strip}"
20
+
21
+ @group_level += 1
22
+ end
23
+
24
+ def example_group_finished(_notification)
25
+ @group_level -= 1 if @group_level > 0
26
+ end
27
+
28
+ def example_started(notification)
29
+ example = notification.example
30
+ output.puts(RSpec::Core::Formatters::ConsoleCodes.wrap(
31
+ "#{current_indentation}#{example.description.strip}...", :blue))
32
+ end
33
+
34
+ def example_passed(passed)
35
+ output.puts passed_output(passed.example)
36
+ end
37
+
38
+ def example_pending(pending)
39
+ output.puts pending_output(pending.example,
40
+ pending.example.execution_result.pending_message)
41
+ end
42
+
43
+ def example_failed(failure)
44
+ output.puts failure_output(failure.example)
45
+ end
46
+
47
+ private
48
+
49
+ def passed_output(example)
50
+ RSpec::Core::Formatters::ConsoleCodes.wrap(
51
+ "#{current_indentation} passed", :success)
52
+ end
53
+
54
+ def pending_output(example, message)
55
+ RSpec::Core::Formatters::ConsoleCodes.wrap(
56
+ "#{current_indentation}" \
57
+ " PENDING: #{message}",
58
+ :pending)
59
+ end
60
+
61
+ def failure_output(example)
62
+ RSpec::Core::Formatters::ConsoleCodes.wrap(
63
+ "#{current_indentation}" \
64
+ " FAILED - #{next_failure_index}",
65
+ :failure)
66
+ end
67
+
68
+ def next_failure_index
69
+ @next_failure_index ||= 0
70
+ @next_failure_index += 1
71
+ end
72
+
73
+ def current_indentation
74
+ ' ' * @group_level
75
+ end
76
+ end
77
+ end
@@ -1,4 +1,5 @@
1
- require 'rspec/core/formatters/base_text_formatter'
1
+ require 'rspec/core'
2
+ RSpec::Support.require_rspec_core "formatters/base_text_formatter"
2
3
 
3
4
  module Rfc
4
5
  class Riff < RSpec::Core::Formatters::BaseTextFormatter
@@ -0,0 +1,3 @@
1
+ module Rfc
2
+ VERSION = '0.0.2'.freeze
3
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rfc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oleg Pudeyev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-11-19 00:00:00.000000000 Z
11
+ date: 2019-03-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec-core
@@ -32,7 +32,11 @@ extra_rdoc_files: []
32
32
  files:
33
33
  - LICENSE
34
34
  - README.md
35
+ - lib/rfc.rb
36
+ - lib/rfc/aif.rb
37
+ - lib/rfc/announce.rb
35
38
  - lib/rfc/riff.rb
39
+ - lib/rfc/version.rb
36
40
  homepage: https://github.com/p-mongo/rfc
37
41
  licenses:
38
42
  - MIT
@@ -53,9 +57,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
53
57
  - !ruby/object:Gem::Version
54
58
  version: '0'
55
59
  requirements: []
56
- rubyforge_project:
57
- rubygems_version: 2.7.6
60
+ rubygems_version: 3.0.1
58
61
  signing_key:
59
62
  specification_version: 4
60
- summary: rfc-0.0.1
63
+ summary: rfc-0.0.2
61
64
  test_files: []