turnip_formatter 0.6.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +3 -2
- data/README.md +1 -1
- data/example/README.md +108 -69
- data/example/images/after_hook.png +0 -0
- data/example/images/aggregate_failures.png +0 -0
- data/example/images/background.png +0 -0
- data/example/images/basic_step.png +0 -0
- data/example/images/before_hook.png +0 -0
- data/example/images/data_table.png +0 -0
- data/example/images/doc_string.png +0 -0
- data/example/images/failed_step.png +0 -0
- data/example/images/pending_step.png +0 -0
- data/gemfiles/Gemfile-rspec-3.3.x +1 -0
- data/gemfiles/Gemfile-rspec-3.5.x +4 -0
- data/lib/turnip_formatter/version.rb +1 -1
- data/turnip_formatter.gemspec +1 -1
- metadata +10 -6
- data/example/images/multiline.png +0 -0
- data/example/images/outline.png +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 48f166296cac27e139daa12290ccd49c35d25fc2
|
4
|
+
data.tar.gz: 520f8f44a31a91512c2bbd662623d087137d4385
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1cb8b4e3a57f238300994832265dee6d1896bc74598a28678f884f9d7a324bfb10885991836c12534a086557f4be15a629422662153477be2a510027e6e963f0
|
7
|
+
data.tar.gz: dbde10d072bb3f51b65ea56f7588fbe522bfa55382cbf4f6b50d322ca052118fe39b9e44a0a6ee0a5bcf70c21b094dec11ad9cd0dfe3880db5c1d90d29011a65
|
data/.travis.yml
CHANGED
@@ -6,16 +6,16 @@ cache: bundler
|
|
6
6
|
branches:
|
7
7
|
only:
|
8
8
|
- master
|
9
|
-
- 0.6.0
|
10
9
|
|
11
10
|
matrix:
|
12
11
|
allow_failures:
|
12
|
+
- gemfile: gemfiles/Gemfile-rspec-3.3.x
|
13
13
|
- rvm: ruby-head
|
14
14
|
|
15
15
|
rvm:
|
16
|
-
- 2.1
|
17
16
|
- 2.2
|
18
17
|
- 2.3.0
|
18
|
+
- 2.4.0
|
19
19
|
- ruby-head
|
20
20
|
- jruby-9.0.5.0
|
21
21
|
|
@@ -25,3 +25,4 @@ script:
|
|
25
25
|
gemfile:
|
26
26
|
- gemfiles/Gemfile-rspec-3.3.x
|
27
27
|
- gemfiles/Gemfile-rspec-3.4.x
|
28
|
+
- gemfiles/Gemfile-rspec-3.5.x
|
data/README.md
CHANGED
data/example/README.md
CHANGED
@@ -1,6 +1,8 @@
|
|
1
|
-
|
1
|
+
TurnipFormatter Demo
|
2
|
+
==================================================
|
2
3
|
|
3
|
-
|
4
|
+
Usage
|
5
|
+
------------------------------
|
4
6
|
|
5
7
|
$ cd /path/to/turnip_formatter
|
6
8
|
$ bundle install --path vendor/bundle
|
@@ -8,9 +10,10 @@
|
|
8
10
|
$ bundle exec rspec
|
9
11
|
$ open report.html
|
10
12
|
|
11
|
-
|
13
|
+
Screenshot
|
14
|
+
------------------------------
|
12
15
|
|
13
|
-
### Basic
|
16
|
+
### Basic
|
14
17
|
|
15
18
|
```feature
|
16
19
|
Scenario: normal monster
|
@@ -22,13 +25,12 @@ Scenario: normal monster
|
|
22
25
|
|
23
26
|
![Basic step](./images/basic_step.png)
|
24
27
|
|
25
|
-
### Failed
|
28
|
+
### Failed scenario
|
26
29
|
|
27
30
|
```feature
|
28
|
-
Scenario: strong monster
|
31
|
+
Scenario: [ERROR] strong monster
|
29
32
|
|
30
|
-
This scenario will
|
31
|
-
So, fanfare is not...oh...
|
33
|
+
This scenario will not success because his attacks can't defeat strong monster
|
32
34
|
|
33
35
|
Given there is a strong monster
|
34
36
|
When I attack it
|
@@ -38,27 +40,18 @@ Scenario: strong monster
|
|
38
40
|
|
39
41
|
![Failed step](./images/failed_step.png)
|
40
42
|
|
41
|
-
### Pending
|
43
|
+
### Pending scenario
|
42
44
|
|
43
45
|
```feature
|
44
|
-
|
45
|
-
|
46
|
-
This scenario will error because he can't cast spell
|
46
|
+
Scenario: [PENDING] spell magic
|
47
47
|
|
48
|
-
|
49
|
-
When I cast a spell 'fireball'
|
50
|
-
And I attack it
|
51
|
-
Then it should die
|
52
|
-
And Fanfare
|
48
|
+
This scenario will not success because he can't cast spell
|
53
49
|
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
And I attack it
|
60
|
-
Then it should die
|
61
|
-
And Fanfare
|
50
|
+
Given there is a strong monster
|
51
|
+
When I cast a spell 'fireball'
|
52
|
+
And I attack it
|
53
|
+
Then it should die
|
54
|
+
And Fanfare
|
62
55
|
```
|
63
56
|
|
64
57
|
![Pending step](./images/pending_step.png)
|
@@ -66,60 +59,106 @@ Scenario: strong monster
|
|
66
59
|
### Background
|
67
60
|
|
68
61
|
```feature
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
62
|
+
Background:
|
63
|
+
Given I equip a weapon
|
64
|
+
|
65
|
+
Scenario: normal monster
|
66
|
+
Given there is a monster
|
67
|
+
When I attack it
|
68
|
+
Then it should die
|
69
|
+
And Fanfare
|
70
|
+
|
71
|
+
Scenario: strong monster
|
72
|
+
|
73
|
+
His attacks can defeat strong monster if has weapon.
|
74
|
+
|
75
|
+
Given there is a strong monster
|
76
|
+
When I attack it
|
77
|
+
Then it should die
|
78
|
+
And Fanfare
|
85
79
|
```
|
86
80
|
|
87
81
|
![Background step](./images/background.png)
|
88
82
|
|
89
|
-
###
|
83
|
+
### Data table (outline)
|
84
|
+
|
85
|
+
```feature
|
86
|
+
Scenario: This is a feature with DocTable
|
87
|
+
When there are monsters:
|
88
|
+
| gargoyle |
|
89
|
+
| Cockatrice |
|
90
|
+
Then there should be 2 monsters
|
91
|
+
```
|
92
|
+
|
93
|
+
![data table](./images/data_table.png)
|
94
|
+
|
95
|
+
### Doc string (multiline)
|
96
|
+
|
97
|
+
```feature
|
98
|
+
Scenario: This is a feature with DocString
|
99
|
+
When the monster sings the following song
|
100
|
+
"""
|
101
|
+
Oh here be monsters
|
102
|
+
This is cool
|
103
|
+
"""
|
104
|
+
Then the song should have 2 lines
|
105
|
+
```
|
106
|
+
|
107
|
+
![doc string](./images/doc_string.png)
|
108
|
+
|
109
|
+
### Other failure pattern
|
110
|
+
|
111
|
+
Use `aggregate_failures`:
|
90
112
|
|
91
113
|
```feature
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
| basilisk |
|
106
|
-
When I escape
|
107
|
-
Then I could not escape
|
114
|
+
@aggregate_failures
|
115
|
+
Scenario: [ERROR] boss monster (aggregate_failures)
|
116
|
+
|
117
|
+
Even if error occurs during steps, test will run to the end
|
118
|
+
|
119
|
+
Given there is a boss monster
|
120
|
+
When I attack it
|
121
|
+
Then it should die
|
122
|
+
When I attack it
|
123
|
+
Then it should die
|
124
|
+
When I attack it
|
125
|
+
Then it should die
|
126
|
+
And Fanfare
|
108
127
|
```
|
109
128
|
|
110
|
-
![
|
129
|
+
![aggregate failures](./images/aggregate_failures.png)
|
130
|
+
|
111
131
|
|
112
|
-
|
132
|
+
Occur error before and after hook:
|
133
|
+
|
134
|
+
```ruby
|
135
|
+
RSpec.configure do |config|
|
136
|
+
config.before(:example, before_hook_error: true) do
|
137
|
+
undefined_method # NameError
|
138
|
+
end
|
139
|
+
|
140
|
+
config.after(:example, after_hook_error: true) do
|
141
|
+
expect(true).to be false # RSpec Matcher Error
|
142
|
+
end
|
143
|
+
end
|
144
|
+
```
|
113
145
|
|
114
146
|
```feature
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
147
|
+
@before_hook_error
|
148
|
+
Scenario: [ERROR] Error in before hook
|
149
|
+
Given there is a monster
|
150
|
+
When I attack it
|
151
|
+
Then it should die
|
152
|
+
And Fanfare
|
153
|
+
|
154
|
+
@after_hook_error
|
155
|
+
Scenario: [ERROR] Error in after hook
|
156
|
+
Given there is a monster
|
157
|
+
When I attack it
|
158
|
+
Then it should die
|
159
|
+
And Fanfare
|
123
160
|
```
|
124
161
|
|
125
|
-
![
|
162
|
+
![before hook](./images/before_hook.png)
|
163
|
+
|
164
|
+
![after hook](./images/after_hook.png)
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/turnip_formatter.gemspec
CHANGED
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.require_paths = ['lib']
|
20
20
|
|
21
21
|
spec.add_dependency 'turnip', '~> 3.0.0'
|
22
|
-
spec.add_dependency 'rspec', [">=3.3", "<
|
22
|
+
spec.add_dependency 'rspec', [">=3.3", "<4.0"]
|
23
23
|
|
24
24
|
# For ruby >= 2.1
|
25
25
|
spec.add_dependency 'activesupport', '~> 4.2.7'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: turnip_formatter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Wataru MIYAGUNI
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-04-
|
11
|
+
date: 2017-04-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: turnip
|
@@ -33,7 +33,7 @@ dependencies:
|
|
33
33
|
version: '3.3'
|
34
34
|
- - "<"
|
35
35
|
- !ruby/object:Gem::Version
|
36
|
-
version: '
|
36
|
+
version: '4.0'
|
37
37
|
type: :runtime
|
38
38
|
prerelease: false
|
39
39
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -43,7 +43,7 @@ dependencies:
|
|
43
43
|
version: '3.3'
|
44
44
|
- - "<"
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version: '
|
46
|
+
version: '4.0'
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: activesupport
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
@@ -185,11 +185,14 @@ files:
|
|
185
185
|
- Rakefile
|
186
186
|
- example/.rspec
|
187
187
|
- example/README.md
|
188
|
+
- example/images/after_hook.png
|
189
|
+
- example/images/aggregate_failures.png
|
188
190
|
- example/images/background.png
|
189
191
|
- example/images/basic_step.png
|
192
|
+
- example/images/before_hook.png
|
193
|
+
- example/images/data_table.png
|
194
|
+
- example/images/doc_string.png
|
190
195
|
- example/images/failed_step.png
|
191
|
-
- example/images/multiline.png
|
192
|
-
- example/images/outline.png
|
193
196
|
- example/images/pending_step.png
|
194
197
|
- example/spec/bar.js
|
195
198
|
- example/spec/features/argument.feature
|
@@ -204,6 +207,7 @@ files:
|
|
204
207
|
- example/spec/steps/steps.rb
|
205
208
|
- gemfiles/Gemfile-rspec-3.3.x
|
206
209
|
- gemfiles/Gemfile-rspec-3.4.x
|
210
|
+
- gemfiles/Gemfile-rspec-3.5.x
|
207
211
|
- lib/rspec/core/formatters/turnip_formatter.rb
|
208
212
|
- lib/turnip_formatter.rb
|
209
213
|
- lib/turnip_formatter/ext/turnip/rspec.rb
|
Binary file
|
data/example/images/outline.png
DELETED
Binary file
|