emoji-rspec 0.0.2 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.rspec +4 -0
- data/.ruby-version +1 -1
- data/.travis.yml +1 -1
- data/README.md +320 -4
- data/Rakefile +1 -1
- data/emoji-rspec.gemspec +2 -2
- data/examples/show_some_emoji.rb +23 -0
- data/lib/emoji-rspec.rb +1 -3
- data/lib/{emoji/rspec → emoji_test_love}/formatters.rb +0 -0
- data/lib/emoji_test_love/formatters/adventure_time_formatter.rb +53 -0
- data/lib/emoji_test_love/formatters/aggressive_thumbs_formatter.rb +19 -0
- data/lib/emoji_test_love/formatters/books_formatter.rb +19 -0
- data/lib/emoji_test_love/formatters/celebrate_formatter.rb +19 -0
- data/lib/emoji_test_love/formatters/drinking_game_formatter.rb +19 -0
- data/lib/emoji_test_love/formatters/drinking_game_tea_formatter.rb +19 -0
- data/lib/emoji_test_love/formatters/fruit_formatter.rb +19 -0
- data/lib/emoji_test_love/formatters/kanpai_formatter.rb +21 -0
- data/lib/emoji_test_love/formatters/life_hearts_formatter.rb +19 -0
- data/lib/emoji_test_love/formatters/lucky_formatter.rb +19 -0
- data/lib/emoji_test_love/formatters/omkase_formatter.rb +21 -0
- data/lib/emoji_test_love/formatters/smile_dip_formatter.rb +19 -0
- data/lib/emoji_test_love/formatters/smiley_faces_formatter.rb +19 -0
- data/lib/emoji_test_love/formatters/sunshine_formatter.rb +19 -0
- data/lib/emoji_test_love/formatters/thumbs_formatter.rb +19 -0
- data/lib/emoji_test_love/formatters/turtles_formatter.rb +19 -0
- data/lib/emoji_test_love/formatters/waddles_formatter.rb +19 -0
- data/lib/emoji_test_love/formatters/zen_smiles_formatter.rb +19 -0
- data/lib/emoji_test_love/rspec.rb +17 -0
- data/lib/emoji_test_love/rspec/rspec_formatters.rb +21 -0
- data/lib/emoji_test_love/rspec/rspec_integration.rb +75 -0
- data/lib/emoji_test_love/version.rb +3 -0
- data/spec/formatters/adventure_time_formatter_spec.rb +6 -0
- data/spec/formatters/aggressive_thumbs_formatter_spec.rb +6 -0
- data/spec/formatters/books_formatter_spec.rb +6 -0
- data/spec/formatters/celebrate_formatter_spec.rb +6 -0
- data/spec/formatters/drinking_game_formatter_spec.rb +6 -0
- data/spec/formatters/drinking_game_tea_formatter_spec.rb +6 -0
- data/spec/formatters/fruit_formatter_spec.rb +6 -0
- data/spec/formatters/kanpai_formatter_spec.rb +6 -0
- data/spec/formatters/life_hearts_formatter_spec.rb +6 -0
- data/spec/formatters/lucky_formatter_spec.rb +6 -0
- data/spec/formatters/omkase_formatter_spec.rb +6 -0
- data/spec/formatters/smile_dip_formatter_spec.rb +6 -0
- data/spec/formatters/smiley_faces_formatter_spec.rb +6 -0
- data/spec/formatters/sunshine_formatter_spec.rb +6 -0
- data/spec/formatters/thumbs_formatter_spec.rb +6 -0
- data/spec/formatters/turtles_formatter_spec.rb +6 -0
- data/spec/formatters/waddles_formatter_spec.rb +6 -0
- data/spec/formatters/zen_smiles_formatter_spec.rb +6 -0
- data/spec/generating_formatters_spec.rb +143 -0
- data/spec/spec_helper.rb +0 -0
- data/spec/support/shared_examples_for_formatters.rb +6 -0
- metadata +124 -92
- data/lib/emoji/helper.rb +0 -10
- data/lib/emoji/rspec/formatters/adventure_time_formatter.rb +0 -39
- data/lib/emoji/rspec/formatters/aggressive_thumbs_formatter.rb +0 -27
- data/lib/emoji/rspec/formatters/drinking_game_formatter.rb +0 -27
- data/lib/emoji/rspec/formatters/drinking_game_tea_formatter.rb +0 -27
- data/lib/emoji/rspec/formatters/life_hearts_formatter.rb +0 -27
- data/lib/emoji/rspec/formatters/smiles_formatter.rb +0 -27
- data/lib/emoji/rspec/formatters/thumbs_formatter.rb +0 -27
- data/lib/emoji/rspec/formatters/zen_smiles_formatter.rb +0 -27
- data/lib/emoji/rspec/integration.rb +0 -38
- data/lib/emoji/rspec/version.rb +0 -5
- data/spec/example_formatter_spec.rb +0 -40
@@ -0,0 +1,143 @@
|
|
1
|
+
require 'emoji_test_love/rspec/rspec_integration'
|
2
|
+
|
3
|
+
module TestFormatter
|
4
|
+
def passed_display
|
5
|
+
"."
|
6
|
+
end
|
7
|
+
def failed_display
|
8
|
+
"F"
|
9
|
+
end
|
10
|
+
def pending_display
|
11
|
+
"P"
|
12
|
+
end
|
13
|
+
def names
|
14
|
+
'foo'
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
module Bar
|
19
|
+
module Baz
|
20
|
+
class Qux
|
21
|
+
include TestFormatter
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
class Foo
|
27
|
+
include TestFormatter
|
28
|
+
end
|
29
|
+
|
30
|
+
EmojiTestLove::RSpecFormatter(Foo.new)
|
31
|
+
EmojiTestLove::RSpecFormatter(Foo.new, "OtherName")
|
32
|
+
EmojiTestLove::RSpecFormatter(::Bar::Baz::Qux.new)
|
33
|
+
|
34
|
+
describe "Generating a formatter" do
|
35
|
+
|
36
|
+
let(:output) { stub }
|
37
|
+
let(:formatter) { EmojiTestLove::FooFormatter.new(output) }
|
38
|
+
let(:provider) { Foo.new }
|
39
|
+
|
40
|
+
context "registering a formatter" do
|
41
|
+
it "creates a subclass of RSpecFormatter" do
|
42
|
+
expect(formatter).to be_a(::RSpec::Core::Formatters::BaseTextFormatter)
|
43
|
+
end
|
44
|
+
|
45
|
+
it "is registered with RSpecIntegration" do
|
46
|
+
expect(::EmojiTestLove::RSpecIntegration.known_formatters)
|
47
|
+
.to include ::EmojiTestLove::FooFormatter
|
48
|
+
end
|
49
|
+
|
50
|
+
it "supports passing an alternate name" do
|
51
|
+
expect(EmojiTestLove::OtherNameFormatter.new(nil))
|
52
|
+
.to be_a(::RSpec::Core::Formatters::BaseTextFormatter)
|
53
|
+
end
|
54
|
+
|
55
|
+
it "registers the alternate name with RSpecIntegration" do
|
56
|
+
expect(::EmojiTestLove::RSpecIntegration.known_formatters)
|
57
|
+
.to include ::EmojiTestLove::OtherNameFormatter
|
58
|
+
end
|
59
|
+
|
60
|
+
it "supports a namespaced class" do
|
61
|
+
expect(EmojiTestLove::Bar::Baz::QuxFormatter.new(nil))
|
62
|
+
.to be_a(::RSpec::Core::Formatters::BaseTextFormatter)
|
63
|
+
end
|
64
|
+
|
65
|
+
it "registers the namespaced class with RSpecIntegration" do
|
66
|
+
expect(::EmojiTestLove::RSpecIntegration.known_formatters)
|
67
|
+
.to include ::EmojiTestLove::Bar::Baz::QuxFormatter
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
context "generating output for an example" do
|
72
|
+
let(:output) { StringIO.new }
|
73
|
+
|
74
|
+
around do |example|
|
75
|
+
original_success_color = nil
|
76
|
+
original_failure_color = nil
|
77
|
+
original_pending_color = nil
|
78
|
+
|
79
|
+
RSpec.configure do |config|
|
80
|
+
original_success_color = config.success_color
|
81
|
+
original_failure_color = config.failure_color
|
82
|
+
original_pending_color = config.pending_color
|
83
|
+
config.color_enabled = true
|
84
|
+
config.tty = true
|
85
|
+
config.success_color = :cyan
|
86
|
+
config.failure_color = :purple
|
87
|
+
config.pending_color = :blue
|
88
|
+
end
|
89
|
+
|
90
|
+
example.yield
|
91
|
+
|
92
|
+
RSpec.configure do |config|
|
93
|
+
config.success_color = original_success_color
|
94
|
+
config.failure_color = original_failure_color
|
95
|
+
config.pending_color = original_pending_color
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
99
|
+
it "delegates example_passed to the passed_display of Foo" do
|
100
|
+
output.should_receive(:print).with(/#{provider.passed_display}/)
|
101
|
+
formatter.example_passed(example)
|
102
|
+
end
|
103
|
+
|
104
|
+
it "uses the custom success color" do
|
105
|
+
formatter.example_passed example
|
106
|
+
expect(output.string).to include("\e[36m")
|
107
|
+
end
|
108
|
+
|
109
|
+
it "delegates example_failed to the failed_display of Foo" do
|
110
|
+
output.should_receive(:print).with(/#{provider.failed_display}/)
|
111
|
+
formatter.example_failed(example)
|
112
|
+
end
|
113
|
+
|
114
|
+
it "uses the custom failure color" do
|
115
|
+
formatter.example_failed example
|
116
|
+
expect(output.string).to include("\e[37m")
|
117
|
+
end
|
118
|
+
|
119
|
+
it "delegates example_pending to the pending_display of Foo" do
|
120
|
+
output.should_receive(:print).with(/#{provider.pending_display}/)
|
121
|
+
formatter.example_pending(example)
|
122
|
+
end
|
123
|
+
|
124
|
+
it "uses the custom pending color" do
|
125
|
+
formatter.example_pending example
|
126
|
+
expect(output.string).to include("\e[34m")
|
127
|
+
end
|
128
|
+
end
|
129
|
+
|
130
|
+
context "specifying a formatter on the command line" do
|
131
|
+
it "includes the class name in the custom command line names list" do
|
132
|
+
expect(::EmojiTestLove::FooFormatter.names)
|
133
|
+
.to match_array ['foo', 'EmojiTestLove::FooFormatter']
|
134
|
+
end
|
135
|
+
|
136
|
+
it "delegates to the Foo instance for the custom command line names" do
|
137
|
+
::EmojiTestLove::FooFormatter.should_receive(:names)
|
138
|
+
|
139
|
+
::EmojiTestLove::RSpecIntegration.known_formatters.each(&:names)
|
140
|
+
end
|
141
|
+
end
|
142
|
+
|
143
|
+
end
|
data/spec/spec_helper.rb
ADDED
File without changes
|
metadata
CHANGED
@@ -1,74 +1,63 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: emoji-rspec
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 0
|
9
|
-
- 2
|
10
|
-
version: 0.0.2
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
11
5
|
platform: ruby
|
12
|
-
authors:
|
6
|
+
authors:
|
13
7
|
- Aaron Kromer
|
14
8
|
autorequire:
|
15
9
|
bindir: bin
|
16
10
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
- !ruby/object:Gem::Dependency
|
11
|
+
date: 2013-05-19 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
21
14
|
name: rspec
|
22
|
-
|
23
|
-
|
24
|
-
requirements:
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
25
17
|
- - ~>
|
26
|
-
- !ruby/object:Gem::Version
|
27
|
-
|
28
|
-
segments:
|
29
|
-
- 2
|
30
|
-
- 10
|
31
|
-
version: "2.10"
|
32
|
-
prerelease: false
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '2.10'
|
33
20
|
type: :runtime
|
34
|
-
requirement: *id001
|
35
|
-
- !ruby/object:Gem::Dependency
|
36
|
-
name: rspec
|
37
|
-
version_requirements: &id002 !ruby/object:Gem::Requirement
|
38
|
-
none: false
|
39
|
-
requirements:
|
40
|
-
- - ">="
|
41
|
-
- !ruby/object:Gem::Version
|
42
|
-
hash: 3
|
43
|
-
segments:
|
44
|
-
- 0
|
45
|
-
version: "0"
|
46
21
|
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '2.10'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rspec
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
47
34
|
type: :development
|
48
|
-
requirement: *id002
|
49
|
-
- !ruby/object:Gem::Dependency
|
50
|
-
name: rake
|
51
|
-
version_requirements: &id003 !ruby/object:Gem::Requirement
|
52
|
-
none: false
|
53
|
-
requirements:
|
54
|
-
- - ">="
|
55
|
-
- !ruby/object:Gem::Version
|
56
|
-
hash: 3
|
57
|
-
segments:
|
58
|
-
- 0
|
59
|
-
version: "0"
|
60
35
|
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
61
48
|
type: :development
|
62
|
-
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
63
55
|
description: Custom formatters for RSpec tests.
|
64
56
|
email:
|
65
57
|
executables: []
|
66
|
-
|
67
58
|
extensions: []
|
68
|
-
|
69
59
|
extra_rdoc_files: []
|
70
|
-
|
71
|
-
files:
|
60
|
+
files:
|
72
61
|
- .gitignore
|
73
62
|
- .rspec
|
74
63
|
- .ruby-version
|
@@ -78,52 +67,95 @@ files:
|
|
78
67
|
- README.md
|
79
68
|
- Rakefile
|
80
69
|
- emoji-rspec.gemspec
|
70
|
+
- examples/show_some_emoji.rb
|
81
71
|
- lib/emoji-rspec.rb
|
82
|
-
- lib/
|
83
|
-
- lib/
|
84
|
-
- lib/
|
85
|
-
- lib/
|
86
|
-
- lib/
|
87
|
-
- lib/
|
88
|
-
- lib/
|
89
|
-
- lib/
|
90
|
-
- lib/
|
91
|
-
- lib/
|
92
|
-
- lib/
|
93
|
-
- lib/
|
94
|
-
-
|
72
|
+
- lib/emoji_test_love/formatters.rb
|
73
|
+
- lib/emoji_test_love/formatters/adventure_time_formatter.rb
|
74
|
+
- lib/emoji_test_love/formatters/aggressive_thumbs_formatter.rb
|
75
|
+
- lib/emoji_test_love/formatters/books_formatter.rb
|
76
|
+
- lib/emoji_test_love/formatters/celebrate_formatter.rb
|
77
|
+
- lib/emoji_test_love/formatters/drinking_game_formatter.rb
|
78
|
+
- lib/emoji_test_love/formatters/drinking_game_tea_formatter.rb
|
79
|
+
- lib/emoji_test_love/formatters/fruit_formatter.rb
|
80
|
+
- lib/emoji_test_love/formatters/kanpai_formatter.rb
|
81
|
+
- lib/emoji_test_love/formatters/life_hearts_formatter.rb
|
82
|
+
- lib/emoji_test_love/formatters/lucky_formatter.rb
|
83
|
+
- lib/emoji_test_love/formatters/omkase_formatter.rb
|
84
|
+
- lib/emoji_test_love/formatters/smile_dip_formatter.rb
|
85
|
+
- lib/emoji_test_love/formatters/smiley_faces_formatter.rb
|
86
|
+
- lib/emoji_test_love/formatters/sunshine_formatter.rb
|
87
|
+
- lib/emoji_test_love/formatters/thumbs_formatter.rb
|
88
|
+
- lib/emoji_test_love/formatters/turtles_formatter.rb
|
89
|
+
- lib/emoji_test_love/formatters/waddles_formatter.rb
|
90
|
+
- lib/emoji_test_love/formatters/zen_smiles_formatter.rb
|
91
|
+
- lib/emoji_test_love/rspec.rb
|
92
|
+
- lib/emoji_test_love/rspec/rspec_formatters.rb
|
93
|
+
- lib/emoji_test_love/rspec/rspec_integration.rb
|
94
|
+
- lib/emoji_test_love/version.rb
|
95
|
+
- spec/formatters/adventure_time_formatter_spec.rb
|
96
|
+
- spec/formatters/aggressive_thumbs_formatter_spec.rb
|
97
|
+
- spec/formatters/books_formatter_spec.rb
|
98
|
+
- spec/formatters/celebrate_formatter_spec.rb
|
99
|
+
- spec/formatters/drinking_game_formatter_spec.rb
|
100
|
+
- spec/formatters/drinking_game_tea_formatter_spec.rb
|
101
|
+
- spec/formatters/fruit_formatter_spec.rb
|
102
|
+
- spec/formatters/kanpai_formatter_spec.rb
|
103
|
+
- spec/formatters/life_hearts_formatter_spec.rb
|
104
|
+
- spec/formatters/lucky_formatter_spec.rb
|
105
|
+
- spec/formatters/omkase_formatter_spec.rb
|
106
|
+
- spec/formatters/smile_dip_formatter_spec.rb
|
107
|
+
- spec/formatters/smiley_faces_formatter_spec.rb
|
108
|
+
- spec/formatters/sunshine_formatter_spec.rb
|
109
|
+
- spec/formatters/thumbs_formatter_spec.rb
|
110
|
+
- spec/formatters/turtles_formatter_spec.rb
|
111
|
+
- spec/formatters/waddles_formatter_spec.rb
|
112
|
+
- spec/formatters/zen_smiles_formatter_spec.rb
|
113
|
+
- spec/generating_formatters_spec.rb
|
114
|
+
- spec/spec_helper.rb
|
115
|
+
- spec/support/shared_examples_for_formatters.rb
|
95
116
|
homepage: https://github.com/cupakromer/emoji-rspec
|
96
|
-
licenses:
|
117
|
+
licenses:
|
97
118
|
- MIT
|
119
|
+
metadata: {}
|
98
120
|
post_install_message:
|
99
121
|
rdoc_options: []
|
100
|
-
|
101
|
-
require_paths:
|
122
|
+
require_paths:
|
102
123
|
- lib
|
103
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
none: false
|
114
|
-
requirements:
|
115
|
-
- - ">="
|
116
|
-
- !ruby/object:Gem::Version
|
117
|
-
hash: 3
|
118
|
-
segments:
|
119
|
-
- 0
|
120
|
-
version: "0"
|
124
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
125
|
+
requirements:
|
126
|
+
- - '>='
|
127
|
+
- !ruby/object:Gem::Version
|
128
|
+
version: '0'
|
129
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
130
|
+
requirements:
|
131
|
+
- - '>='
|
132
|
+
- !ruby/object:Gem::Version
|
133
|
+
version: '0'
|
121
134
|
requirements: []
|
122
|
-
|
123
135
|
rubyforge_project:
|
124
|
-
rubygems_version:
|
136
|
+
rubygems_version: 2.0.3
|
125
137
|
signing_key:
|
126
|
-
specification_version:
|
138
|
+
specification_version: 4
|
127
139
|
summary: Emoji RSpec Formatters
|
128
|
-
test_files:
|
129
|
-
- spec/
|
140
|
+
test_files:
|
141
|
+
- spec/formatters/adventure_time_formatter_spec.rb
|
142
|
+
- spec/formatters/aggressive_thumbs_formatter_spec.rb
|
143
|
+
- spec/formatters/books_formatter_spec.rb
|
144
|
+
- spec/formatters/celebrate_formatter_spec.rb
|
145
|
+
- spec/formatters/drinking_game_formatter_spec.rb
|
146
|
+
- spec/formatters/drinking_game_tea_formatter_spec.rb
|
147
|
+
- spec/formatters/fruit_formatter_spec.rb
|
148
|
+
- spec/formatters/kanpai_formatter_spec.rb
|
149
|
+
- spec/formatters/life_hearts_formatter_spec.rb
|
150
|
+
- spec/formatters/lucky_formatter_spec.rb
|
151
|
+
- spec/formatters/omkase_formatter_spec.rb
|
152
|
+
- spec/formatters/smile_dip_formatter_spec.rb
|
153
|
+
- spec/formatters/smiley_faces_formatter_spec.rb
|
154
|
+
- spec/formatters/sunshine_formatter_spec.rb
|
155
|
+
- spec/formatters/thumbs_formatter_spec.rb
|
156
|
+
- spec/formatters/turtles_formatter_spec.rb
|
157
|
+
- spec/formatters/waddles_formatter_spec.rb
|
158
|
+
- spec/formatters/zen_smiles_formatter_spec.rb
|
159
|
+
- spec/generating_formatters_spec.rb
|
160
|
+
- spec/spec_helper.rb
|
161
|
+
- spec/support/shared_examples_for_formatters.rb
|