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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 671a78926ca1578069e874dbca23b8fff9514c7b
4
- data.tar.gz: d9a95077cd0cde1860a81c21f85e92b5ea63b08d
3
+ metadata.gz: 48f166296cac27e139daa12290ccd49c35d25fc2
4
+ data.tar.gz: 520f8f44a31a91512c2bbd662623d087137d4385
5
5
  SHA512:
6
- metadata.gz: c488247c66369b917d7864a3e698a5352df9b290557e8ecd45845b75c7e968e774e3fffd12f1877a4f9f4e47721ad384e34fef214f51f60e89479268dfbab109
7
- data.tar.gz: e4f32e51de9127547a980f8361930e19a82632971b76a0afb7c3517766ecc2d29ce5b6a79af53502a76bcda7b6fb74b88afb8ba5a5c93d32823752df5ee3e490
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
@@ -12,7 +12,7 @@ Requirements
12
12
  --------------------
13
13
 
14
14
  * Ruby
15
- * `2.1.0` or later
15
+ * `2.2.0` or later
16
16
 
17
17
  Installation
18
18
  --------------------
data/example/README.md CHANGED
@@ -1,6 +1,8 @@
1
- # TurnipFormatter Demo
1
+ TurnipFormatter Demo
2
+ ==================================================
2
3
 
3
- ## Usage
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
- ## Screenshot
13
+ Screenshot
14
+ ------------------------------
12
15
 
13
- ### Basic step
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 step
28
+ ### Failed scenario
26
29
 
27
30
  ```feature
28
- Scenario: strong monster
31
+ Scenario: [ERROR] strong monster
29
32
 
30
- This scenario will error
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 step and specify tag
43
+ ### Pending scenario
42
44
 
43
45
  ```feature
44
- Scenario: spell magic
45
-
46
- This scenario will error because he can't cast spell
46
+ Scenario: [PENDING] spell magic
47
47
 
48
- Given there is a strong monster
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
- @magician
55
- Scenario: spell magic
56
-
57
- Given there is a strong monster
58
- When I cast a spell 'fireball'
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
- Feature: Battle a monster with weapon
70
-
71
- Background:
72
- Given I equip a weapon
73
-
74
- Scenario: normal monster
75
- Given there is a monster
76
- When I attack it
77
- Then it should die
78
- And Fanfare
79
-
80
- Scenario: strong monster
81
- Given there is a strong monster
82
- When I attack it
83
- Then it should die
84
- And Fanfare
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
- ### Outline
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
- Feature: Battle monsters
93
-
94
- Scenario: Escape
95
- Given there are monsters:
96
- | gargoyle |
97
- | Cockatrice |
98
- When I escape
99
- Then I was able to escape
100
-
101
- Scenario: Inescapable
102
- Given there are monsters:
103
- | gargoyle |
104
- | Cockatrice |
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
- ![outline](./images/outline.png)
129
+ ![aggregate failures](./images/aggregate_failures.png)
130
+
111
131
 
112
- ### Multiline
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
- Feature: A feature with multiline strings
116
- Scenario: This is a feature with multiline strings
117
- When the monster sings the following song
118
- """
119
- Oh here be monsters
120
- This is cool
121
- """
122
- Then the song should have 2 lines
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
- ![Multiline](./images/multiline.png)
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
@@ -2,3 +2,4 @@ source 'http://rubygems.org'
2
2
 
3
3
  gemspec :path => '..'
4
4
  gem 'rspec', '~> 3.3.0'
5
+ gem 'rake', '< 11.0'
@@ -0,0 +1,4 @@
1
+ source 'http://rubygems.org'
2
+
3
+ gemspec :path => '..'
4
+ gem 'rspec', '~> 3.5.0'
@@ -1,5 +1,5 @@
1
1
  # -*- coding: utf-8 -*-
2
2
 
3
3
  module TurnipFormatter
4
- VERSION = '0.6.0'
4
+ VERSION = '0.6.1'
5
5
  end
@@ -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", "<3.5"]
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.0
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-03 00:00:00.000000000 Z
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: '3.5'
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: '3.5'
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
Binary file