turnip_formatter 0.2.0 → 0.2.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/README.md +1 -1
- data/example/.rspec +3 -0
- data/example/README.md +2 -1
- data/example/{features → spec/features}/battle.feature +0 -0
- data/example/{features → spec/features}/battle2.feature +0 -0
- data/example/{features → spec/features}/battle3.feature +10 -1
- data/example/{features → spec/features}/songs.feature +0 -0
- data/example/{spec_helper.rb → spec/spec_helper.rb} +0 -1
- data/example/spec/steps/escape_steps.rb +25 -0
- data/example/{steps → spec/steps}/spell_steps.rb +0 -0
- data/example/{steps → spec/steps}/steps.rb +0 -12
- data/lib/turnip_formatter/ext/turnip/rspec.rb +10 -5
- data/lib/turnip_formatter/template/section_report.erb +2 -2
- data/lib/turnip_formatter/template.rb +3 -0
- data/lib/turnip_formatter/version.rb +1 -1
- metadata +11 -9
data/README.md
CHANGED
data/example/.rspec
ADDED
data/example/README.md
CHANGED
File without changes
|
File without changes
|
@@ -1,6 +1,6 @@
|
|
1
|
+
@escape
|
1
2
|
Feature: Battle monsters
|
2
3
|
|
3
|
-
@watch
|
4
4
|
Scenario: Escape
|
5
5
|
Given there are monsters:
|
6
6
|
| gargoyle |
|
@@ -15,3 +15,12 @@ Feature: Battle monsters
|
|
15
15
|
| basilisk |
|
16
16
|
When I escape
|
17
17
|
Then I could not escape
|
18
|
+
|
19
|
+
@master_of_escape
|
20
|
+
Scenario: Escape because he is master
|
21
|
+
Given there are monsters:
|
22
|
+
| gargoyle |
|
23
|
+
| Cockatrice |
|
24
|
+
| basilisk |
|
25
|
+
When I escape
|
26
|
+
Then I was able to escape
|
File without changes
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module Escape
|
2
|
+
step "I escape" do
|
3
|
+
@escape_result = (@monsters.count <= 2)
|
4
|
+
end
|
5
|
+
|
6
|
+
step "I was able to escape" do
|
7
|
+
expect(@escape_result).to be_true
|
8
|
+
end
|
9
|
+
|
10
|
+
step "I could not escape" do
|
11
|
+
expect(@escape_result).to be_false
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
steps_for :escape do
|
16
|
+
include Escape
|
17
|
+
end
|
18
|
+
|
19
|
+
steps_for :master_of_escape do
|
20
|
+
include Escape
|
21
|
+
|
22
|
+
step "I escape" do
|
23
|
+
@escape_result = (@monsters.count <= 100)
|
24
|
+
end
|
25
|
+
end
|
File without changes
|
@@ -32,18 +32,6 @@ step "there are monsters:" do |monsters|
|
|
32
32
|
@monsters = monsters.map { |row| row[0] }
|
33
33
|
end
|
34
34
|
|
35
|
-
step "I escape" do
|
36
|
-
@escape_result = (@monsters.count <= 2)
|
37
|
-
end
|
38
|
-
|
39
|
-
step "I was able to escape" do
|
40
|
-
expect(@escape_result).to be_true
|
41
|
-
end
|
42
|
-
|
43
|
-
step "I could not escape" do
|
44
|
-
expect(@escape_result).to be_false
|
45
|
-
end
|
46
|
-
|
47
35
|
step "the monster sings the following song" do |song|
|
48
36
|
@song = song
|
49
37
|
end
|
@@ -26,7 +26,7 @@ module Turnip
|
|
26
26
|
keyword: step.keyword
|
27
27
|
}
|
28
28
|
end
|
29
|
-
turnip[:tags]
|
29
|
+
turnip[:tags] += scenario.tags if scenario.respond_to?(:tags)
|
30
30
|
end
|
31
31
|
end
|
32
32
|
end
|
@@ -35,15 +35,19 @@ module Turnip
|
|
35
35
|
def run(feature_file)
|
36
36
|
Turnip::Builder.build(feature_file).features.each do |feature|
|
37
37
|
describe feature.name, feature.metadata_hash do
|
38
|
-
let
|
39
|
-
feature.backgrounds
|
38
|
+
let(:backgrounds) do
|
39
|
+
feature.backgrounds
|
40
|
+
end
|
41
|
+
|
42
|
+
let(:background_steps) do
|
43
|
+
backgrounds.map(&:steps).flatten
|
40
44
|
end
|
41
45
|
|
42
46
|
before do
|
43
47
|
example.metadata[:file_path] = feature_file
|
44
|
-
example.metadata[:turnip_formatter] = { steps: [], tags:
|
48
|
+
example.metadata[:turnip_formatter] = { steps: [], tags: feature.tags }
|
45
49
|
|
46
|
-
|
50
|
+
backgrounds.each do |background|
|
47
51
|
push_scenario_metadata(background)
|
48
52
|
end
|
49
53
|
|
@@ -51,6 +55,7 @@ module Turnip
|
|
51
55
|
run_step(feature_file, step, index)
|
52
56
|
end
|
53
57
|
end
|
58
|
+
|
54
59
|
feature.scenarios.each do |scenario|
|
55
60
|
describe scenario.name, scenario.metadata_hash do
|
56
61
|
before do
|
@@ -1,9 +1,9 @@
|
|
1
1
|
<div id="report">
|
2
2
|
<h1>Turnip Report</h1>
|
3
3
|
<section class="checkbox">
|
4
|
-
<label for="passed_check">Passed</label><input type="checkbox"
|
4
|
+
<label for="passed_check">Passed</label><input type="checkbox" id="passed_check">
|
5
5
|
<label for="failed_check">Failed</label><input type="checkbox" checked id="failed_check">
|
6
|
-
<label for="pending_check">Pending</label><input type="checkbox"
|
6
|
+
<label for="pending_check">Pending</label><input type="checkbox" id="pending_check">
|
7
7
|
</section>
|
8
8
|
|
9
9
|
<section class="result">
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: turnip_formatter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-07-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: turnip
|
@@ -122,11 +122,8 @@ files:
|
|
122
122
|
- LICENSE.txt
|
123
123
|
- README.md
|
124
124
|
- Rakefile
|
125
|
+
- example/.rspec
|
125
126
|
- example/README.md
|
126
|
-
- example/features/battle.feature
|
127
|
-
- example/features/battle2.feature
|
128
|
-
- example/features/battle3.feature
|
129
|
-
- example/features/songs.feature
|
130
127
|
- example/images/background.png
|
131
128
|
- example/images/basic_step.png
|
132
129
|
- example/images/failed_step.png
|
@@ -134,9 +131,14 @@ files:
|
|
134
131
|
- example/images/outline.png
|
135
132
|
- example/images/pending_step.png
|
136
133
|
- example/images/tag_step.png
|
137
|
-
- example/
|
138
|
-
- example/
|
139
|
-
- example/
|
134
|
+
- example/spec/features/battle.feature
|
135
|
+
- example/spec/features/battle2.feature
|
136
|
+
- example/spec/features/battle3.feature
|
137
|
+
- example/spec/features/songs.feature
|
138
|
+
- example/spec/spec_helper.rb
|
139
|
+
- example/spec/steps/escape_steps.rb
|
140
|
+
- example/spec/steps/spell_steps.rb
|
141
|
+
- example/spec/steps/steps.rb
|
140
142
|
- images/tab_feature_statistics.png
|
141
143
|
- images/tab_speed_statistics.png
|
142
144
|
- images/tab_steps.png
|