wally 0.0.3 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,8 @@
1
+ Feature: Example with tags
2
+ In order to
3
+ As a bla
4
+ I want bla
5
+
6
+ @wip
7
+ Scenario: Do some stuff
8
+ Given I do some stuff
@@ -82,6 +82,18 @@ Feature: Browse Features
82
82
  And I should see "tag1"
83
83
  And I should see "tag2"
84
84
 
85
+ Scenario: View Scenario Tags On Scenario Page
86
+ Given a feature file named "sample.feature" with the contents:
87
+ """
88
+ Feature: Sample Feature
89
+
90
+ @tag1 @tag2
91
+ Scenario: Sample Aidy
92
+ """
93
+ When I visit the sample feature page
94
+ Then I should see "tag1"
95
+ And I should see "tag2"
96
+
85
97
  Scenario: View Scenario Background
86
98
  Given a feature file named "sample.feature" with the contents:
87
99
  """
@@ -16,22 +16,17 @@ def lists_features
16
16
  end
17
17
 
18
18
  before do
19
- #probably remove this if not needed
20
19
  @features = lists_features.features
21
20
  end
22
21
 
23
22
  get '/?' do
24
- @features = lists_features.features
25
23
  haml :index
26
24
  end
27
25
 
28
26
  get '/features/:feature/?' do |feature|
29
- features = lists_features.features
30
- features.each do |feature_hash|
27
+ @features.each do |feature_hash|
31
28
  @feature = feature_hash if feature_hash["id"] == feature
32
29
  end
33
-
34
- get_scenario_urls
35
30
  haml :feature
36
31
  end
37
32
 
@@ -43,7 +38,7 @@ get '/search/?' do
43
38
  end
44
39
 
45
40
  get '/features/:feature/scenario/:scenario/?' do |feature_id, scenario_id|
46
- lists_features.features.each do |feature|
41
+ @features.each do |feature|
47
42
  if feature["id"] == feature_id
48
43
  feature["elements"].each do |element|
49
44
  if element["type"] == "background"
@@ -58,15 +53,20 @@ get '/features/:feature/scenario/:scenario/?' do |feature_id, scenario_id|
58
53
  haml :scenario
59
54
  end
60
55
 
61
- def get_scenario_urls
62
- @scenario_urls = {}
63
- return unless @feature
64
- if @feature["elements"]
65
- @feature["elements"].each do |element|
56
+ def get_scenario_url(scenario)
57
+ url = "/features/#{scenario["id"].gsub(";", "/scenario/")}"
58
+ end
59
+
60
+ def get_sorted_scenarios(feature)
61
+ scenarios = []
62
+
63
+ if feature["elements"]
64
+ feature["elements"].each do |element|
66
65
  if element["type"] == "scenario"
67
- url = "/features/#{element["id"].gsub(";", "/scenario/")}"
68
- @scenario_urls[element["name"]] = url
66
+ scenarios << element
69
67
  end
70
68
  end
71
69
  end
70
+ scenarios.sort! { |a, b| a["name"] <=> b["name"] }
71
+ scenarios
72
72
  end
data/lib/wally/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Wally
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.5"
3
3
  end
@@ -5,7 +5,10 @@
5
5
  :markdown
6
6
  #{@feature["description"]}
7
7
  %ul
8
- - @scenario_urls.keys.sort.each do |name|
9
- %li
10
- %a{:href => @scenario_urls[name]}
11
- = name
8
+ - get_sorted_scenarios(@feature).each do |scenario|
9
+ %a{:href => get_scenario_url(scenario)}
10
+ = scenario["name"]
11
+ - if scenario["tags"]
12
+ - scenario["tags"].each do |tag|
13
+ %span.label.notice
14
+ = tag["name"]
data/wally.gemspec CHANGED
@@ -21,6 +21,7 @@ Gem::Specification.new do |s|
21
21
  s.add_runtime_dependency "sinatra"
22
22
  s.add_runtime_dependency "haml"
23
23
  s.add_runtime_dependency "rdiscount"
24
+ s.add_runtime_dependency "gherkin"
24
25
 
25
26
  s.add_development_dependency "cucumber"
26
27
  s.add_development_dependency "capybara"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wally
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2011-11-22 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sinatra
16
- requirement: &70228063971540 !ruby/object:Gem::Requirement
16
+ requirement: &70185102349080 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70228063971540
24
+ version_requirements: *70185102349080
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: haml
27
- requirement: &70228063971120 !ruby/object:Gem::Requirement
27
+ requirement: &70185102348660 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70228063971120
35
+ version_requirements: *70185102348660
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rdiscount
38
- requirement: &70228063970700 !ruby/object:Gem::Requirement
38
+ requirement: &70185102348240 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,21 @@ dependencies:
43
43
  version: '0'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *70228063970700
46
+ version_requirements: *70185102348240
47
+ - !ruby/object:Gem::Dependency
48
+ name: gherkin
49
+ requirement: &70185102347820 !ruby/object:Gem::Requirement
50
+ none: false
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ type: :runtime
56
+ prerelease: false
57
+ version_requirements: *70185102347820
47
58
  - !ruby/object:Gem::Dependency
48
59
  name: cucumber
49
- requirement: &70228063970280 !ruby/object:Gem::Requirement
60
+ requirement: &70185102347400 !ruby/object:Gem::Requirement
50
61
  none: false
51
62
  requirements:
52
63
  - - ! '>='
@@ -54,10 +65,10 @@ dependencies:
54
65
  version: '0'
55
66
  type: :development
56
67
  prerelease: false
57
- version_requirements: *70228063970280
68
+ version_requirements: *70185102347400
58
69
  - !ruby/object:Gem::Dependency
59
70
  name: capybara
60
- requirement: &70228063969860 !ruby/object:Gem::Requirement
71
+ requirement: &70185102346980 !ruby/object:Gem::Requirement
61
72
  none: false
62
73
  requirements:
63
74
  - - ! '>='
@@ -65,10 +76,10 @@ dependencies:
65
76
  version: '0'
66
77
  type: :development
67
78
  prerelease: false
68
- version_requirements: *70228063969860
79
+ version_requirements: *70185102346980
69
80
  - !ruby/object:Gem::Dependency
70
81
  name: rspec
71
- requirement: &70228063969440 !ruby/object:Gem::Requirement
82
+ requirement: &70185102346560 !ruby/object:Gem::Requirement
72
83
  none: false
73
84
  requirements:
74
85
  - - ! '>='
@@ -76,10 +87,10 @@ dependencies:
76
87
  version: '0'
77
88
  type: :development
78
89
  prerelease: false
79
- version_requirements: *70228063969440
90
+ version_requirements: *70185102346560
80
91
  - !ruby/object:Gem::Dependency
81
92
  name: fakefs
82
- requirement: &70228063969020 !ruby/object:Gem::Requirement
93
+ requirement: &70185102337160 !ruby/object:Gem::Requirement
83
94
  none: false
84
95
  requirements:
85
96
  - - ! '>='
@@ -87,7 +98,7 @@ dependencies:
87
98
  version: '0'
88
99
  type: :development
89
100
  prerelease: false
90
- version_requirements: *70228063969020
101
+ version_requirements: *70185102337160
91
102
  description: ''
92
103
  email:
93
104
  - andrew.vos@gmail.com
@@ -103,6 +114,7 @@ files:
103
114
  - Rakefile
104
115
  - bin/wally
105
116
  - config.ru
117
+ - example-features/example_with_tags.feature
106
118
  - features/browse_features.feature
107
119
  - features/search_features.feature
108
120
  - features/step_definitions/browse_features_steps.rb