turnip_formatter 0.2.4 → 0.2.5

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.
@@ -57,12 +57,17 @@ module TurnipFormatter
57
57
  #
58
58
  def group_by_tag(scenarios)
59
59
  scenarios.map do |scenario|
60
- if scenario.tags.empty?
61
- { name: 'turnip', scenario: scenario }
62
- else
63
- scenario.tags.map do |tag|
64
- { name: '@' + tag, scenario: scenario }
60
+ begin
61
+ scenario.validation
62
+ if scenario.tags.empty?
63
+ { name: 'turnip', scenario: scenario }
64
+ else
65
+ scenario.tags.map do |tag|
66
+ { name: '@' + tag, scenario: scenario }
67
+ end
65
68
  end
69
+ rescue
70
+ { name: 'runtime error', scenario: scenario }
66
71
  end
67
72
  end.flatten.group_by { |s| s[:name] }.sort
68
73
  end
@@ -1,5 +1,5 @@
1
1
  # -*- coding: utf-8 -*-
2
2
 
3
3
  module TurnipFormatter
4
- VERSION = "0.2.4"
4
+ VERSION = "0.2.5"
5
5
  end
@@ -23,24 +23,28 @@ module TurnipFormatter::Printer
23
23
  # Failed scenario have tags @hoge and @fuga
24
24
  scenario = base_scenario.dup
25
25
  scenario.stub(:tags).and_return(['foo', 'bar'])
26
+ scenario.stub(:validation).and_return(true)
26
27
  scenario.stub(:status).and_return('failed')
27
28
  scenarios << scenario
28
29
 
29
30
  # Passed scenario no have tags
30
31
  scenario = base_scenario.dup
31
32
  scenario.stub(:tags).and_return([])
33
+ scenario.stub(:validation).and_return(true)
32
34
  scenario.stub(:status).and_return('passed')
33
35
  scenarios << scenario
34
36
 
35
37
  # Passed scenario have tags @hoge
36
38
  scenario = base_scenario.dup
37
39
  scenario.stub(:tags).and_return(['hoge'])
40
+ scenario.stub(:validation).and_return(true)
38
41
  scenario.stub(:status).and_return('passed')
39
42
  scenarios << scenario
40
43
 
41
44
  # Pending scenario have tags @fuga and @hago
42
45
  scenario = base_scenario.dup
43
46
  scenario.stub(:tags).and_return(['bar', 'hoge'])
47
+ scenario.stub(:validation).and_return(true)
44
48
  scenario.stub(:status).and_return('pending')
45
49
  scenarios << scenario
46
50
  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.4
4
+ version: 0.2.5
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-07-23 00:00:00.000000000 Z
12
+ date: 2013-08-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: turnip