wally 0.0.33 → 0.0.34

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. data/README.md +5 -3
  2. data/Rakefile +4 -0
  3. data/features/counts.feature +10 -3
  4. data/features/feature_page.feature +17 -9
  5. data/features/list_tags.feature +5 -5
  6. data/features/notifications.feature +1 -1
  7. data/features/progress_bar.feature +25 -0
  8. data/features/{home_page.feature → project_home.feature} +3 -16
  9. data/features/projects.feature +12 -0
  10. data/features/push_features.feature +4 -4
  11. data/features/scenario_page.feature +4 -27
  12. data/features/search_features.feature +7 -7
  13. data/features/step_definitions/feature_page_steps.rb +15 -0
  14. data/features/step_definitions/notifications_steps.rb +1 -1
  15. data/features/step_definitions/project_home_steps.rb +10 -0
  16. data/features/step_definitions/projects_steps.rb +11 -0
  17. data/features/step_definitions/push_features_steps.rb +10 -6
  18. data/features/step_definitions/scenario_page_steps.rb +15 -0
  19. data/features/step_definitions/search_features_steps.rb +1 -1
  20. data/features/step_definitions/steps.rb +15 -3
  21. data/features/step_definitions/welcome_page.rb +19 -0
  22. data/features/support/env.rb +28 -6
  23. data/features/welcome_page.feature +30 -0
  24. data/lib/wally.rb +0 -3
  25. data/lib/wally/application.rb +39 -22
  26. data/lib/wally/counts_tags.rb +3 -3
  27. data/lib/wally/feature.rb +1 -1
  28. data/lib/wally/project.rb +8 -0
  29. data/lib/wally/public/scripts/projects.js +6 -0
  30. data/lib/wally/public/skin.css +7 -0
  31. data/lib/wally/search_features.rb +1 -1
  32. data/lib/wally/version.rb +1 -1
  33. data/lib/wally/views/feature_link.haml +1 -1
  34. data/lib/wally/views/layout.haml +32 -21
  35. data/lib/wally/views/{index.haml → project.haml} +0 -0
  36. data/lib/wally/views/search.haml +3 -3
  37. data/spec/spec_helper.rb +24 -0
  38. data/spec/wally/counts_tags_spec.rb +10 -22
  39. data/spec/wally/feature_spec.rb +12 -15
  40. data/spec/wally/project_spec.rb +18 -0
  41. data/spec/wally/search_features_spec.rb +18 -25
  42. data/wally.gemspec +1 -0
  43. metadata +58 -29
  44. data/features/step_definitions/browse_features_steps.rb +0 -47
@@ -2,28 +2,25 @@ require File.join(File.dirname(__FILE__), "..", "spec_helper")
2
2
 
3
3
  module Wally
4
4
  describe Feature do
5
- after do
6
- Feature.delete_all
7
- end
8
-
9
- subject { Feature.new }
10
-
11
5
  it "stores a feature path" do
12
- subject.path = "hello.feature"
13
- subject.save
14
- Feature.all.first.path.should == "hello.feature"
6
+ project = project("project")
7
+ project.features << Feature.new(:path => "hello.feature")
8
+ project.save
9
+ Project.first.features.first.path.should == "hello.feature"
15
10
  end
16
11
 
17
12
  it "stores the feature content" do
18
- subject.gherkin = {"meh" => "ble"}
19
- subject.save
20
- Feature.all.first.gherkin.should == {"meh" => "ble"}
13
+ project = project("project")
14
+ project.features << Feature.new(:gherkin => {"meh" => "ble"})
15
+ project.save
16
+ Project.first.features.first.gherkin.should == {"meh" => "ble"}
21
17
  end
22
18
 
23
19
  it "stores the feature name" do
24
- subject.gherkin = {"name" => "ble"}
25
- subject.save
26
- Feature.all.first.name.should == "ble"
20
+ project = project("project")
21
+ project.features << Feature.new(:gherkin => {"name" => "ble"})
22
+ project.save
23
+ Project.first.features.first.name.should == "ble"
27
24
  end
28
25
  end
29
26
  end
@@ -0,0 +1,18 @@
1
+ require File.join(File.dirname(__FILE__), "..", "spec_helper")
2
+ require 'fileutils'
3
+
4
+ module Wally
5
+ describe Project do
6
+ it "stores a name" do
7
+ Project.create(:name => "project1")
8
+ Project.first.name.should == "project1"
9
+ end
10
+
11
+ it "stores features" do
12
+ Project.create({:name => "project2", :features => [
13
+ Feature.new(:path => "feature/path")
14
+ ]})
15
+ Project.first.features.first.path.should == "feature/path"
16
+ end
17
+ end
18
+ end
@@ -3,42 +3,35 @@ require File.join(File.dirname(__FILE__), "..", "spec_helper")
3
3
  module Wally
4
4
  describe SearchFeatures do
5
5
  after do
6
- Feature.delete_all
7
- end
8
-
9
- def create_feature path, content
10
- feature = Feature.new
11
- feature.path = path
12
- feature.gherkin = ParsesFeatures.new.parse(content)
13
- feature.save
6
+ Project.delete_all
14
7
  end
15
8
 
16
9
  it "finds features containing text" do
17
- create_feature("sample1.feature", "Feature: Bla")
18
- create_feature("sample2.feature", "Feature: Meh")
10
+ create_feature("project", "sample1.feature", "Feature: Bla")
11
+ create_feature("project", "sample2.feature", "Feature: Meh")
19
12
 
20
- results = SearchFeatures.new(Feature).find(:query => "Meh")
13
+ results = SearchFeatures.new(project("project")).find(:query => "Meh")
21
14
  results.items.size.should == 1
22
15
  results.items.first.object.feature["name"].should == "Meh"
23
16
  end
24
17
 
25
18
  it "finds features by narrative" do
26
- create_feature("sample1.feature", "Feature: bla\nIn order to bananas")
27
- results = SearchFeatures.new(Feature).find(:query => "bananas")
19
+ create_feature("project", "sample1.feature", "Feature: bla\nIn order to bananas")
20
+ results = SearchFeatures.new(project("project")).find(:query => "bananas")
28
21
  results.items.size.should == 1
29
22
  results.items.first.object.feature["name"].should == "bla"
30
23
  end
31
24
 
32
25
  it "has a suggestion" do
33
- create_feature("sample1.feature", "Feature: Monkeys")
34
- results = SearchFeatures.new(Feature).find(:query => "mnkeys")
26
+ create_feature("project", "sample1.feature", "Feature: Monkeys")
27
+ results = SearchFeatures.new(project("project")).find(:query => "mnkeys")
35
28
  results.suggestion.should == "Monkeys"
36
29
  end
37
30
 
38
31
  it "has a suggestion only when it's different from the search query" do
39
- create_feature("sample1.feature", "Feature: monkeys\nScenario: feature")
40
- create_feature("sample2.feature", "Feature: dogs\nScenario: Sample scenario")
41
- results = SearchFeatures.new(Feature).find(:query => "feature")
32
+ create_feature("project", "sample1.feature", "Feature: monkeys\nScenario: feature")
33
+ create_feature("project", "sample2.feature", "Feature: dogs\nScenario: Sample scenario")
34
+ results = SearchFeatures.new(project("project")).find(:query => "feature")
42
35
  results.suggestion.should be_nil
43
36
  end
44
37
 
@@ -51,17 +44,17 @@ module Wally
51
44
  Given I eat some doughnuts
52
45
  Scenario: Another Scenario
53
46
  CONTENTS
54
- create_feature("sample1.feature", contents)
47
+ create_feature("project", "sample1.feature", contents)
55
48
  end
56
49
 
57
50
  it "finds scenarios containing text" do
58
- results = SearchFeatures.new(Feature).find(:query => "MATCHED")
51
+ results = SearchFeatures.new(project("project")).find(:query => "MATCHED")
59
52
  results.items.size.should == 1
60
53
  results.items.first.object.scenario["name"].should == "Matched Scenario"
61
54
  end
62
55
 
63
56
  it "finds scenario steps" do
64
- results = SearchFeatures.new(Feature).find(:query => "DOUGHNUTS")
57
+ results = SearchFeatures.new(project("project")).find(:query => "DOUGHNUTS")
65
58
  results.items.size.should == 1
66
59
  results.items.first.object.scenario["name"].should == "Matched Scenario"
67
60
  end
@@ -69,14 +62,14 @@ module Wally
69
62
 
70
63
  context "feature with tags" do
71
64
  it "finds features by tag" do
72
- create_feature("example-feature.feature", "@tag_name\nFeature: Example Feature")
73
- results = SearchFeatures.new(Feature).find(:query => "@tag_NAME")
65
+ create_feature("project", "example-feature.feature", "@tag_name\nFeature: Example Feature")
66
+ results = SearchFeatures.new(project("project")).find(:query => "@tag_NAME")
74
67
  results.items.first.object.feature["name"].should == "Example Feature"
75
68
  end
76
69
 
77
70
  it "finds scenarios by tag" do
78
- create_feature("example-feature.feature", "Feature: Example Feature\n@scenario_tag\nScenario: Example Scenario")
79
- results = SearchFeatures.new(Feature).find(:query => "@scenario_TAG")
71
+ create_feature("project", "example-feature.feature", "Feature: Example Feature\n@scenario_tag\nScenario: Example Scenario")
72
+ results = SearchFeatures.new(project("project")).find(:query => "@scenario_TAG")
80
73
  results.items.first.object.scenario["name"].should == "Example Scenario"
81
74
  end
82
75
  end
data/wally.gemspec CHANGED
@@ -30,4 +30,5 @@ Gem::Specification.new do |s|
30
30
  s.add_development_dependency "rspec"
31
31
  s.add_development_dependency "fakefs"
32
32
  s.add_development_dependency "launchy"
33
+ s.add_development_dependency "headless"
33
34
  end
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.33
4
+ version: 0.0.34
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-12-05 00:00:00.000000000Z
12
+ date: 2012-02-07 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rest-client
16
- requirement: &70273055842980 !ruby/object:Gem::Requirement
16
+ requirement: &70354211205960 !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: *70273055842980
24
+ version_requirements: *70354211205960
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: sinatra
27
- requirement: &70273055842460 !ruby/object:Gem::Requirement
27
+ requirement: &70354211205280 !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: *70273055842460
35
+ version_requirements: *70354211205280
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: haml
38
- requirement: &70273055841960 !ruby/object:Gem::Requirement
38
+ requirement: &70354211204200 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *70273055841960
46
+ version_requirements: *70354211204200
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rdiscount
49
- requirement: &70273055841540 !ruby/object:Gem::Requirement
49
+ requirement: &70354211203620 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *70273055841540
57
+ version_requirements: *70354211203620
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: gherkin
60
- requirement: &70273055841060 !ruby/object:Gem::Requirement
60
+ requirement: &70354211202840 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: '0'
66
66
  type: :runtime
67
67
  prerelease: false
68
- version_requirements: *70273055841060
68
+ version_requirements: *70354211202840
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: komainu
71
- requirement: &70273055840520 !ruby/object:Gem::Requirement
71
+ requirement: &70354211201740 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: '0'
77
77
  type: :runtime
78
78
  prerelease: false
79
- version_requirements: *70273055840520
79
+ version_requirements: *70354211201740
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: cucumber
82
- requirement: &70273055839980 !ruby/object:Gem::Requirement
82
+ requirement: &70354211200340 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ! '>='
@@ -87,10 +87,10 @@ dependencies:
87
87
  version: '0'
88
88
  type: :development
89
89
  prerelease: false
90
- version_requirements: *70273055839980
90
+ version_requirements: *70354211200340
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: capybara
93
- requirement: &70273055839440 !ruby/object:Gem::Requirement
93
+ requirement: &70354211199000 !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
96
96
  - - ! '>='
@@ -98,10 +98,10 @@ dependencies:
98
98
  version: '0'
99
99
  type: :development
100
100
  prerelease: false
101
- version_requirements: *70273055839440
101
+ version_requirements: *70354211199000
102
102
  - !ruby/object:Gem::Dependency
103
103
  name: rspec
104
- requirement: &70273055838900 !ruby/object:Gem::Requirement
104
+ requirement: &70354211197380 !ruby/object:Gem::Requirement
105
105
  none: false
106
106
  requirements:
107
107
  - - ! '>='
@@ -109,10 +109,10 @@ dependencies:
109
109
  version: '0'
110
110
  type: :development
111
111
  prerelease: false
112
- version_requirements: *70273055838900
112
+ version_requirements: *70354211197380
113
113
  - !ruby/object:Gem::Dependency
114
114
  name: fakefs
115
- requirement: &70273055838360 !ruby/object:Gem::Requirement
115
+ requirement: &70354211196400 !ruby/object:Gem::Requirement
116
116
  none: false
117
117
  requirements:
118
118
  - - ! '>='
@@ -120,10 +120,10 @@ dependencies:
120
120
  version: '0'
121
121
  type: :development
122
122
  prerelease: false
123
- version_requirements: *70273055838360
123
+ version_requirements: *70354211196400
124
124
  - !ruby/object:Gem::Dependency
125
125
  name: launchy
126
- requirement: &70273055837820 !ruby/object:Gem::Requirement
126
+ requirement: &70354211194680 !ruby/object:Gem::Requirement
127
127
  none: false
128
128
  requirements:
129
129
  - - ! '>='
@@ -131,7 +131,18 @@ dependencies:
131
131
  version: '0'
132
132
  type: :development
133
133
  prerelease: false
134
- version_requirements: *70273055837820
134
+ version_requirements: *70354211194680
135
+ - !ruby/object:Gem::Dependency
136
+ name: headless
137
+ requirement: &70354211192800 !ruby/object:Gem::Requirement
138
+ none: false
139
+ requirements:
140
+ - - ! '>='
141
+ - !ruby/object:Gem::Version
142
+ version: '0'
143
+ type: :development
144
+ prerelease: false
145
+ version_requirements: *70354211192800
135
146
  description: ''
136
147
  email:
137
148
  - andrew.vos@gmail.com
@@ -155,33 +166,42 @@ files:
155
166
  - example-features/too-many-wip-tags/too-many-wip-tags.feature
156
167
  - features/counts.feature
157
168
  - features/feature_page.feature
158
- - features/home_page.feature
159
169
  - features/list_tags.feature
160
170
  - features/notifications.feature
171
+ - features/progress_bar.feature
172
+ - features/project_home.feature
173
+ - features/projects.feature
161
174
  - features/push_features.feature
162
175
  - features/scenario_page.feature
163
176
  - features/search_features.feature
164
- - features/step_definitions/browse_features_steps.rb
177
+ - features/step_definitions/feature_page_steps.rb
165
178
  - features/step_definitions/notifications_steps.rb
179
+ - features/step_definitions/project_home_steps.rb
180
+ - features/step_definitions/projects_steps.rb
166
181
  - features/step_definitions/push_features_steps.rb
182
+ - features/step_definitions/scenario_page_steps.rb
167
183
  - features/step_definitions/search_features_steps.rb
168
184
  - features/step_definitions/steps.rb
185
+ - features/step_definitions/welcome_page.rb
169
186
  - features/support/env.rb
187
+ - features/welcome_page.feature
170
188
  - lib/wally.rb
171
189
  - lib/wally/application.rb
172
190
  - lib/wally/counts_tags.rb
173
191
  - lib/wally/feature.rb
174
192
  - lib/wally/parses_features.rb
193
+ - lib/wally/project.rb
175
194
  - lib/wally/public/bootstrap.min.css
195
+ - lib/wally/public/scripts/projects.js
176
196
  - lib/wally/public/skin.css
177
197
  - lib/wally/public/wally-logo.png
178
198
  - lib/wally/search_features.rb
179
199
  - lib/wally/version.rb
180
200
  - lib/wally/views/feature.haml
181
201
  - lib/wally/views/feature_link.haml
182
- - lib/wally/views/index.haml
183
202
  - lib/wally/views/layout.haml
184
203
  - lib/wally/views/progress.haml
204
+ - lib/wally/views/project.haml
185
205
  - lib/wally/views/scenario.haml
186
206
  - lib/wally/views/search.haml
187
207
  - lib/wally/views/tag_links.haml
@@ -189,6 +209,7 @@ files:
189
209
  - spec/wally/counts_tags_spec.rb
190
210
  - spec/wally/feature_spec.rb
191
211
  - spec/wally/parses_features_spec.rb
212
+ - spec/wally/project_spec.rb
192
213
  - spec/wally/search_features_spec.rb
193
214
  - wally.gemspec
194
215
  homepage: ''
@@ -218,20 +239,28 @@ summary: ''
218
239
  test_files:
219
240
  - features/counts.feature
220
241
  - features/feature_page.feature
221
- - features/home_page.feature
222
242
  - features/list_tags.feature
223
243
  - features/notifications.feature
244
+ - features/progress_bar.feature
245
+ - features/project_home.feature
246
+ - features/projects.feature
224
247
  - features/push_features.feature
225
248
  - features/scenario_page.feature
226
249
  - features/search_features.feature
227
- - features/step_definitions/browse_features_steps.rb
250
+ - features/step_definitions/feature_page_steps.rb
228
251
  - features/step_definitions/notifications_steps.rb
252
+ - features/step_definitions/project_home_steps.rb
253
+ - features/step_definitions/projects_steps.rb
229
254
  - features/step_definitions/push_features_steps.rb
255
+ - features/step_definitions/scenario_page_steps.rb
230
256
  - features/step_definitions/search_features_steps.rb
231
257
  - features/step_definitions/steps.rb
258
+ - features/step_definitions/welcome_page.rb
232
259
  - features/support/env.rb
260
+ - features/welcome_page.feature
233
261
  - spec/spec_helper.rb
234
262
  - spec/wally/counts_tags_spec.rb
235
263
  - spec/wally/feature_spec.rb
236
264
  - spec/wally/parses_features_spec.rb
265
+ - spec/wally/project_spec.rb
237
266
  - spec/wally/search_features_spec.rb
@@ -1,47 +0,0 @@
1
- Then /^I should see a link to my sample features$/ do
2
- page.should have_link "Kate Moss", :href => "/features/kate-moss"
3
- page.should have_link "Katie Price", :href => "/features/katie-price"
4
- page.should have_link "Jessica-Jane Clement", :href => "/features/jessica-jane-clement"
5
- page.should have_link "Elle Macpherson", :href => "/features/elle-macpherson"
6
- end
7
-
8
- When /^I visit the sample feature page$/ do
9
- visit "/features/sample-feature"
10
- end
11
-
12
- Then /^I should see the feature free\-form narrative$/ do
13
- page.should have_content "In order to get some value"
14
- page.should have_content "As a person"
15
- page.should have_content "I want to create value"
16
- end
17
-
18
- Then /^I should see Scenario headers as links$/ do
19
- page.body.should have_content "Scenarios"
20
- page.should have_link "Sample Aidy", :href => "/features/sample-feature/scenario/sample-aidy"
21
- page.should have_link "Sample Andrew", :href => "/features/sample-feature/scenario/sample-andrew"
22
- end
23
-
24
- When /^click on a scenario header link$/ do
25
- page.click_link "Sample Aidy"
26
- end
27
-
28
-
29
- Then /^a page appears with the scenario content$/ do
30
- page.body.should have_content "Sample Aidy"
31
- page.body.should have_content "Given my name is \"Aidy\""
32
- page.body.should have_content "When I drink alcohol"
33
- page.body.should have_content "Then I go nuts"
34
- end
35
-
36
- Then /^the background is visible$/ do
37
- page.body.should have_content "Background:"
38
- page.body.should have_content "Given some things"
39
- end
40
-
41
- Then /^the scenario links are sorted$/ do
42
- page.body.should =~ /C.*I.*N.*V/m
43
- end
44
-
45
- Then /^the features are ordered alphabetically$/ do
46
- page.body.should =~ /Elle Macpherson.*Jessica-Jane Clement.*Kate Moss.*Katie Price/m
47
- end