turnip_formatter 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -71,7 +71,7 @@ expand:
71
71
  Example
72
72
  --------------------
73
73
 
74
- see https://github.com/gongo/turnip_formatter/tree/master/spec/examples
74
+ see https://github.com/gongo/turnip_formatter/tree/master/example
75
75
 
76
76
  Add-on
77
77
  --------------------
data/example/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --color
2
+ -r turnip/rspec
3
+ -f progress
data/example/README.md CHANGED
@@ -4,7 +4,8 @@
4
4
 
5
5
  $ cd /path/to/turnip_formatter
6
6
  $ bundle install --path vendor/bundle
7
- $ bundle exec rspec -r ./example/spec_helper example
7
+ $ cd example
8
+ $ bundle exec rspec
8
9
  $ open report.html
9
10
 
10
11
  ## Screenshot
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
@@ -1,4 +1,3 @@
1
- require 'turnip/rspec'
2
1
  require 'turnip_formatter'
3
2
 
4
3
  RSpec.configure do |config|
@@ -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] = scenario.tags if scenario.respond_to?(: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 :background_steps do
39
- feature.backgrounds.map(&:steps).flatten
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
- feature.backgrounds.each do |background|
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" checked id="passed_check">
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" checked id="pending_check">
6
+ <label for="pending_check">Pending</label><input type="checkbox" id="pending_check">
7
7
  </section>
8
8
 
9
9
  <section class="result">
@@ -95,6 +95,9 @@ module TurnipFormatter
95
95
  });
96
96
  });
97
97
 
98
+ $(".scenario.passed").hide();
99
+ $(".scenario.pending").hide();
100
+
98
101
  /**
99
102
  * Tabs
100
103
  */
@@ -1,5 +1,5 @@
1
1
  # -*- coding: utf-8 -*-
2
2
 
3
3
  module TurnipFormatter
4
- VERSION = "0.2.0"
4
+ VERSION = "0.2.1"
5
5
  end
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.0
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-06-26 00:00:00.000000000 Z
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/spec_helper.rb
138
- - example/steps/spell_steps.rb
139
- - example/steps/steps.rb
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