emoji-rspec 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,18 @@
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
+ .ruby-version
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --order rand
data/.travis.yml ADDED
@@ -0,0 +1,4 @@
1
+ language: ruby
2
+ rvm:
3
+ - 1.9.2
4
+ - 1.9.3
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in emoji-rspec.gemspec
4
+ gemspec
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
+ [![Build Status](https://secure.travis-ci.org/cupakromer/emoji-rspec.png?branch=master)](http://travis-ci.org/cupakromer/emoji-rspec) [![Dependency Status](https://gemnasium.com/cupakromer/emoji-rspec.png?travis)](https://gemnasium.com/cupakromer/emoji-rspec) [![Code Climate](https://codeclimate.com/badge.png)](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
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env rake
2
+ require "bundler/gem_tasks"
3
+
4
+ require 'rspec/core/rake_task'
5
+
6
+ desc 'Run specs'
7
+ RSpec::Core::RakeTask.new(:spec) do |task|
8
+ task.rspec_opts = "--format doc"
9
+ end
10
+
11
+ desc 'Default: Run specs.'
12
+ task default: :spec
@@ -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
@@ -0,0 +1,5 @@
1
+ require "emoji/rspec/formatters"
2
+
3
+ if defined? RSpec
4
+ require "emoji/rspec/integration"
5
+ end
@@ -0,0 +1,3 @@
1
+ Dir[File.join(File.dirname(__FILE__), 'formatters', '*.rb')].each do |file|
2
+ require_relative File.join('formatters', File.basename(file, '.rb'))
3
+ end
@@ -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
@@ -0,0 +1,5 @@
1
+ module Emoji
2
+ module RSpec
3
+ VERSION = "0.0.1"
4
+ end
5
+ end
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