emoji-rspec 0.0.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.
- data/.gitignore +18 -0
- data/.rspec +2 -0
- data/.travis.yml +4 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +51 -0
- data/Rakefile +12 -0
- data/emoji-rspec.gemspec +24 -0
- data/lib/emoji-rspec.rb +5 -0
- data/lib/emoji/rspec/formatters.rb +3 -0
- data/lib/emoji/rspec/formatters/adventure_time_formatter.rb +66 -0
- data/lib/emoji/rspec/formatters/aggressive_thumbs_formatter.rb +26 -0
- data/lib/emoji/rspec/formatters/drinking_game_formatter.rb +26 -0
- data/lib/emoji/rspec/formatters/drinking_game_tea_formatter.rb +26 -0
- data/lib/emoji/rspec/formatters/life_hearts_formatter.rb +26 -0
- data/lib/emoji/rspec/formatters/smiles_formatter.rb +26 -0
- data/lib/emoji/rspec/formatters/thumbs_formatter.rb +26 -0
- data/lib/emoji/rspec/formatters/zen_smiles_formatter.rb +26 -0
- data/lib/emoji/rspec/integration.rb +38 -0
- data/lib/emoji/rspec/version.rb +5 -0
- data/spec/spec_helper.rb +0 -0
- metadata +115 -0
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2012 Aaron Kromer
|
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,51 @@
|
|
1
|
+
# Emoji-RSpec
|
2
|
+
|
3
|
+
[](http://travis-ci.org/cupakromer/emoji-rspec) [](https://gemnasium.com/cupakromer/emoji-rspec) [](https://codeclimate.com/github/cupakromer/emoji-rspec)
|
4
|
+
|
5
|
+
A set of emoji based RSpec formatters for use with test output.
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
group :test do
|
12
|
+
gem 'emoji-rspec'
|
13
|
+
end
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install emoji-rspec
|
22
|
+
|
23
|
+
|
24
|
+
## Usage
|
25
|
+
|
26
|
+
Set one of the formatters via the command line:
|
27
|
+
|
28
|
+
$ rspec --format TODO
|
29
|
+
|
30
|
+
Or add it to your `.rspec` file:
|
31
|
+
|
32
|
+
--format TODO
|
33
|
+
|
34
|
+
## Bugs, Issues, and Suggestions
|
35
|
+
|
36
|
+
Please submit them here https://github.com/cupakromer/emoji-rspec/issues
|
37
|
+
|
38
|
+
## Contributing
|
39
|
+
|
40
|
+
1. Fork it
|
41
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
42
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
43
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
44
|
+
5. Create new Pull Request
|
45
|
+
|
46
|
+
## Copyright / License
|
47
|
+
|
48
|
+
Copyright (c) 2012 Aaron Kromer, released under the MIT License.
|
49
|
+
|
50
|
+
See [LICENSE](https://github.com/cupakromer/emoji-rspec/blob/master/LICENSE)
|
51
|
+
for details.
|
data/Rakefile
ADDED
data/emoji-rspec.gemspec
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'emoji/rspec/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |gem|
|
7
|
+
gem.name = "emoji-rspec"
|
8
|
+
gem.version = Emoji::RSpec::VERSION
|
9
|
+
gem.authors = ["Aaron Kromer"]
|
10
|
+
gem.description = %q{Custom formatters for RSpec tests.}
|
11
|
+
gem.summary = %q{Emoji RSpec Formatters}
|
12
|
+
gem.homepage = "https://github.com/cupakromer/emoji-rspec"
|
13
|
+
|
14
|
+
gem.add_dependency "rspec", '~> 2.10'
|
15
|
+
gem.add_development_dependency "rspec"
|
16
|
+
gem.add_development_dependency "rake"
|
17
|
+
|
18
|
+
gem.license = 'MIT'
|
19
|
+
|
20
|
+
gem.files = `git ls-files`.split($/)
|
21
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
22
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
23
|
+
gem.require_paths = ["lib"]
|
24
|
+
end
|
data/lib/emoji-rspec.rb
ADDED
@@ -0,0 +1,66 @@
|
|
1
|
+
require 'rspec/core/formatters/base_text_formatter'
|
2
|
+
|
3
|
+
module Emoji
|
4
|
+
module RSpec
|
5
|
+
module Formatters
|
6
|
+
|
7
|
+
class AdventureTimeFormatter < ::RSpec::Core::Formatters::BaseTextFormatter
|
8
|
+
PASS_EMOJI = [
|
9
|
+
"\u{1f496} ",
|
10
|
+
"\u{1f31f} ",
|
11
|
+
"\u{2728} ",
|
12
|
+
"\u{1f4ab} ",
|
13
|
+
"\u{1f478} ",
|
14
|
+
"\u{1f471} ",
|
15
|
+
"\u{1f415} ",
|
16
|
+
"\u{1f49d} ",
|
17
|
+
"\u{2b50} ",
|
18
|
+
]
|
19
|
+
|
20
|
+
FAIL_EMOJI = [
|
21
|
+
"\u{1f608} ",
|
22
|
+
"\u{1f47f} ",
|
23
|
+
"\u{1f4a5} ",
|
24
|
+
"\u{1f4a2} ",
|
25
|
+
"\u{1f479} ",
|
26
|
+
"\u{1f47a} ",
|
27
|
+
"\u{1f4a9} ",
|
28
|
+
"\u{1f432} ",
|
29
|
+
]
|
30
|
+
|
31
|
+
PEND_EMOJI = [
|
32
|
+
"\u{1f47d} ",
|
33
|
+
"\u{1f48a} ",
|
34
|
+
"\u{1f427} ",
|
35
|
+
"\u{1f3b2} ",
|
36
|
+
"\u{1f47e} ",
|
37
|
+
"\u{1f392} ",
|
38
|
+
"\u{1f4f1} ",
|
39
|
+
"\u{1f526} ",
|
40
|
+
]
|
41
|
+
|
42
|
+
def example_passed(example)
|
43
|
+
super(example)
|
44
|
+
output.print green rand_emoji PASS_EMOJI
|
45
|
+
end
|
46
|
+
|
47
|
+
def example_failed(example)
|
48
|
+
super(example)
|
49
|
+
output.print red rand_emoji FAIL_EMOJI
|
50
|
+
end
|
51
|
+
|
52
|
+
def example_pending(example)
|
53
|
+
super(example)
|
54
|
+
output.print yellow rand_emoji PEND_EMOJI
|
55
|
+
end
|
56
|
+
|
57
|
+
private
|
58
|
+
|
59
|
+
def rand_emoji(collection)
|
60
|
+
collection[rand collection.size]
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'rspec/core/formatters/base_text_formatter'
|
2
|
+
|
3
|
+
module Emoji
|
4
|
+
module RSpec
|
5
|
+
module Formatters
|
6
|
+
|
7
|
+
class AggressiveThumbsFormatter < ::RSpec::Core::Formatters::BaseTextFormatter
|
8
|
+
def example_passed(example)
|
9
|
+
super(example)
|
10
|
+
output.print green "\u{1f44c} "
|
11
|
+
end
|
12
|
+
|
13
|
+
def example_failed(example)
|
14
|
+
super(example)
|
15
|
+
output.print red "\u{1f44a} "
|
16
|
+
end
|
17
|
+
|
18
|
+
def example_pending(example)
|
19
|
+
super(example)
|
20
|
+
output.print yellow "\u{270a} "
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'rspec/core/formatters/base_text_formatter'
|
2
|
+
|
3
|
+
module Emoji
|
4
|
+
module RSpec
|
5
|
+
module Formatters
|
6
|
+
|
7
|
+
class DrinkingGameFormatter < ::RSpec::Core::Formatters::BaseTextFormatter
|
8
|
+
def example_passed(example)
|
9
|
+
super(example)
|
10
|
+
output.print green "\u{2615} "
|
11
|
+
end
|
12
|
+
|
13
|
+
def example_failed(example)
|
14
|
+
super(example)
|
15
|
+
output.print red "\u{1f378} "
|
16
|
+
end
|
17
|
+
|
18
|
+
def example_pending(example)
|
19
|
+
super(example)
|
20
|
+
output.print yellow "\u{1f37a} "
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'rspec/core/formatters/base_text_formatter'
|
2
|
+
|
3
|
+
module Emoji
|
4
|
+
module RSpec
|
5
|
+
module Formatters
|
6
|
+
|
7
|
+
class DrinkingGameTeaFormatter < ::RSpec::Core::Formatters::BaseTextFormatter
|
8
|
+
def example_passed(example)
|
9
|
+
super(example)
|
10
|
+
output.print green "\u{1f375} "
|
11
|
+
end
|
12
|
+
|
13
|
+
def example_failed(example)
|
14
|
+
super(example)
|
15
|
+
output.print red "\u{1f378} "
|
16
|
+
end
|
17
|
+
|
18
|
+
def example_pending(example)
|
19
|
+
super(example)
|
20
|
+
output.print yellow "\u{1f37a} "
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'rspec/core/formatters/base_text_formatter'
|
2
|
+
|
3
|
+
module Emoji
|
4
|
+
module RSpec
|
5
|
+
module Formatters
|
6
|
+
|
7
|
+
class LifeHeartsFormatter < ::RSpec::Core::Formatters::BaseTextFormatter
|
8
|
+
def example_passed(example)
|
9
|
+
super(example)
|
10
|
+
output.print green "\u{1f49a} "
|
11
|
+
end
|
12
|
+
|
13
|
+
def example_failed(example)
|
14
|
+
super(example)
|
15
|
+
output.print red "\u{1f494} "
|
16
|
+
end
|
17
|
+
|
18
|
+
def example_pending(example)
|
19
|
+
super(example)
|
20
|
+
output.print yellow "\u{1f49b} "
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'rspec/core/formatters/base_text_formatter'
|
2
|
+
|
3
|
+
module Emoji
|
4
|
+
module RSpec
|
5
|
+
module Formatters
|
6
|
+
|
7
|
+
class SmilesFormatter < ::RSpec::Core::Formatters::BaseTextFormatter
|
8
|
+
def example_passed(example)
|
9
|
+
super(example)
|
10
|
+
output.print green "\u{1f60a} "
|
11
|
+
end
|
12
|
+
|
13
|
+
def example_failed(example)
|
14
|
+
super(example)
|
15
|
+
output.print red "\u{1f621} "
|
16
|
+
end
|
17
|
+
|
18
|
+
def example_pending(example)
|
19
|
+
super(example)
|
20
|
+
output.print yellow "\u{1f62c} "
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'rspec/core/formatters/base_text_formatter'
|
2
|
+
|
3
|
+
module Emoji
|
4
|
+
module RSpec
|
5
|
+
module Formatters
|
6
|
+
|
7
|
+
class ThumbsFormatter < ::RSpec::Core::Formatters::BaseTextFormatter
|
8
|
+
def example_passed(example)
|
9
|
+
super(example)
|
10
|
+
output.print green "\u{1f44d} "
|
11
|
+
end
|
12
|
+
|
13
|
+
def example_failed(example)
|
14
|
+
super(example)
|
15
|
+
output.print red "\u{1f44e} "
|
16
|
+
end
|
17
|
+
|
18
|
+
def example_pending(example)
|
19
|
+
super(example)
|
20
|
+
output.print yellow "\u{270b} "
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'rspec/core/formatters/base_text_formatter'
|
2
|
+
|
3
|
+
module Emoji
|
4
|
+
module RSpec
|
5
|
+
module Formatters
|
6
|
+
|
7
|
+
class ZenSmilesFormatter < ::RSpec::Core::Formatters::BaseTextFormatter
|
8
|
+
def example_passed(example)
|
9
|
+
super(example)
|
10
|
+
output.print green "\u{1f610} "
|
11
|
+
end
|
12
|
+
|
13
|
+
def example_failed(example)
|
14
|
+
super(example)
|
15
|
+
output.print red "\u{1f61e} "
|
16
|
+
end
|
17
|
+
|
18
|
+
def example_pending(example)
|
19
|
+
super(example)
|
20
|
+
output.print yellow "\u{1f614} "
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
require 'rspec/core/configuration'
|
2
|
+
|
3
|
+
class RSpec::Core::Configuration
|
4
|
+
|
5
|
+
alias_method :built_in_formatter_without_emoji, :built_in_formatter
|
6
|
+
|
7
|
+
def built_in_formatter(key)
|
8
|
+
case key.to_s.downcase
|
9
|
+
when 'smiles'
|
10
|
+
require 'emoji/rspec/formatters/smiles_formatter'
|
11
|
+
Emoji::RSpec::Formatters::SmilesFormatter
|
12
|
+
when 'zen', 'zen_smiles', 'zensmiles'
|
13
|
+
require 'emoji/rspec/formatters/zen_smiles_formatter'
|
14
|
+
Emoji::RSpec::Formatters::ZenSmilesFormatter
|
15
|
+
when 'hearts', 'life', 'life_hearts', 'lifehearts'
|
16
|
+
require 'emoji/rspec/formatters/life_hearts_formatter'
|
17
|
+
Emoji::RSpec::Formatters::LifeHeartsFormatter
|
18
|
+
when 'thumbs'
|
19
|
+
require 'emoji/rspec/formatters/thumbs_formatter'
|
20
|
+
Emoji::RSpec::Formatters::ThumbsFormatter
|
21
|
+
when 'aggressive_thumbs', 'aggressivethumbs'
|
22
|
+
require 'emoji/rspec/formatters/aggressive_thumbs_formatter'
|
23
|
+
Emoji::RSpec::Formatters::AggressiveThumbsFormatter
|
24
|
+
when 'adventure', 'adventure_time', 'adventuretime'
|
25
|
+
require 'emoji/rspec/formatters/adventure_time_formatter'
|
26
|
+
Emoji::RSpec::Formatters::AdventureTimeFormatter
|
27
|
+
when 'drinking', 'drinking_game', 'drinkinggame'
|
28
|
+
require 'emoji/rspec/formatters/drinking_game_formatter'
|
29
|
+
Emoji::RSpec::Formatters::DrinkingGameFormatter
|
30
|
+
when 'drinking-tea', 'drinking_game_tea', 'drinkingtea', 'drinkinggametea'
|
31
|
+
require 'emoji/rspec/formatters/drinking_game_tea_formatter'
|
32
|
+
Emoji::RSpec::Formatters::DrinkingGameTeaFormatter
|
33
|
+
else
|
34
|
+
built_in_formatter_without_emoji(key)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
end
|
data/spec/spec_helper.rb
ADDED
File without changes
|
metadata
ADDED
@@ -0,0 +1,115 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: emoji-rspec
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Aaron Kromer
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-11-28 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: rspec
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ~>
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '2.10'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '2.10'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: rspec
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
type: :development
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: rake
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
description: Custom formatters for RSpec tests.
|
63
|
+
email:
|
64
|
+
executables: []
|
65
|
+
extensions: []
|
66
|
+
extra_rdoc_files: []
|
67
|
+
files:
|
68
|
+
- .gitignore
|
69
|
+
- .rspec
|
70
|
+
- .travis.yml
|
71
|
+
- Gemfile
|
72
|
+
- LICENSE.txt
|
73
|
+
- README.md
|
74
|
+
- Rakefile
|
75
|
+
- emoji-rspec.gemspec
|
76
|
+
- lib/emoji-rspec.rb
|
77
|
+
- lib/emoji/rspec/formatters.rb
|
78
|
+
- lib/emoji/rspec/formatters/adventure_time_formatter.rb
|
79
|
+
- lib/emoji/rspec/formatters/aggressive_thumbs_formatter.rb
|
80
|
+
- lib/emoji/rspec/formatters/drinking_game_formatter.rb
|
81
|
+
- lib/emoji/rspec/formatters/drinking_game_tea_formatter.rb
|
82
|
+
- lib/emoji/rspec/formatters/life_hearts_formatter.rb
|
83
|
+
- lib/emoji/rspec/formatters/smiles_formatter.rb
|
84
|
+
- lib/emoji/rspec/formatters/thumbs_formatter.rb
|
85
|
+
- lib/emoji/rspec/formatters/zen_smiles_formatter.rb
|
86
|
+
- lib/emoji/rspec/integration.rb
|
87
|
+
- lib/emoji/rspec/version.rb
|
88
|
+
- spec/spec_helper.rb
|
89
|
+
homepage: https://github.com/cupakromer/emoji-rspec
|
90
|
+
licenses:
|
91
|
+
- MIT
|
92
|
+
post_install_message:
|
93
|
+
rdoc_options: []
|
94
|
+
require_paths:
|
95
|
+
- lib
|
96
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
97
|
+
none: false
|
98
|
+
requirements:
|
99
|
+
- - ! '>='
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: '0'
|
102
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
103
|
+
none: false
|
104
|
+
requirements:
|
105
|
+
- - ! '>='
|
106
|
+
- !ruby/object:Gem::Version
|
107
|
+
version: '0'
|
108
|
+
requirements: []
|
109
|
+
rubyforge_project:
|
110
|
+
rubygems_version: 1.8.24
|
111
|
+
signing_key:
|
112
|
+
specification_version: 3
|
113
|
+
summary: Emoji RSpec Formatters
|
114
|
+
test_files:
|
115
|
+
- spec/spec_helper.rb
|