rspec-tick-formatter 0.1.1

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: '07379607eaea6c4174b22661e221536808e64d35'
4
+ data.tar.gz: f41fb66491e414b86a763eb426b6f5c86f334c15
5
+ SHA512:
6
+ metadata.gz: f62fad701748421e9becc31fddd25a0742f3a7bf32a061d8b4345804b84680a1cc5c65a823fa8acdc40310725a8c9fd40bdce2ab8ea0e2fa7f7b5133e1b51b2d
7
+ data.tar.gz: 595ec2c8fd2877dadce781502fb376a245c7a7653bb27762a327f221739ab41e6027f69bf34e571ff69363d0f73745c4a043352a992d8fb617ebcb6e2352c98a
data/.gitignore ADDED
@@ -0,0 +1,17 @@
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
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in rspec-tick-formatter.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013 Rene Lengwinat
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.
data/README.md ADDED
@@ -0,0 +1,29 @@
1
+ # Rspec::Tick::Formatter
2
+
3
+ Rspec3 port of rspec-abhakungszeichen-formatter that pleases developers eyes
4
+
5
+ Forked from the orignal Rspec::Abhakungszeichen::Formatter
6
+
7
+ ![demo](abhakungszeichen-demo.png)
8
+
9
+ ## Why Rename?
10
+
11
+ Because I can't pronounce Abhakungszeichen
12
+
13
+ ## Installation
14
+
15
+ install formatter:
16
+
17
+ $ gem install rspec-tick-formatter
18
+
19
+ ## Usage
20
+
21
+ $ rspec --format RspecTickFormatter --color my_spec.rb
22
+
23
+ ## Contributing
24
+
25
+ 1. Fork it
26
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
27
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
28
+ 4. Push to the branch (`git push origin my-new-feature`)
29
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,9 @@
1
+ require "bundler/gem_tasks"
2
+
3
+ require 'rspec/core/rake_task'
4
+
5
+ RSpec::Core::RakeTask.new(:spec) do |t|
6
+ t.pattern = 'spec/*_spec.rb'
7
+ t.rspec_opts = "--require ./lib/rspec-tick-formatter.rb --format RspecTickFormatter --color"
8
+ t.fail_on_error = false
9
+ end
Binary file
@@ -0,0 +1,71 @@
1
+ require "rspec/core/formatters/base_text_formatter"
2
+
3
+ class RspecTickFormatter < RSpec::Core::Formatters::BaseTextFormatter
4
+ def initialize(output)
5
+ super(output)
6
+
7
+ @level = 0
8
+ end
9
+
10
+ RSpec::Core::Formatters.register self, :example_started, :example_passed, :example_pending,
11
+ :example_failed
12
+
13
+ def example_passed(proxy)
14
+ puts color("#{pad} \u2713 #{proxy.example.description}", :green)
15
+ end
16
+
17
+ def example_pending(proxy)
18
+ puts color("#{pad} \u2729 #{proxy.example.description}", :yellow)
19
+ end
20
+
21
+ def example_failed(proxy)
22
+ puts color("#{pad} \u2717 #{proxy.example.description}: #{proxy.example.exception}", :red)
23
+ end
24
+
25
+ def example_started(example_group)
26
+ puts "#{pad} #{example_group.example.description}:"
27
+ @level += 1
28
+ end
29
+
30
+ def example_finished(example_group)
31
+ @level -= 1
32
+ end
33
+
34
+ def pad
35
+ ' ' * @level * 2
36
+ end
37
+
38
+ def color(text, code_or_symbol)
39
+ if RSpec.configuration.color_enabled?
40
+ "\e[#{console_code_for(code_or_symbol)}m#{text}\e[0m"
41
+ else
42
+ text
43
+ end
44
+ end
45
+
46
+ # Shamelessly "Borrowed" from the excellent nyan cat formatter
47
+ # Source: https://github.com/mattsears/nyan-cat-formatter/blob/master/lib/nyan_cat_formatter/common.rb
48
+ VT100_CODES =
49
+ {
50
+ :black => 30,
51
+ :red => 31,
52
+ :green => 32,
53
+ :yellow => 33,
54
+ :blue => 34,
55
+ :magenta => 35,
56
+ :cyan => 36,
57
+ :white => 37,
58
+ :bold => 1,
59
+ }
60
+ VT100_CODE_VALUES = VT100_CODES.invert
61
+
62
+ def console_code_for(code_or_symbol)
63
+ if VT100_CODE_VALUES.has_key?(code_or_symbol)
64
+ code_or_symbol
65
+ else
66
+ VT100_CODES.fetch(code_or_symbol) do
67
+ console_code_for(:white)
68
+ end
69
+ end
70
+ end
71
+ end
@@ -0,0 +1,7 @@
1
+ module Rspec
2
+ module Tick
3
+ module Formatter
4
+ VERSION = "0.1.1"
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,3 @@
1
+ require "rspec-tick-formatter/version"
2
+ require "rspec-tick-formatter/formatter"
3
+
@@ -0,0 +1 @@
1
+ require "rspec-tick-formatter"
@@ -0,0 +1,22 @@
1
+ # -*- encoding: utf-8 -*-
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'rspec-tick-formatter/version'
5
+
6
+ Gem::Specification.new do |gem|
7
+ gem.name = "rspec-tick-formatter"
8
+ gem.version = Rspec::Tick::Formatter::VERSION
9
+ gem.authors = ["Rene Lengwinat", 'Andrew Wardrobe']
10
+ gem.email = ["rene.lengwinat@googlemail.com", "andrew.g.wardrobe@googlemail.com"]
11
+ gem.description = %q{Rspec3 formatter that pleases developers eyes}
12
+ gem.summary = %q{Unicode chars + colors to keep developers happy}
13
+ gem.homepage = ""
14
+
15
+ gem.files = `git ls-files`.split($/)
16
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
17
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
18
+ gem.require_paths = ["lib"]
19
+
20
+ gem.add_development_dependency 'rake'
21
+ gem.add_development_dependency 'rspec'
22
+ end
@@ -0,0 +1,28 @@
1
+ $:.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
2
+
3
+ require "rspec-tick-formatter"
4
+
5
+ # Just to demonstrate its output
6
+
7
+ describe RspecTickFormatter do
8
+ context "test spec" do
9
+
10
+ context "context 1" do
11
+ it "works" do
12
+ expect(1).to eq 1
13
+ end
14
+
15
+ pending "is pending"
16
+ end
17
+
18
+ context "context 2" do
19
+ it "works too" do
20
+ expect(1).to eq 1
21
+ end
22
+
23
+ it "fails" do
24
+ expect(1).to eq 42
25
+ end
26
+ end
27
+ end
28
+ end
metadata ADDED
@@ -0,0 +1,86 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rspec-tick-formatter
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.1
5
+ platform: ruby
6
+ authors:
7
+ - Rene Lengwinat
8
+ - Andrew Wardrobe
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2018-04-24 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rake
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - ">="
19
+ - !ruby/object:Gem::Version
20
+ version: '0'
21
+ type: :development
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ">="
26
+ - !ruby/object:Gem::Version
27
+ version: '0'
28
+ - !ruby/object:Gem::Dependency
29
+ name: rspec
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - ">="
33
+ - !ruby/object:Gem::Version
34
+ version: '0'
35
+ type: :development
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ">="
40
+ - !ruby/object:Gem::Version
41
+ version: '0'
42
+ description: Rspec3 formatter that pleases developers eyes
43
+ email:
44
+ - rene.lengwinat@googlemail.com
45
+ - andrew.g.wardrobe@googlemail.com
46
+ executables: []
47
+ extensions: []
48
+ extra_rdoc_files: []
49
+ files:
50
+ - ".gitignore"
51
+ - Gemfile
52
+ - LICENSE.txt
53
+ - README.md
54
+ - Rakefile
55
+ - abhakungszeichen-demo.png
56
+ - lib/rspec-tick-formatter.rb
57
+ - lib/rspec-tick-formatter/formatter.rb
58
+ - lib/rspec-tick-formatter/version.rb
59
+ - lib/rspec_tick_formatter.rb
60
+ - rspec-tick-formatter.gemspec
61
+ - spec/rspec_tick_formatter_spec.rb
62
+ homepage: ''
63
+ licenses: []
64
+ metadata: {}
65
+ post_install_message:
66
+ rdoc_options: []
67
+ require_paths:
68
+ - lib
69
+ required_ruby_version: !ruby/object:Gem::Requirement
70
+ requirements:
71
+ - - ">="
72
+ - !ruby/object:Gem::Version
73
+ version: '0'
74
+ required_rubygems_version: !ruby/object:Gem::Requirement
75
+ requirements:
76
+ - - ">="
77
+ - !ruby/object:Gem::Version
78
+ version: '0'
79
+ requirements: []
80
+ rubyforge_project:
81
+ rubygems_version: 2.5.2.1
82
+ signing_key:
83
+ specification_version: 4
84
+ summary: Unicode chars + colors to keep developers happy
85
+ test_files:
86
+ - spec/rspec_tick_formatter_spec.rb