cucumber-rails 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cucumber-rails (1.1.0)
4
+ cucumber-rails (1.1.1)
5
5
  capybara (>= 1.1.1)
6
6
  cucumber (>= 1.1.0)
7
7
  nokogiri (>= 1.5.0)
@@ -38,6 +38,11 @@ GEM
38
38
  activesupport (= 3.1.0)
39
39
  activesupport (3.1.0)
40
40
  multi_json (~> 1.0)
41
+ ammeter (0.1.2)
42
+ activesupport (~> 3)
43
+ railties (~> 3)
44
+ rspec (~> 2)
45
+ rspec-rails (~> 2)
41
46
  ansi (1.3.0)
42
47
  arel (2.2.1)
43
48
  aruba (0.4.6)
@@ -93,16 +98,16 @@ GEM
93
98
  mime-types (~> 1.16)
94
99
  treetop (~> 1.4.8)
95
100
  mime-types (1.16)
96
- mongo (1.3.1)
97
- bson (>= 1.3.1)
98
- mongoid (2.2.1)
101
+ mongo (1.4.0)
102
+ bson (= 1.4.0)
103
+ mongoid (2.2.2)
99
104
  activemodel (~> 3.0)
100
- mongo (>= 1.3, < 1.4)
105
+ mongo (~> 1.3)
101
106
  tzinfo (~> 0.3.22)
102
107
  multi_json (1.0.3)
103
108
  nokogiri (1.5.0)
104
109
  polyglot (0.3.2)
105
- rack (1.3.3)
110
+ rack (1.3.4)
106
111
  rack-cache (1.0.3)
107
112
  rack (>= 0.4)
108
113
  rack-mount (0.8.3)
@@ -143,13 +148,13 @@ GEM
143
148
  railties (~> 3.0)
144
149
  rspec (~> 2.6.0)
145
150
  rubyzip (0.9.4)
146
- sass (3.1.7)
151
+ sass (3.1.8)
147
152
  selenium-webdriver (2.7.0)
148
153
  childprocess (>= 0.2.1)
149
154
  ffi (>= 1.0.7)
150
155
  json_pure
151
156
  rubyzip
152
- sprockets (2.0.0)
157
+ sprockets (2.0.1)
153
158
  hike (~> 1.2)
154
159
  rack (~> 1.0)
155
160
  tilt (~> 1.1, != 1.3.0)
@@ -162,7 +167,7 @@ GEM
162
167
  polyglot (>= 0.3.1)
163
168
  turn (0.8.2)
164
169
  ansi (>= 1.2.2)
165
- tzinfo (0.3.29)
170
+ tzinfo (0.3.30)
166
171
  uglifier (1.0.3)
167
172
  execjs (>= 0.3.0)
168
173
  multi_json (>= 1.0.2)
@@ -174,6 +179,7 @@ PLATFORMS
174
179
  ruby
175
180
 
176
181
  DEPENDENCIES
182
+ ammeter (>= 0.1.2)
177
183
  aruba (>= 0.4.6)
178
184
  bcat (~> 0.6.2)
179
185
  bson_ext (>= 1.3.1)
@@ -183,7 +189,7 @@ DEPENDENCIES
183
189
  database_cleaner (>= 0.6.7)
184
190
  factory_girl (>= 2.1.0)
185
191
  jquery-rails (>= 1.0.14)
186
- mongoid (>= 2.2.0)
192
+ mongoid (>= 2.2.2)
187
193
  rails (>= 3.1.0)
188
194
  rake (>= 0.9.2)
189
195
  rdiscount (~> 1.6.8)
data/History.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [v1.1.1](https://github.com/cucumber/cucumber-rails/compare/v1.1.0...v1.1.1)
2
+
3
+ ### Removed features
4
+
5
+ The `cucumber:feature` generator has been removed. The reasoning behind this is the same as for
6
+ removing `web_steps.rb`, `paths.rb` and `selectors.rb` in v1.1.0.
7
+
1
8
  ## [v1.1.0](https://github.com/cucumber/cucumber-rails/compare/v1.0.6...v1.1.0)
2
9
 
3
10
  ### Removed features
data/README.md CHANGED
@@ -4,12 +4,6 @@
4
4
 
5
5
  Cucumber-Rails brings Cucumber to Rails 3.x. For Rails 2x support, see the [Cucumber Wiki](https://github.com/cucumber/cucumber/wiki/Ruby-on-Rails).
6
6
 
7
- Cucumber-Rails contains 2 generators - one
8
- for bootstrapping your Rails app for Cucumber, and a second one for generating features.
9
-
10
- Cucumber-Rails also contains Cucumber Step Definitions that wrap Capybara,
11
- giving you a head start for writing Cucumber features against your Rails app.
12
-
13
7
  ## Installation
14
8
 
15
9
  Before you can use the generator, add the gem to your project's Gemfile as follows:
@@ -32,18 +26,6 @@ Finally, bootstrap your Rails app, for example:
32
26
 
33
27
  rails generate cucumber:install
34
28
 
35
- ## Generating a Cucumber feature
36
-
37
- IMPORTANT: Only do this if you are new to Cucumber. We recommend you write your
38
- Cucumber features by hand once you get the hang of it.
39
-
40
- Example:
41
-
42
- rails generate cucumber:feature post title:string body:text published:boolean
43
- rails generate scaffold post title:string body:text published:boolean
44
- rake db:migrate
45
- rake cucumber
46
-
47
29
  ## Running Cucumber
48
30
 
49
31
  With Rake:
@@ -3,7 +3,7 @@ $LOAD_PATH.unshift File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = 'cucumber-rails'
6
- s.version = '1.1.0'
6
+ s.version = '1.1.1'
7
7
  s.authors = ["Aslak Hellesøy", "Dennis Blöte", "Rob Holland"]
8
8
  s.description = "Cucumber Generators and Runtime for Rails"
9
9
  s.summary = "#{s.name}-#{s.version}"
@@ -20,9 +20,10 @@ Gem::Specification.new do |s|
20
20
  s.add_development_dependency('sqlite3', '>= 1.3.4')
21
21
  s.add_development_dependency('rspec', '>= 2.6.0')
22
22
  s.add_development_dependency('rspec-rails', '>= 2.6.1')
23
+ s.add_development_dependency('ammeter', '>= 0.1.2')
23
24
  s.add_development_dependency('factory_girl', '>= 2.1.0')
24
25
  s.add_development_dependency('database_cleaner', '>= 0.6.7')
25
- s.add_development_dependency('mongoid', '>= 2.2.0')
26
+ s.add_development_dependency('mongoid', '>= 2.2.2')
26
27
  s.add_development_dependency('bson_ext', '>= 1.3.1')
27
28
 
28
29
  # Various Stuff that Rails 3.1 puts inside apps.
@@ -2,8 +2,6 @@ Feature: Inspect query string
2
2
 
3
3
  Scenario: Inspect query string
4
4
  Given I have created a new Rails 3 app "rails-3-app" with cucumber-rails support
5
- And I successfully run `rails generate cucumber:feature post title:string body:text number:integer published:boolean`
6
- And I successfully run `rails generate scaffold post title:string body:text number:integer published:boolean`
7
5
  And I successfully run `rails generate scaffold cuke name:string`
8
6
  And I overwrite "app/controllers/cukes_controller.rb" with:
9
7
  """
@@ -31,7 +29,7 @@ Feature: Inspect query string
31
29
  And I run `bundle exec rake cucumber`
32
30
  Then it should pass with:
33
31
  """
34
- 3 scenarios (3 passed)
35
- 16 steps (16 passed)
32
+ 1 scenario (1 passed)
33
+ 3 steps (3 passed)
36
34
  """
37
35
 
@@ -4,8 +4,6 @@ Description:
4
4
 
5
5
  This also generates the necessary files in the features directory.
6
6
 
7
- Also see the cucumber:feature generator.
8
-
9
7
  Examples:
10
8
  `rails generate cucumber:install`
11
9
 
@@ -0,0 +1,47 @@
1
+ require 'spec_helper'
2
+
3
+ # Generators are not automatically loaded by Rails
4
+ require 'generators/cucumber/install/install_generator'
5
+
6
+ describe Cucumber::InstallGenerator do
7
+ # Tell the generator where to put its output (what it thinks of as Rails.root)
8
+ destination File.expand_path("../../../../../tmp", __FILE__)
9
+
10
+ before { prepare_destination }
11
+
12
+ describe 'no arguments' do
13
+ before { run_generator }
14
+
15
+ describe 'config/cucumber.yml' do
16
+ subject { file('config/cucumber.yml') }
17
+ it { should exist }
18
+ it { should contain "default: <%= std_opts %> features" }
19
+ end
20
+
21
+ describe 'features/step_definitions folder' do
22
+ subject { file('features/step_definitions') }
23
+ it { should exist }
24
+ end
25
+
26
+ describe 'features/support/env.rb' do
27
+ subject { file('features/support/env.rb') }
28
+ it { should exist }
29
+ it { should contain "# IMPORTANT: This file is generated by cucumber-rails - edit at your own peril." }
30
+ it { should contain "require 'cucumber/rails'" }
31
+ end
32
+
33
+ describe 'lib/tasks/cucumber.rake' do
34
+ subject { file('lib/tasks/cucumber.rake') }
35
+ it { should exist }
36
+ it { should contain "# IMPORTANT: This file is generated by cucumber-rails - edit at your own peril." }
37
+ it { should contain "task :cucumber => 'cucumber:ok'" }
38
+ end
39
+
40
+ describe 'script/cucumber' do
41
+ subject { file('script/cucumber') }
42
+ it { should exist }
43
+ it { should contain "load Cucumber::BINARY" }
44
+ end
45
+
46
+ end
47
+ end
@@ -1,3 +1,5 @@
1
1
  require 'rubygems'
2
2
  gem 'rspec'
3
3
  require 'rspec/autorun'
4
+
5
+ require 'ammeter/init'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cucumber-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,11 +11,11 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2011-09-28 00:00:00.000000000 Z
14
+ date: 2011-10-03 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: cucumber
18
- requirement: &2169121020 !ruby/object:Gem::Requirement
18
+ requirement: &2153638640 !ruby/object:Gem::Requirement
19
19
  none: false
20
20
  requirements:
21
21
  - - ! '>='
@@ -23,10 +23,10 @@ dependencies:
23
23
  version: 1.1.0
24
24
  type: :runtime
25
25
  prerelease: false
26
- version_requirements: *2169121020
26
+ version_requirements: *2153638640
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: nokogiri
29
- requirement: &2169120280 !ruby/object:Gem::Requirement
29
+ requirement: &2153625620 !ruby/object:Gem::Requirement
30
30
  none: false
31
31
  requirements:
32
32
  - - ! '>='
@@ -34,10 +34,10 @@ dependencies:
34
34
  version: 1.5.0
35
35
  type: :runtime
36
36
  prerelease: false
37
- version_requirements: *2169120280
37
+ version_requirements: *2153625620
38
38
  - !ruby/object:Gem::Dependency
39
39
  name: capybara
40
- requirement: &2169119720 !ruby/object:Gem::Requirement
40
+ requirement: &2153624760 !ruby/object:Gem::Requirement
41
41
  none: false
42
42
  requirements:
43
43
  - - ! '>='
@@ -45,10 +45,10 @@ dependencies:
45
45
  version: 1.1.1
46
46
  type: :runtime
47
47
  prerelease: false
48
- version_requirements: *2169119720
48
+ version_requirements: *2153624760
49
49
  - !ruby/object:Gem::Dependency
50
50
  name: rails
51
- requirement: &2169135520 !ruby/object:Gem::Requirement
51
+ requirement: &2153624100 !ruby/object:Gem::Requirement
52
52
  none: false
53
53
  requirements:
54
54
  - - ! '>='
@@ -56,10 +56,10 @@ dependencies:
56
56
  version: 3.1.0
57
57
  type: :development
58
58
  prerelease: false
59
- version_requirements: *2169135520
59
+ version_requirements: *2153624100
60
60
  - !ruby/object:Gem::Dependency
61
61
  name: rake
62
- requirement: &2169134700 !ruby/object:Gem::Requirement
62
+ requirement: &2153623180 !ruby/object:Gem::Requirement
63
63
  none: false
64
64
  requirements:
65
65
  - - ! '>='
@@ -67,10 +67,10 @@ dependencies:
67
67
  version: 0.9.2
68
68
  type: :development
69
69
  prerelease: false
70
- version_requirements: *2169134700
70
+ version_requirements: *2153623180
71
71
  - !ruby/object:Gem::Dependency
72
72
  name: bundler
73
- requirement: &2169134100 !ruby/object:Gem::Requirement
73
+ requirement: &2153621920 !ruby/object:Gem::Requirement
74
74
  none: false
75
75
  requirements:
76
76
  - - ! '>='
@@ -78,10 +78,10 @@ dependencies:
78
78
  version: 1.0.18
79
79
  type: :development
80
80
  prerelease: false
81
- version_requirements: *2169134100
81
+ version_requirements: *2153621920
82
82
  - !ruby/object:Gem::Dependency
83
83
  name: aruba
84
- requirement: &2169133480 !ruby/object:Gem::Requirement
84
+ requirement: &2153614780 !ruby/object:Gem::Requirement
85
85
  none: false
86
86
  requirements:
87
87
  - - ! '>='
@@ -89,10 +89,10 @@ dependencies:
89
89
  version: 0.4.6
90
90
  type: :development
91
91
  prerelease: false
92
- version_requirements: *2169133480
92
+ version_requirements: *2153614780
93
93
  - !ruby/object:Gem::Dependency
94
94
  name: sqlite3
95
- requirement: &2169132480 !ruby/object:Gem::Requirement
95
+ requirement: &2153613880 !ruby/object:Gem::Requirement
96
96
  none: false
97
97
  requirements:
98
98
  - - ! '>='
@@ -100,10 +100,10 @@ dependencies:
100
100
  version: 1.3.4
101
101
  type: :development
102
102
  prerelease: false
103
- version_requirements: *2169132480
103
+ version_requirements: *2153613880
104
104
  - !ruby/object:Gem::Dependency
105
105
  name: rspec
106
- requirement: &2169131800 !ruby/object:Gem::Requirement
106
+ requirement: &2153612900 !ruby/object:Gem::Requirement
107
107
  none: false
108
108
  requirements:
109
109
  - - ! '>='
@@ -111,10 +111,10 @@ dependencies:
111
111
  version: 2.6.0
112
112
  type: :development
113
113
  prerelease: false
114
- version_requirements: *2169131800
114
+ version_requirements: *2153612900
115
115
  - !ruby/object:Gem::Dependency
116
116
  name: rspec-rails
117
- requirement: &2169131260 !ruby/object:Gem::Requirement
117
+ requirement: &2153612080 !ruby/object:Gem::Requirement
118
118
  none: false
119
119
  requirements:
120
120
  - - ! '>='
@@ -122,10 +122,21 @@ dependencies:
122
122
  version: 2.6.1
123
123
  type: :development
124
124
  prerelease: false
125
- version_requirements: *2169131260
125
+ version_requirements: *2153612080
126
+ - !ruby/object:Gem::Dependency
127
+ name: ammeter
128
+ requirement: &2153611200 !ruby/object:Gem::Requirement
129
+ none: false
130
+ requirements:
131
+ - - ! '>='
132
+ - !ruby/object:Gem::Version
133
+ version: 0.1.2
134
+ type: :development
135
+ prerelease: false
136
+ version_requirements: *2153611200
126
137
  - !ruby/object:Gem::Dependency
127
138
  name: factory_girl
128
- requirement: &2169130460 !ruby/object:Gem::Requirement
139
+ requirement: &2153610080 !ruby/object:Gem::Requirement
129
140
  none: false
130
141
  requirements:
131
142
  - - ! '>='
@@ -133,10 +144,10 @@ dependencies:
133
144
  version: 2.1.0
134
145
  type: :development
135
146
  prerelease: false
136
- version_requirements: *2169130460
147
+ version_requirements: *2153610080
137
148
  - !ruby/object:Gem::Dependency
138
149
  name: database_cleaner
139
- requirement: &2169129860 !ruby/object:Gem::Requirement
150
+ requirement: &2153608180 !ruby/object:Gem::Requirement
140
151
  none: false
141
152
  requirements:
142
153
  - - ! '>='
@@ -144,21 +155,21 @@ dependencies:
144
155
  version: 0.6.7
145
156
  type: :development
146
157
  prerelease: false
147
- version_requirements: *2169129860
158
+ version_requirements: *2153608180
148
159
  - !ruby/object:Gem::Dependency
149
160
  name: mongoid
150
- requirement: &2169129140 !ruby/object:Gem::Requirement
161
+ requirement: &2153607500 !ruby/object:Gem::Requirement
151
162
  none: false
152
163
  requirements:
153
164
  - - ! '>='
154
165
  - !ruby/object:Gem::Version
155
- version: 2.2.0
166
+ version: 2.2.2
156
167
  type: :development
157
168
  prerelease: false
158
- version_requirements: *2169129140
169
+ version_requirements: *2153607500
159
170
  - !ruby/object:Gem::Dependency
160
171
  name: bson_ext
161
- requirement: &2169128140 !ruby/object:Gem::Requirement
172
+ requirement: &2153592360 !ruby/object:Gem::Requirement
162
173
  none: false
163
174
  requirements:
164
175
  - - ! '>='
@@ -166,10 +177,10 @@ dependencies:
166
177
  version: 1.3.1
167
178
  type: :development
168
179
  prerelease: false
169
- version_requirements: *2169128140
180
+ version_requirements: *2153592360
170
181
  - !ruby/object:Gem::Dependency
171
182
  name: turn
172
- requirement: &2169142900 !ruby/object:Gem::Requirement
183
+ requirement: &2153590580 !ruby/object:Gem::Requirement
173
184
  none: false
174
185
  requirements:
175
186
  - - ! '>='
@@ -177,10 +188,10 @@ dependencies:
177
188
  version: 0.8.2
178
189
  type: :development
179
190
  prerelease: false
180
- version_requirements: *2169142900
191
+ version_requirements: *2153590580
181
192
  - !ruby/object:Gem::Dependency
182
193
  name: sass
183
- requirement: &2169140500 !ruby/object:Gem::Requirement
194
+ requirement: &2153589240 !ruby/object:Gem::Requirement
184
195
  none: false
185
196
  requirements:
186
197
  - - ! '>='
@@ -188,10 +199,10 @@ dependencies:
188
199
  version: 3.1.7
189
200
  type: :development
190
201
  prerelease: false
191
- version_requirements: *2169140500
202
+ version_requirements: *2153589240
192
203
  - !ruby/object:Gem::Dependency
193
204
  name: coffee-script
194
- requirement: &2169139420 !ruby/object:Gem::Requirement
205
+ requirement: &2153587980 !ruby/object:Gem::Requirement
195
206
  none: false
196
207
  requirements:
197
208
  - - ! '>='
@@ -199,10 +210,10 @@ dependencies:
199
210
  version: 2.2.0
200
211
  type: :development
201
212
  prerelease: false
202
- version_requirements: *2169139420
213
+ version_requirements: *2153587980
203
214
  - !ruby/object:Gem::Dependency
204
215
  name: uglifier
205
- requirement: &2169138580 !ruby/object:Gem::Requirement
216
+ requirement: &2153587180 !ruby/object:Gem::Requirement
206
217
  none: false
207
218
  requirements:
208
219
  - - ! '>='
@@ -210,10 +221,10 @@ dependencies:
210
221
  version: 1.0.3
211
222
  type: :development
212
223
  prerelease: false
213
- version_requirements: *2169138580
224
+ version_requirements: *2153587180
214
225
  - !ruby/object:Gem::Dependency
215
226
  name: jquery-rails
216
- requirement: &2169137860 !ruby/object:Gem::Requirement
227
+ requirement: &2153586020 !ruby/object:Gem::Requirement
217
228
  none: false
218
229
  requirements:
219
230
  - - ! '>='
@@ -221,10 +232,10 @@ dependencies:
221
232
  version: 1.0.14
222
233
  type: :development
223
234
  prerelease: false
224
- version_requirements: *2169137860
235
+ version_requirements: *2153586020
225
236
  - !ruby/object:Gem::Dependency
226
237
  name: yard
227
- requirement: &2169136400 !ruby/object:Gem::Requirement
238
+ requirement: &2153585360 !ruby/object:Gem::Requirement
228
239
  none: false
229
240
  requirements:
230
241
  - - ~>
@@ -232,10 +243,10 @@ dependencies:
232
243
  version: 0.7.2
233
244
  type: :development
234
245
  prerelease: false
235
- version_requirements: *2169136400
246
+ version_requirements: *2153585360
236
247
  - !ruby/object:Gem::Dependency
237
248
  name: rdiscount
238
- requirement: &2169196680 !ruby/object:Gem::Requirement
249
+ requirement: &2153584220 !ruby/object:Gem::Requirement
239
250
  none: false
240
251
  requirements:
241
252
  - - ~>
@@ -243,10 +254,10 @@ dependencies:
243
254
  version: 1.6.8
244
255
  type: :development
245
256
  prerelease: false
246
- version_requirements: *2169196680
257
+ version_requirements: *2153584220
247
258
  - !ruby/object:Gem::Dependency
248
259
  name: bcat
249
- requirement: &2169195980 !ruby/object:Gem::Requirement
260
+ requirement: &2153583460 !ruby/object:Gem::Requirement
250
261
  none: false
251
262
  requirements:
252
263
  - - ~>
@@ -254,7 +265,7 @@ dependencies:
254
265
  version: 0.6.2
255
266
  type: :development
256
267
  prerelease: false
257
- version_requirements: *2169195980
268
+ version_requirements: *2153583460
258
269
  description: Cucumber Generators and Runtime for Rails
259
270
  email: cukes@googlegroups.com
260
271
  executables: []
@@ -313,11 +324,6 @@ files:
313
324
  - lib/cucumber/rails/rspec.rb
314
325
  - lib/cucumber/rails/world.rb
315
326
  - lib/cucumber/web/tableish.rb
316
- - lib/generators/cucumber/feature/USAGE
317
- - lib/generators/cucumber/feature/feature_generator.rb
318
- - lib/generators/cucumber/feature/named_arg.rb
319
- - lib/generators/cucumber/feature/templates/feature.erb
320
- - lib/generators/cucumber/feature/templates/steps.erb
321
327
  - lib/generators/cucumber/install/USAGE
322
328
  - lib/generators/cucumber/install/install_generator.rb
323
329
  - lib/generators/cucumber/install/templates/config/cucumber.yml.erb
@@ -339,6 +345,7 @@ files:
339
345
  - lib/generators/cucumber/install/templates/support/rails_spork.rb.erb
340
346
  - lib/generators/cucumber/install/templates/tasks/cucumber.rake.erb
341
347
  - spec/cucumber/web/tableish_spec.rb
348
+ - spec/generators/cucumber/install/install_generator_spec.rb
342
349
  - spec/spec_helper.rb
343
350
  homepage: http://cukes.info
344
351
  licenses: []
@@ -354,7 +361,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
354
361
  version: '0'
355
362
  segments:
356
363
  - 0
357
- hash: -3221260629709489818
364
+ hash: -4466562364292421344
358
365
  required_rubygems_version: !ruby/object:Gem::Requirement
359
366
  none: false
360
367
  requirements:
@@ -363,13 +370,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
363
370
  version: '0'
364
371
  segments:
365
372
  - 0
366
- hash: -3221260629709489818
373
+ hash: -4466562364292421344
367
374
  requirements: []
368
375
  rubyforge_project:
369
376
  rubygems_version: 1.8.10
370
377
  signing_key:
371
378
  specification_version: 3
372
- summary: cucumber-rails-1.1.0
379
+ summary: cucumber-rails-1.1.1
373
380
  test_files:
374
381
  - features/allow_rescue.feature
375
382
  - features/capybara_javascript_drivers.feature
@@ -389,4 +396,5 @@ test_files:
389
396
  - features/support/env.rb
390
397
  - features/test_unit.feature
391
398
  - spec/cucumber/web/tableish_spec.rb
399
+ - spec/generators/cucumber/install/install_generator_spec.rb
392
400
  - spec/spec_helper.rb
@@ -1,16 +0,0 @@
1
- Description:
2
- Generates a skeleton for a new feature. Both a simple .feature file and
3
- a steps.rb file is generated. This generator should be used with moderation.
4
- See https://github.com/cucumber/cucumber/wiki/Feature-Coupled-Steps-(Antipattern)
5
- for details about the dangers involved.
6
-
7
- This generator can take an optional list of attribute pairs similar to Rails'
8
- built-in resource generator.
9
-
10
- Examples (Rails 3):
11
- `script/rails generate cucumber:feature post` # no attributes
12
- `script/rails generate cucumber:feature post title:string body:text published:boolean`
13
-
14
- Examples (Rails 2):
15
- `script/generate feature post` # no attributes
16
- `script/generate feature post title:string body:text published:boolean`
@@ -1,27 +0,0 @@
1
- require File.join(File.dirname(__FILE__), 'named_arg')
2
-
3
- module Cucumber
4
- class FeatureGenerator < ::Rails::Generators::NamedBase
5
- source_root File.expand_path("../templates", __FILE__)
6
-
7
- argument :fields, :optional => true, :type => :array, :banner => "[field:type, field:type]"
8
-
9
- attr_reader :named_args
10
-
11
- def parse_fields
12
- @named_args = @fields.nil? ? [] : @fields.map { |arg| NamedArg.new(arg) }
13
- end
14
-
15
- def generate
16
- template 'feature.erb', "features/manage_#{plural_name}.feature"
17
- template 'steps.erb', "features/step_definitions/#{singular_name}_steps.rb"
18
- gsub_file 'features/support/paths.rb', /'\/'/mi do |match|
19
- "#{match}\n when /the new #{singular_name} page/\n new_#{singular_name}_path\n"
20
- end
21
- end
22
-
23
- def self.banner
24
- "#{$0} cucumber:feature ModelName [field:type, field:type]"
25
- end
26
- end
27
- end
@@ -1,19 +0,0 @@
1
- class NamedArg
2
- attr_reader :name
3
- attr_reader :type
4
-
5
- def initialize(s)
6
- @name, @type = *s.split(':')
7
- end
8
-
9
- def value(n)
10
- if @type == 'boolean'
11
- (n % 2) == 0
12
- elsif @type == 'integer'
13
- n
14
- else
15
- "#{@name} #{n}"
16
- end
17
- end
18
- end
19
-
@@ -1,63 +0,0 @@
1
- Feature: Manage <%= plural_name %>
2
- In order to [goal]
3
- [stakeholder]
4
- wants [behaviour]
5
-
6
- Scenario: Register new <%= singular_name %>
7
- Given I am on the new <%= singular_name %> page
8
- <% keyword = 'When' -%>
9
- <% named_args.each do |arg| -%>
10
- <% if arg.type == 'boolean' -%>
11
- <%= keyword %> I uncheck "<%= arg.name.humanize %>"
12
- <% else -%>
13
- <%= keyword %> I fill in "<%= arg.name.humanize %>" with "<%= arg.value(1) %>"
14
- <% end -%>
15
- <% keyword = 'And' -%>
16
- <% end -%>
17
- And I press "Create"
18
- <% keyword = 'Then' -%>
19
- <% named_args.each do |arg| -%>
20
- <%= keyword %> I should see "<%= arg.value(1) %>"
21
- <% keyword = 'And' -%>
22
- <% end -%>
23
-
24
- <% if IO.read('features/support/env.rb') =~ /capybara/n -%>
25
- # Rails generates Delete links that use Javascript to pop up a confirmation
26
- # dialog and then do a HTTP POST request (emulated DELETE request).
27
- #
28
- # Capybara must use Culerity/Celerity or Selenium2 (webdriver) when pages rely
29
- # on Javascript events. Only Culerity/Celerity supports clicking on confirmation
30
- # dialogs.
31
- #
32
- # Since Culerity/Celerity and Selenium2 has some overhead, Cucumber-Rails will
33
- # detect the presence of Javascript behind Delete links and issue a DELETE request
34
- # instead of a GET request.
35
- #
36
- # You can turn this emulation off by tagging your scenario with @no-js-emulation.
37
- # Turning on browser testing with @selenium, @culerity, @celerity or @javascript
38
- # will also turn off the emulation. (See the Capybara documentation for
39
- # details about those tags). If any of the browser tags are present, Cucumber-Rails
40
- # will also turn off transactions and clean the database with DatabaseCleaner
41
- # after the scenario has finished. This is to prevent data from leaking into
42
- # the next scenario.
43
- #
44
- # Another way to avoid Cucumber-Rails' javascript emulation without using any
45
- # of the tags above is to modify your views to use <button> instead. You can
46
- # see how in http://github.com/jnicklas/capybara/issues#issue/12
47
- #
48
- <% if options[:capybara] -%>
49
- @<%= options[:capybara] %>
50
- <% end -%>
51
- <% end -%>
52
- Scenario: Delete <%= singular_name %>
53
- Given the following <%= plural_name %>:
54
- |<%= named_args.map(&:name).join('|') %>|
55
- <% (1..4).each do |n| -%>
56
- |<%= named_args.map{|arg| arg.value(n)}.join('|') %>|
57
- <% end -%>
58
- When I delete the 3rd <%= singular_name %>
59
- Then I should see the following <%= plural_name %>:
60
- |<%= named_args.map{|arg| arg.name.humanize}.join('|') %>|
61
- <% [1,2,4].each do |n| -%>
62
- |<%= named_args.map{|arg| arg.value(n)}.join('|') %>|
63
- <% end -%>
@@ -1,14 +0,0 @@
1
- Given /^the following <%= plural_name %>:$/ do |<%= plural_name %>|
2
- <%= class_name %>.create!(<%= plural_name %>.hashes)
3
- end
4
-
5
- When /^I delete the (\d+)(?:st|nd|rd|th) <%= singular_name %>$/ do |pos|
6
- visit <%= plural_name %>_path
7
- within("table tr:nth-child(#{pos.to_i+1})") do
8
- click_link "Destroy"
9
- end
10
- end
11
-
12
- Then /^I should see the following <%= plural_name %>:$/ do |expected_<%= plural_name %>_table|
13
- expected_<%= plural_name %>_table.diff!(tableish('table tr', 'td,th'))
14
- end