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.
- data/HACKING.rdoc +1 -1
- data/History.txt +9 -2
- data/LICENSE +22 -0
- data/README.rdoc +2 -2
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/cucumber-rails.gemspec +37 -36
- data/features/rails2.feature +50 -85
- data/features/rails3.feature +22 -18
- data/features/rerun_profile.feature +3 -2
- data/features/step_definitions/cucumber_rails_steps.rb +21 -16
- data/features/support/env.rb +1 -1
- data/features/support/matchers/files.rb +2 -2
- data/generators/cucumber/USAGE +1 -2
- data/generators/cucumber/cucumber_generator.rb +3 -4
- data/lib/cucumber/rails/rspec.rb +2 -1
- data/lib/generators/cucumber/install/USAGE +15 -0
- data/lib/generators/cucumber/{skeleton/skeleton_base.rb → install/install_base.rb} +1 -1
- data/lib/generators/cucumber/{skeleton/skeleton_generator.rb → install/install_generator.rb} +4 -4
- data/spec/generators/cucumber/{skeleton/skeleton_base_spec.rb → install/install_base_spec.rb} +3 -3
- data/templates/{skeleton → install}/config/cucumber.yml.erb +0 -0
- data/templates/{skeleton → install}/environments/cucumber.rb.erb +0 -0
- data/templates/{skeleton → install}/script/cucumber +0 -0
- data/templates/{skeleton → install}/step_definitions/capybara_steps.rb.erb +23 -23
- data/templates/{skeleton → install}/step_definitions/web_steps_cs.rb.erb +25 -25
- data/templates/{skeleton → install}/step_definitions/web_steps_da.rb.erb +20 -20
- data/templates/{skeleton → install}/step_definitions/web_steps_de.rb.erb +26 -26
- data/templates/{skeleton → install}/step_definitions/web_steps_es.rb.erb +26 -26
- data/templates/{skeleton → install}/step_definitions/web_steps_ja.rb.erb +28 -28
- data/templates/{skeleton → install}/step_definitions/web_steps_ko.rb.erb +26 -26
- data/templates/{skeleton → install}/step_definitions/web_steps_no.rb.erb +20 -20
- data/templates/{skeleton → install}/step_definitions/web_steps_pt-BR.rb.erb +27 -27
- data/templates/{skeleton → install}/step_definitions/webrat_steps.rb.erb +26 -26
- data/templates/{skeleton → install}/support/_rails_each_run.rb.erb +0 -0
- data/templates/{skeleton → install}/support/_rails_prefork.rb.erb +0 -0
- data/templates/{skeleton → install}/support/capybara.rb +0 -0
- data/templates/{skeleton → install}/support/edit_warning.txt +0 -0
- data/templates/{skeleton → install}/support/paths.rb +0 -0
- data/templates/{skeleton → install}/support/rails.rb.erb +0 -0
- data/templates/{skeleton → install}/support/rails_spork.rb.erb +0 -0
- data/templates/{skeleton → install}/support/webrat.rb +0 -0
- data/templates/{skeleton → install}/tasks/cucumber.rake.erb +0 -0
- metadata +45 -35
- data/lib/generators/cucumber/skeleton/USAGE +0 -21
- 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
|
+
== 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:
|
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:
|
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.
|
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
|
+
0.3.2
|
data/cucumber-rails.gemspec
CHANGED
@@ -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.
|
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-
|
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
|
-
"
|
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/
|
51
|
-
"lib/generators/cucumber/
|
52
|
-
"lib/generators/cucumber/
|
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/
|
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/
|
61
|
-
"templates/
|
62
|
-
"templates/
|
63
|
-
"templates/
|
64
|
-
"templates/
|
65
|
-
"templates/
|
66
|
-
"templates/
|
67
|
-
"templates/
|
68
|
-
"templates/
|
69
|
-
"templates/
|
70
|
-
"templates/
|
71
|
-
"templates/
|
72
|
-
"templates/
|
73
|
-
"templates/
|
74
|
-
"templates/
|
75
|
-
"templates/
|
76
|
-
"templates/
|
77
|
-
"templates/
|
78
|
-
"templates/
|
79
|
-
"templates/
|
80
|
-
"templates/
|
81
|
-
"templates/
|
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.
|
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/
|
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::
|
99
|
-
s.add_runtime_dependency(%q<cucumber>, [">= 0.
|
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.
|
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.
|
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
|
data/features/rails2.feature
CHANGED
@@ -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
|
-
|
7
|
-
|
8
|
-
|
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
|
-
|
11
|
+
source :gemcutter
|
12
|
+
gem 'rails', '<rails_version>'
|
11
13
|
gem 'sqlite3-ruby', '1.2.5'
|
12
|
-
gem 'capybara', '0.3.
|
13
|
-
gem 'webrat', '0.7.
|
14
|
+
gem 'capybara', '0.3.8'
|
15
|
+
gem 'webrat', '0.7.1'
|
14
16
|
gem 'rspec-rails', '1.3.2'
|
15
|
-
gem 'cucumber', '0.
|
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
|
-
|
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
|
-
|
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
|
-
|
|
41
|
-
| --webrat --
|
42
|
-
| --capybara --
|
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 |
|
data/features/rails3.feature
CHANGED
@@ -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.
|
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
|
22
|
-
When I successfully run "rails generate cucumber:
|
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.
|
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
|
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.
|
54
|
-
gem 'cucumber', '
|
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
|
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
|
92
|
-
| 1.8.7
|
93
|
-
| 1.9.1
|
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
|
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 "
|
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
|
2
|
-
source = File.expand_path(
|
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
|
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-
|
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', '
|
14
|
+
gem 'rails', '3.0.0.beta'
|
15
15
|
gem 'sqlite3-ruby', '1.2.5'
|
16
|
-
gem 'capybara', '0.3.
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
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
|
27
|
-
And I
|
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
|
data/features/support/env.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
|
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
|
-
|
13
|
+
RSpec::Matchers.define :have_contents do |contents|
|
14
14
|
match do |file|
|
15
15
|
file.read.include?(contents)
|
16
16
|
end
|
data/generators/cucumber/USAGE
CHANGED
@@ -1,11 +1,10 @@
|
|
1
1
|
require 'rbconfig'
|
2
|
-
require 'cucumber/
|
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::
|
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', '
|
47
|
+
File.join(gem_root, 'templates', 'install')
|
49
48
|
end
|
50
49
|
|
51
50
|
def source_root
|
data/lib/cucumber/rails/rspec.rb
CHANGED
@@ -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
|
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`
|
data/lib/generators/cucumber/{skeleton/skeleton_generator.rb → install/install_generator.rb}
RENAMED
@@ -1,9 +1,9 @@
|
|
1
|
-
require File.join(File.dirname(__FILE__), '
|
1
|
+
require File.join(File.dirname(__FILE__), 'install_base')
|
2
2
|
|
3
3
|
module Cucumber
|
4
|
-
class
|
4
|
+
class InstallGenerator < Rails::Generators::Base
|
5
5
|
|
6
|
-
include Cucumber::Generators::
|
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/
|
42
|
+
File.join(gem_root, 'templates/install')
|
43
43
|
end
|
44
44
|
|
45
45
|
def cucumber_rails_env
|