cucumber-rails 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. data/HACKING.rdoc +1 -1
  2. data/History.txt +9 -2
  3. data/LICENSE +22 -0
  4. data/README.rdoc +2 -2
  5. data/Rakefile +1 -1
  6. data/VERSION +1 -1
  7. data/cucumber-rails.gemspec +37 -36
  8. data/features/rails2.feature +50 -85
  9. data/features/rails3.feature +22 -18
  10. data/features/rerun_profile.feature +3 -2
  11. data/features/step_definitions/cucumber_rails_steps.rb +21 -16
  12. data/features/support/env.rb +1 -1
  13. data/features/support/matchers/files.rb +2 -2
  14. data/generators/cucumber/USAGE +1 -2
  15. data/generators/cucumber/cucumber_generator.rb +3 -4
  16. data/lib/cucumber/rails/rspec.rb +2 -1
  17. data/lib/generators/cucumber/install/USAGE +15 -0
  18. data/lib/generators/cucumber/{skeleton/skeleton_base.rb → install/install_base.rb} +1 -1
  19. data/lib/generators/cucumber/{skeleton/skeleton_generator.rb → install/install_generator.rb} +4 -4
  20. data/spec/generators/cucumber/{skeleton/skeleton_base_spec.rb → install/install_base_spec.rb} +3 -3
  21. data/templates/{skeleton → install}/config/cucumber.yml.erb +0 -0
  22. data/templates/{skeleton → install}/environments/cucumber.rb.erb +0 -0
  23. data/templates/{skeleton → install}/script/cucumber +0 -0
  24. data/templates/{skeleton → install}/step_definitions/capybara_steps.rb.erb +23 -23
  25. data/templates/{skeleton → install}/step_definitions/web_steps_cs.rb.erb +25 -25
  26. data/templates/{skeleton → install}/step_definitions/web_steps_da.rb.erb +20 -20
  27. data/templates/{skeleton → install}/step_definitions/web_steps_de.rb.erb +26 -26
  28. data/templates/{skeleton → install}/step_definitions/web_steps_es.rb.erb +26 -26
  29. data/templates/{skeleton → install}/step_definitions/web_steps_ja.rb.erb +28 -28
  30. data/templates/{skeleton → install}/step_definitions/web_steps_ko.rb.erb +26 -26
  31. data/templates/{skeleton → install}/step_definitions/web_steps_no.rb.erb +20 -20
  32. data/templates/{skeleton → install}/step_definitions/web_steps_pt-BR.rb.erb +27 -27
  33. data/templates/{skeleton → install}/step_definitions/webrat_steps.rb.erb +26 -26
  34. data/templates/{skeleton → install}/support/_rails_each_run.rb.erb +0 -0
  35. data/templates/{skeleton → install}/support/_rails_prefork.rb.erb +0 -0
  36. data/templates/{skeleton → install}/support/capybara.rb +0 -0
  37. data/templates/{skeleton → install}/support/edit_warning.txt +0 -0
  38. data/templates/{skeleton → install}/support/paths.rb +0 -0
  39. data/templates/{skeleton → install}/support/rails.rb.erb +0 -0
  40. data/templates/{skeleton → install}/support/rails_spork.rb.erb +0 -0
  41. data/templates/{skeleton → install}/support/webrat.rb +0 -0
  42. data/templates/{skeleton → install}/tasks/cucumber.rake.erb +0 -0
  43. metadata +45 -35
  44. data/lib/generators/cucumber/skeleton/USAGE +0 -21
  45. data/rvm.yml +0 -22
data/HACKING.rdoc CHANGED
@@ -12,7 +12,7 @@ The feature branch should contain a ticket number (if appliccable) and a descrip
12
12
  Before you change anything, you should make sure you can run all the Cucumber features for Cucumber-Rails. You need rvm.
13
13
 
14
14
  sudo gem install rvm
15
- rvm install 1.8.7 1.9.1
15
+ rvm install ruby-1.8.7-p249 ruby-1.9.1-p378
16
16
 
17
17
  == Running all features
18
18
 
data/History.txt CHANGED
@@ -1,4 +1,11 @@
1
- == 0.3.1
1
+ == 0.3.2 2010-06-06
2
+
3
+ == Changed features
4
+ * web_steps.rb uses "([^"]*)" instead of "([^\"]*)" (Aslak Hellesøy)
5
+ * Renamed cucumber:skeleton to cucumber:install (Rails 3 generator). (Aslak Hellesøy)
6
+ * Upgraded to be compatible with rspec 2.0.0.beta.10 (#35 Gabor Ratky, Pete Yandell)
7
+
8
+ == 0.3.1 2010-05-03
2
9
 
3
10
  This release has a lot of bugfixes! The test suite (based on Aruba) verifies that Cucumber-Rails
4
11
  now works with various combinations of:
@@ -28,7 +35,7 @@ separate rerun profile, so all rerun.txt related issues should now be gone.
28
35
  * "Rspec is not missing constant Matchers!" error. (#27 David Chelimsky, Aslak Hellesøy)
29
36
  * @culerity tag breaks Rails 3 RESTful helpers (#17 Aslak Hellesøy)
30
37
 
31
- == 0.3.0
38
+ == 0.3.0 2010-02-25
32
39
 
33
40
  This is a major release since we're now supporting both Rails 3 and RSpec 2. Older versions
34
41
  (Rails 2 and RSpec 1) are still supported.
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ The MIT License
2
+
3
+ Copyright (c) 2008,2009,2010 Aslak Hellesøy and the Cucumber Team.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.rdoc CHANGED
@@ -26,11 +26,11 @@ Then install the gems by running:
26
26
 
27
27
  Learn about the various options:
28
28
 
29
- ruby script/rails generate cucumber:skeleton --help
29
+ ruby script/rails generate cucumber:install --help
30
30
 
31
31
  Finally, bootstrap your Rails app, for example:
32
32
 
33
- ruby script/rails generate cucumber:skeleton --rspec --capybara
33
+ ruby script/rails generate cucumber:install --rspec --capybara
34
34
 
35
35
  === Rails 2.x:
36
36
 
data/Rakefile CHANGED
@@ -11,7 +11,7 @@ begin
11
11
  gemspec.authors = ["Dennis Blöte", "Aslak Hellesøy", "Rob Holland"]
12
12
  gemspec.homepage = "http://github.com/aslakhellesoy/cucumber-rails"
13
13
 
14
- gemspec.add_dependency 'cucumber', '>= 0.7.2'
14
+ gemspec.add_dependency 'cucumber', '>= 0.8.0'
15
15
  gemspec.add_development_dependency 'aruba', '>= 0.1.9'
16
16
  end
17
17
  Jeweler::GemcutterTasks.new
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.1
1
+ 0.3.2
@@ -5,20 +5,22 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{cucumber-rails}
8
- s.version = "0.3.1"
8
+ s.version = "0.3.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Dennis Bl\303\266te", "Aslak Helles\303\270y", "Rob Holland"]
12
- s.date = %q{2010-05-04}
12
+ s.date = %q{2010-06-06}
13
13
  s.description = %q{Cucumber Generators and Runtime for Rails}
14
14
  s.email = %q{cukes@googlegroups.com}
15
15
  s.extra_rdoc_files = [
16
- "README.rdoc"
16
+ "LICENSE",
17
+ "README.rdoc"
17
18
  ]
18
19
  s.files = [
19
20
  ".gitignore",
20
21
  "HACKING.rdoc",
21
22
  "History.txt",
23
+ "LICENSE",
22
24
  "README.rdoc",
23
25
  "Rakefile",
24
26
  "VERSION",
@@ -47,47 +49,46 @@ Gem::Specification.new do |s|
47
49
  "lib/generators/cucumber/feature/feature_base.rb",
48
50
  "lib/generators/cucumber/feature/feature_generator.rb",
49
51
  "lib/generators/cucumber/feature/named_arg.rb",
50
- "lib/generators/cucumber/skeleton/USAGE",
51
- "lib/generators/cucumber/skeleton/skeleton_base.rb",
52
- "lib/generators/cucumber/skeleton/skeleton_generator.rb",
53
- "rvm.yml",
52
+ "lib/generators/cucumber/install/USAGE",
53
+ "lib/generators/cucumber/install/install_base.rb",
54
+ "lib/generators/cucumber/install/install_generator.rb",
54
55
  "spec/cucumber/web/tableish_spec.rb",
55
- "spec/generators/cucumber/skeleton/skeleton_base_spec.rb",
56
+ "spec/generators/cucumber/install/install_base_spec.rb",
56
57
  "spec/spec.opts",
57
58
  "spec/spec_helper.rb",
58
59
  "templates/feature/feature.erb",
59
60
  "templates/feature/steps.erb",
60
- "templates/skeleton/config/cucumber.yml.erb",
61
- "templates/skeleton/environments/cucumber.rb.erb",
62
- "templates/skeleton/script/cucumber",
63
- "templates/skeleton/step_definitions/capybara_steps.rb.erb",
64
- "templates/skeleton/step_definitions/web_steps_cs.rb.erb",
65
- "templates/skeleton/step_definitions/web_steps_da.rb.erb",
66
- "templates/skeleton/step_definitions/web_steps_de.rb.erb",
67
- "templates/skeleton/step_definitions/web_steps_es.rb.erb",
68
- "templates/skeleton/step_definitions/web_steps_ja.rb.erb",
69
- "templates/skeleton/step_definitions/web_steps_ko.rb.erb",
70
- "templates/skeleton/step_definitions/web_steps_no.rb.erb",
71
- "templates/skeleton/step_definitions/web_steps_pt-BR.rb.erb",
72
- "templates/skeleton/step_definitions/webrat_steps.rb.erb",
73
- "templates/skeleton/support/_rails_each_run.rb.erb",
74
- "templates/skeleton/support/_rails_prefork.rb.erb",
75
- "templates/skeleton/support/capybara.rb",
76
- "templates/skeleton/support/edit_warning.txt",
77
- "templates/skeleton/support/paths.rb",
78
- "templates/skeleton/support/rails.rb.erb",
79
- "templates/skeleton/support/rails_spork.rb.erb",
80
- "templates/skeleton/support/webrat.rb",
81
- "templates/skeleton/tasks/cucumber.rake.erb"
61
+ "templates/install/config/cucumber.yml.erb",
62
+ "templates/install/environments/cucumber.rb.erb",
63
+ "templates/install/script/cucumber",
64
+ "templates/install/step_definitions/capybara_steps.rb.erb",
65
+ "templates/install/step_definitions/web_steps_cs.rb.erb",
66
+ "templates/install/step_definitions/web_steps_da.rb.erb",
67
+ "templates/install/step_definitions/web_steps_de.rb.erb",
68
+ "templates/install/step_definitions/web_steps_es.rb.erb",
69
+ "templates/install/step_definitions/web_steps_ja.rb.erb",
70
+ "templates/install/step_definitions/web_steps_ko.rb.erb",
71
+ "templates/install/step_definitions/web_steps_no.rb.erb",
72
+ "templates/install/step_definitions/web_steps_pt-BR.rb.erb",
73
+ "templates/install/step_definitions/webrat_steps.rb.erb",
74
+ "templates/install/support/_rails_each_run.rb.erb",
75
+ "templates/install/support/_rails_prefork.rb.erb",
76
+ "templates/install/support/capybara.rb",
77
+ "templates/install/support/edit_warning.txt",
78
+ "templates/install/support/paths.rb",
79
+ "templates/install/support/rails.rb.erb",
80
+ "templates/install/support/rails_spork.rb.erb",
81
+ "templates/install/support/webrat.rb",
82
+ "templates/install/tasks/cucumber.rake.erb"
82
83
  ]
83
84
  s.homepage = %q{http://github.com/aslakhellesoy/cucumber-rails}
84
85
  s.rdoc_options = ["--charset=UTF-8"]
85
86
  s.require_paths = ["lib"]
86
- s.rubygems_version = %q{1.3.6}
87
+ s.rubygems_version = %q{1.3.7}
87
88
  s.summary = %q{Cucumber Generators and Runtime for Rails}
88
89
  s.test_files = [
89
90
  "spec/cucumber/web/tableish_spec.rb",
90
- "spec/generators/cucumber/skeleton/skeleton_base_spec.rb",
91
+ "spec/generators/cucumber/install/install_base_spec.rb",
91
92
  "spec/spec_helper.rb"
92
93
  ]
93
94
 
@@ -95,15 +96,15 @@ Gem::Specification.new do |s|
95
96
  current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
96
97
  s.specification_version = 3
97
98
 
98
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
99
- s.add_runtime_dependency(%q<cucumber>, [">= 0.7.2"])
99
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
100
+ s.add_runtime_dependency(%q<cucumber>, [">= 0.8.0"])
100
101
  s.add_development_dependency(%q<aruba>, [">= 0.1.9"])
101
102
  else
102
- s.add_dependency(%q<cucumber>, [">= 0.7.2"])
103
+ s.add_dependency(%q<cucumber>, [">= 0.8.0"])
103
104
  s.add_dependency(%q<aruba>, [">= 0.1.9"])
104
105
  end
105
106
  else
106
- s.add_dependency(%q<cucumber>, [">= 0.7.2"])
107
+ s.add_dependency(%q<cucumber>, [">= 0.8.0"])
107
108
  s.add_dependency(%q<aruba>, [">= 0.1.9"])
108
109
  end
109
110
  end
@@ -3,97 +3,62 @@ Feature: Rails 2
3
3
  Cucumber-Rails should work on major versions
4
4
  of Rails2 and Ruby, with Capybara, Webrat, Spork and DatabaseCleaner
5
5
 
6
- Scenario Outline: Install Cucumber-Rails
7
- Given I am using rvm "1.8.7"
8
- And I am using rvm gemset "cucumber-rails-2.3.5" with Gemfile:
6
+ @announce @puts
7
+ Scenario Outline: Run Cucumber
8
+ Given I am using rvm "<ruby_version>"
9
+ And I am using rvm gemset "cucumber-rails-<rails_version>" with Gemfile:
9
10
  """
10
- gem 'rails', '2.3.5'
11
+ source :gemcutter
12
+ gem 'rails', '<rails_version>'
11
13
  gem 'sqlite3-ruby', '1.2.5'
12
- gem 'capybara', '0.3.7'
13
- gem 'webrat', '0.7.0'
14
+ gem 'capybara', '0.3.8'
15
+ gem 'webrat', '0.7.1'
14
16
  gem 'rspec-rails', '1.3.2'
15
- gem 'cucumber', '0.7.2'
17
+ #gem 'cucumber', '0.8.0'
18
+ gem 'cucumber', :path => '../../../cucumber'
19
+ gem 'database_cleaner', '0.5.2'
20
+ gem 'culerity', '0.2.10'
21
+ gem 'celerity', '0.7.9'
16
22
  """
17
- When I successfully run "rails rails-2-app"
23
+ And I successfully run "rails rails-2-app"
24
+ And I cd to "rails-2-app"
25
+ And I symlink "../../../../cucumber" to "vendor/plugins/cucumber"
26
+ And I symlink "../../.." to "vendor/plugins/cucumber-rails"
27
+ And I successfully run "ruby script/generate cucumber --capybara"
28
+ And I successfully run "ruby script/generate feature post title:string body:text published:boolean <feature_args>"
29
+ And I successfully run "ruby script/generate scaffold post title:string body:text published:boolean"
30
+ And I successfully run "ruby script/generate scaffold cukes name:string"
31
+ And I write to "app/controllers/cukes_controller.rb" with:
32
+ """
33
+ class CukesController < ApplicationController
34
+ def index
35
+ redirect_to cuke_path(10, :params => {:name => 'cucumber', :what => 'vegetable'})
36
+ end
37
+
38
+ def show
39
+ render :text => "Cuke #{params[:id]}"
40
+ end
41
+ end
42
+ """
43
+ And I write to "features/tests.feature" with:
44
+ """
45
+ Feature: Tests
46
+ Scenario: Tests
47
+ When I go to the cukes page
48
+ Then I should have the following query string:
49
+ |name|cucumber|
50
+ |what|vegetable|
51
+ And I should see "Cuke 10"
52
+ """
53
+ And I successfully run "rake db:migrate"
54
+ When I successfully run "rake cucumber"
18
55
  Then it should pass with:
19
56
  """
20
- create README
57
+ 3 scenarios (3 passed)
58
+ 14 steps (14 passed)
21
59
  """
22
- And I cd to "rails-2-app"
23
- And I symlink this repo to "vendor/plugins/cucumber-rails"
24
- When I successfully run "ruby script/generate cucumber <args>"
25
- Then the following files should exist:
26
- | config/cucumber.yml |
27
- | config/environments/cucumber.rb |
28
- | script/cucumber |
29
- | features/step_definitions/web_steps.rb |
30
- | features/support/env.rb |
31
- | features/support/paths.rb |
32
- | lib/tasks/cucumber.rake |
33
- And the file "features/support/env.rb" should contain "<env_rb_1>"
34
- And the file "features/support/env.rb" should contain "<env_rb_2>"
35
- And the file "config/environments/cucumber.rb" should contain "<cucumber_rb_1>"
36
- And the file "config/environments/cucumber.rb" should contain "<cucumber_rb_2>"
37
- And the file "config/database.yml" should contain "cucumber:"
38
60
 
39
61
  Examples:
40
- | args | env_rb_1 | env_rb_2 | cucumber_rb_1 | cucumber_rb_2 |
41
- | --webrat --rspec | require 'cucumber/rails/rspec' | require 'webrat' | config.gem 'webrat' | config.gem 'rspec-rails' |
42
- | --capybara --testunit | require 'cucumber/rails/world' | require 'capybara/rails' | config.gem 'capybara' | config.gem 'database_cleaner' |
43
-
44
- @announce-cmd
45
- Scenario Outline: Run Cucumber
46
- Given I am using rvm "<ruby_version>"
47
- And I am using rvm gemset "cucumber-rails-2.3.5" with Gemfile:
48
- """
49
- gem 'rails', '2.3.5'
50
- gem 'sqlite3-ruby', '1.2.5'
51
- gem 'capybara', '0.3.7'
52
- gem 'webrat', '0.7.0'
53
- gem 'rspec-rails', '1.3.2'
54
- gem 'cucumber', '0.7.2'
55
- gem 'database_cleaner', '0.5.2'
56
- gem 'culerity', '0.2.10'
57
- gem 'celerity', '0.7.9'
58
- """
59
- And I successfully run "rails rails-2-app"
60
- And I cd to "rails-2-app"
61
- And I symlink this repo to "vendor/plugins/cucumber-rails"
62
- And I successfully run "ruby script/generate cucumber --capybara"
63
- And I successfully run "ruby script/generate feature post title:string body:text published:boolean <feature_args>"
64
- And I successfully run "ruby script/generate scaffold post title:string body:text published:boolean"
65
- And I successfully run "ruby script/generate scaffold cukes name:string"
66
- And I write to "app/controllers/cukes_controller.rb" with:
67
- """
68
- class CukesController < ApplicationController
69
- def index
70
- redirect_to cuke_path(10, :params => {:name => 'cucumber', :what => 'vegetable'})
71
- end
72
-
73
- def show
74
- render :text => "Cuke #{params[:id]}"
75
- end
76
- end
77
- """
78
- And I write to "features/tests.feature" with:
79
- """
80
- Feature: Tests
81
- Scenario: Tests
82
- When I go to the cukes page
83
- Then I should have the following query string:
84
- |name|cucumber|
85
- |what|vegetable|
86
- And I should see "Cuke 10"
87
- """
88
- And I successfully run "rake db:migrate"
89
- When I successfully run "rake cucumber"
90
- Then it should pass with:
91
- """
92
- 3 scenarios (3 passed)
93
- 14 steps (14 passed)
94
- """
95
-
96
- Examples:
97
- | generator_args | feature_args | ruby_version |
98
- | --webrat --testunit | | 1.8.6 |
99
- | --capybara --rspec | --capybara culerity | 1.8.7 |
62
+ | generator_args | feature_args | ruby_version | rails_version |
63
+ | --webrat --testunit | | 1.8.6 | 2.3.5 |
64
+ | --capybara --rspec | --capybara culerity | 1.8.7 | 2.3.8 |
@@ -1,16 +1,18 @@
1
1
  @announce-cmd
2
+ @announce @puts
2
3
  Feature: Rails 3
3
4
  In order to take over the world
4
5
  Cucumber-Rails should work on major versions
5
6
  of Rails2 and Ruby, with Capybara, Spork and DatabaseCleaner
6
7
 
7
8
  Scenario: Install Cucumber-Rails
8
- Given I am using rvm "1.8.7"
9
+ Given I am using rvm "ruby-1.8.7-p249"
9
10
  And I am using rvm gemset "cucumber-rails-3.0.0.beta" with Gemfile:
10
11
  """
12
+ source :gemcutter
11
13
  gem 'rails', '3.0.0.beta'
12
14
  gem 'sqlite3-ruby', '1.2.5'
13
- gem 'capybara', '0.3.7'
15
+ gem 'capybara', '0.3.8'
14
16
  """
15
17
  When I successfully run "rails rails-3-app"
16
18
  Then it should pass with:
@@ -18,8 +20,8 @@ Feature: Rails 3
18
20
  README
19
21
  """
20
22
  And I cd to "rails-3-app"
21
- And I symlink this repo to "vendor/plugins/cucumber-rails"
22
- When I successfully run "rails generate cucumber:skeleton --capybara"
23
+ And I symlink "../../.." to "vendor/plugins/cucumber-rails"
24
+ When I successfully run "rails generate cucumber:install --capybara"
23
25
  Then the following files should exist:
24
26
  | config/cucumber.yml |
25
27
  | script/cucumber |
@@ -32,28 +34,30 @@ Feature: Rails 3
32
34
 
33
35
  Scenario Outline: Run Cucumber
34
36
  Given I am using rvm "<ruby_version>"
35
- And I am using rvm gemset "cucumber-rails-3.0.0.beta" with Gemfile:
37
+ And I am using rvm gemset "cucumber-rails-3.0.0.beta-gemset-<gemset>" with Gemfile:
36
38
  """
37
39
  source :gemcutter
38
-
39
40
  gem 'rails', '3.0.0.beta'
40
41
  gem 'sqlite3-ruby', '1.2.5'
41
- gem 'capybara', '0.3.7'
42
+ gem 'capybara', '0.3.8'
43
+ gem 'gherkin', '1.0.30'
44
+ gem 'term-ansicolor', '1.0.4'
45
+ gem 'diff-lcs', '1.1.2'
42
46
  gem 'rspec-rails', '<rspec_version>'
43
47
  """
44
48
  And I successfully run "rails rails-3-app"
45
49
  And I cd to "rails-3-app"
46
- And I symlink this repo to "vendor/plugins/cucumber-rails"
47
- And I successfully run "rails generate cucumber:skeleton --capybara"
48
- And I successfully run "rails generate cucumber:feature post title:string body:text published:boolean"
49
- And I successfully run "rails generate scaffold post title:string body:text published:boolean"
50
- And I successfully run "rails generate scaffold cukes name:string"
50
+ And I symlink "../../.." to "vendor/plugins/cucumber-rails"
51
51
  And I append to "Gemfile" with:
52
52
  """
53
- gem 'capybara', '0.3.7'
54
- gem 'cucumber', '0.7.2'
53
+ gem 'capybara', '0.3.8'
54
+ gem 'cucumber', :path => '../../../../cucumber'
55
55
 
56
56
  """
57
+ And I successfully run "rails generate cucumber:install --capybara"
58
+ And I successfully run "rails generate cucumber:feature post title:string body:text published:boolean"
59
+ And I successfully run "rails generate scaffold post title:string body:text published:boolean"
60
+ And I successfully run "rails generate scaffold cukes name:string"
57
61
  And I write to "app/controllers/cukes_controller.rb" with:
58
62
  """
59
63
  class CukesController < ApplicationController
@@ -78,7 +82,7 @@ Feature: Rails 3
78
82
  |action|index|
79
83
  And I should see "Cuke 10"
80
84
  """
81
- And I successfully run "bundle install"
85
+ And I successfully run "bundle lock"
82
86
  And I successfully run "rake db:migrate"
83
87
  And I successfully run "rake cucumber"
84
88
  Then it should pass with:
@@ -88,6 +92,6 @@ Feature: Rails 3
88
92
  """
89
93
 
90
94
  Examples:
91
- | ruby_version | rspec_version |
92
- | 1.8.7 | 1.3.2 |
93
- | 1.9.1 | 2.0.0.beta.8 |
95
+ | ruby_version | rspec_version | gemset |
96
+ | ruby-1.8.7-p249 | 1.3.2 | 1 |
97
+ | ruby-1.9.1-p378 | 2.0.0.beta.10 | 2 |
@@ -1,10 +1,11 @@
1
+ @announce
1
2
  Feature: Rerun profile
2
3
  In order to concentrate on failing features
3
4
  As a Rails developer working with Cucumber
4
5
  I want to rerun only failing features
5
6
 
6
7
  Scenario: Rerun
7
- Given I have created a new Rails 2 app "rails-2-app" with cucumber-rails support
8
+ Given I have created a new Rails 3 app "rails-3-app" with cucumber-rails support
8
9
  And a file named "rerun.txt" with:
9
10
  """
10
11
  features/rerun_test.feature:2
@@ -28,7 +29,7 @@ Feature: Rerun profile
28
29
  puts "I've always been passing"
29
30
  end
30
31
  """
31
- When I successfully run "rake cucumber:rerun"
32
+ When I successfully run "ruby script/cucumber -p rerun"
32
33
  Then it should pass with:
33
34
  """
34
35
  1 scenario (1 passed)
@@ -1,30 +1,35 @@
1
- Given /^I symlink this repo to "([^\"]*)"$/ do |target|
2
- source = File.expand_path('../../..', __FILE__)
1
+ Given /^I symlink "([^"]*)" to "([^"]*)"$/ do |source, target|
2
+ source = File.expand_path(source, __FILE__)
3
3
  in_current_dir do
4
4
  target = File.expand_path(target)
5
5
  FileUtils.ln_s(source, target)
6
6
  end
7
7
  end
8
8
 
9
- Given /^I have created a new Rails 2 app "([^\"]*)" with cucumber\-rails support$/ do |app_name|
9
+ Given /^I have created a new Rails 3 app "([^"]*)" with cucumber\-rails support$/ do |app_name|
10
10
  steps %Q{
11
- Given I am using rvm "1.8.7"
12
- And I am using rvm gemset "cucumber-rails-2.3.5" with Gemfile:
11
+ Given I am using rvm "ruby-1.8.7-p249"
12
+ And I am using rvm gemset "cucumber-rails-3.0.0.beta-gemset-1" with Gemfile:
13
13
  """
14
- gem 'rails', '2.3.5'
14
+ gem 'rails', '3.0.0.beta'
15
15
  gem 'sqlite3-ruby', '1.2.5'
16
- gem 'capybara', '0.3.6'
17
- gem 'webrat'
18
- gem 'rspec-rails'
19
- gem 'cucumber'
20
- gem 'database_cleaner'
21
- gem 'culerity'
22
- gem 'celerity'
16
+ gem 'capybara', '0.3.8'
17
+ """
18
+ When I successfully run "rails rails-3-app"
19
+ Then it should pass with:
20
+ """
21
+ README
23
22
  """
24
- And I successfully run "rails #{app_name}"
25
23
  And I cd to "#{app_name}"
26
- And I symlink this repo to "vendor/plugins/cucumber-rails"
27
- And I successfully run "ruby script/generate cucumber --capybara"
24
+ And I symlink "../../.." to "vendor/plugins/cucumber-rails"
25
+ And I append to "Gemfile" with:
26
+ """
27
+ gem 'capybara', '0.3.8'
28
+ gem 'cucumber', :path => '../../../../cucumber'
29
+
30
+ """
31
+ And I successfully run "rails generate cucumber:install --capybara"
32
+ And I successfully run "bundle lock"
28
33
  And I successfully run "rake db:migrate"
29
34
  }
30
35
  end
@@ -1,4 +1,4 @@
1
1
  $:.unshift(File.dirname(__FILE__) + '/../../lib')
2
2
  require 'rubygems'
3
- require 'spec'
3
+ require 'rspec/expectations'
4
4
  require 'aruba'
@@ -1,4 +1,4 @@
1
- Spec::Matchers.define :have_files do |expected_files|
1
+ RSpec::Matchers.define :have_files do |expected_files|
2
2
  match do |rails_app|
3
3
  actual_files = rails_app.files
4
4
  @missing_files = expected_files - actual_files
@@ -10,7 +10,7 @@ Spec::Matchers.define :have_files do |expected_files|
10
10
  end
11
11
  end
12
12
 
13
- Spec::Matchers.define :have_contents do |contents|
13
+ RSpec::Matchers.define :have_contents do |contents|
14
14
  match do |file|
15
15
  file.read.include?(contents)
16
16
  end
@@ -4,8 +4,7 @@ Description:
4
4
 
5
5
  This also generates the necessary files in the features directory.
6
6
 
7
- Also see the feature generator, which you can use to generate skeletons
8
- for new features.
7
+ Also see the feature generator
9
8
 
10
9
  Examples:
11
10
  `./script/generate cucumber`
@@ -1,11 +1,10 @@
1
1
  require 'rbconfig'
2
- require 'cucumber/platform'
3
- require File.expand_path(File.join(File.dirname(__FILE__), '../../lib/generators/cucumber/skeleton/skeleton_base'))
2
+ require File.expand_path(File.join(File.dirname(__FILE__), '../../lib/generators/cucumber/install/install_base'))
4
3
 
5
4
  # This generator bootstraps a Rails project for use with Cucumber
6
5
  class CucumberGenerator < Rails::Generator::Base
7
6
 
8
- include Cucumber::Generators::SkeletonBase
7
+ include Cucumber::Generators::InstallBase
9
8
 
10
9
  attr_accessor :driver
11
10
  attr_accessor :framework
@@ -45,7 +44,7 @@ class CucumberGenerator < Rails::Generator::Base
45
44
  end
46
45
 
47
46
  def self.source_root
48
- File.join(gem_root, 'templates', 'skeleton')
47
+ File.join(gem_root, 'templates', 'install')
49
48
  end
50
49
 
51
50
  def source_root
@@ -1,3 +1,4 @@
1
+ # TODO: Not even sure is this is necessary anymore, since we're doing this in Cucumber's rb_world.rb...
1
2
  require 'cucumber/rails/world'
2
3
 
3
4
  begin
@@ -5,7 +6,7 @@ begin
5
6
 
6
7
  [Cucumber::Rails::World, ActionController::Integration::Session].each do |klass|
7
8
  klass.class_eval do
8
- include Rspec::Matchers
9
+ include RSpec::Matchers
9
10
  end
10
11
  end
11
12
  rescue LoadError => try_rspec_1
@@ -0,0 +1,15 @@
1
+ Description:
2
+ Sets up Cucumber in your Rails project. After running this generator you will
3
+ get a new rake task called features.
4
+
5
+ This also generates the necessary files in the features directory.
6
+
7
+ Also see the cucumber:feature generator.
8
+
9
+ Examples:
10
+ `script/rails generate cucumber:install`
11
+
12
+ `script/rails generate cucumber:install --help`
13
+
14
+ You can also provide a language argument for localized webrat_steps:
15
+ `script/rails generate cucumber:install de`
@@ -1,6 +1,6 @@
1
1
  module Cucumber
2
2
  module Generators
3
- module SkeletonBase
3
+ module InstallBase
4
4
 
5
5
  DEFAULT_SHEBANG = File.join(Config::CONFIG['bindir'], Config::CONFIG['ruby_install_name'])
6
6
 
@@ -1,9 +1,9 @@
1
- require File.join(File.dirname(__FILE__), 'skeleton_base')
1
+ require File.join(File.dirname(__FILE__), 'install_base')
2
2
 
3
3
  module Cucumber
4
- class SkeletonGenerator < Rails::Generators::Base
4
+ class InstallGenerator < Rails::Generators::Base
5
5
 
6
- include Cucumber::Generators::SkeletonBase
6
+ include Cucumber::Generators::InstallBase
7
7
 
8
8
  DEFAULT_SHEBANG = File.join(Config::CONFIG['bindir'], Config::CONFIG['ruby_install_name'])
9
9
 
@@ -39,7 +39,7 @@ module Cucumber
39
39
  end
40
40
 
41
41
  def self.source_root
42
- File.join(gem_root, 'templates/skeleton')
42
+ File.join(gem_root, 'templates/install')
43
43
  end
44
44
 
45
45
  def cucumber_rails_env