cucumber-rails 0.2.4 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +3 -2
- data/HACKING.rdoc +34 -0
- data/History.txt +29 -0
- data/README.rdoc +48 -22
- data/Rakefile +6 -1
- data/VERSION +1 -1
- data/config/.gitignore +1 -0
- data/cucumber-rails.gemspec +49 -25
- data/dev_tasks/cucumber.rake +5 -0
- data/{tasks → dev_tasks}/rspec.rake +0 -0
- data/features/rails2.feature +56 -0
- data/features/rails3.feature +52 -0
- data/features/step_definitions/cucumber_rails_steps.rb +7 -0
- data/features/support/env.rb +4 -0
- data/features/support/matchers/files.rb +17 -0
- data/generators/cucumber/cucumber_generator.rb +27 -134
- data/generators/cucumber/templates/step_definitions/web_steps_ja.rb.erb +136 -0
- data/generators/feature/feature_generator.rb +30 -24
- data/lib/cucumber/rails/capybara_javascript_emulation.rb +25 -14
- data/lib/cucumber/rails/rspec.rb +20 -7
- data/lib/cucumber/rails/world.rb +5 -1
- data/lib/cucumber/web/tableish.rb +67 -65
- data/lib/generators/cucumber/feature/USAGE +16 -0
- data/lib/generators/cucumber/feature/feature_base.rb +29 -0
- data/lib/generators/cucumber/feature/feature_generator.rb +37 -0
- data/lib/generators/cucumber/feature/named_arg.rb +17 -0
- data/lib/generators/cucumber/skeleton/USAGE +21 -0
- data/lib/generators/cucumber/skeleton/skeleton_base.rb +202 -0
- data/lib/generators/cucumber/skeleton/skeleton_generator.rb +64 -0
- data/rvm.yml +22 -0
- data/spec/cucumber/web/tableish_spec.rb +2 -0
- data/spec/generators/cucumber/skeleton/skeleton_base_spec.rb +84 -0
- data/spec/spec.opts +2 -0
- data/{generators/feature/templates → templates/feature}/feature.erb +18 -12
- data/{generators/feature/templates → templates/feature}/steps.erb +0 -0
- data/{generators/cucumber/templates → templates/skeleton}/config/cucumber.yml.erb +0 -0
- data/{generators/cucumber/templates → templates/skeleton}/environments/cucumber.rb.erb +2 -2
- data/{generators/cucumber/templates → templates/skeleton}/script/cucumber +0 -0
- data/{generators/cucumber/templates → templates/skeleton}/step_definitions/capybara_steps.rb.erb +18 -8
- data/{generators/cucumber/templates → templates/skeleton}/step_definitions/web_steps_cs.rb.erb +0 -0
- data/templates/skeleton/step_definitions/web_steps_da.rb.erb +114 -0
- data/{generators/cucumber/templates → templates/skeleton}/step_definitions/web_steps_de.rb.erb +0 -0
- data/{generators/cucumber/templates → templates/skeleton}/step_definitions/web_steps_es.rb.erb +0 -0
- data/{generators/cucumber/templates → templates/skeleton}/step_definitions/web_steps_no.rb.erb +0 -0
- data/{generators/cucumber/templates → templates/skeleton}/step_definitions/web_steps_pt-BR.rb.erb +0 -0
- data/{generators/cucumber/templates → templates/skeleton}/step_definitions/webrat_steps.rb.erb +13 -3
- data/{generators/cucumber/templates → templates/skeleton}/support/_rails_each_run.rb +7 -2
- data/{generators/cucumber/templates → templates/skeleton}/support/_rails_prefork.rb.erb +1 -1
- data/{generators/cucumber/templates → templates/skeleton}/support/capybara.rb +0 -0
- data/{generators/cucumber/templates → templates/skeleton}/support/edit_warning.txt +0 -0
- data/{generators/cucumber/templates → templates/skeleton}/support/paths.rb +0 -0
- data/{generators/cucumber/templates → templates/skeleton}/support/rails.rb.erb +0 -0
- data/{generators/cucumber/templates → templates/skeleton}/support/rails_spork.rb.erb +0 -0
- data/{generators/cucumber/templates → templates/skeleton}/support/webrat.rb +0 -0
- data/{generators/cucumber/templates → templates/skeleton}/tasks/cucumber.rake.erb +1 -1
- metadata +77 -31
data/.gitignore
CHANGED
data/HACKING.rdoc
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
= Hacking on Cucumber-Rails
|
2
|
+
|
3
|
+
If you have a bugfix or a new feature you want to contribute, please fork on Github and make your own feature branch:
|
4
|
+
|
5
|
+
git clone git@github.com:you/cucumber-rails.git
|
6
|
+
git checkout -b 87-add-chinese-translation
|
7
|
+
|
8
|
+
The feature branch should contain a ticket number (if appliccable) and a descriptive name that aligns with the ticket name.
|
9
|
+
|
10
|
+
== Setting up your environment
|
11
|
+
|
12
|
+
Before you change anything, you should make sure you can run all the Cucumber features for Cucumber-Rails.
|
13
|
+
The first time you clone the repo you may have to install Rails for all of the Ruby versions we're testing against.
|
14
|
+
For this you need RVM:
|
15
|
+
|
16
|
+
=== Installing rubies with RVM
|
17
|
+
|
18
|
+
sudo gem install rvm
|
19
|
+
rvm install 1.8.7 1.9.1
|
20
|
+
|
21
|
+
=== Installing gems
|
22
|
+
|
23
|
+
In order to avoid conflicts we'll use RVM's gem sets to set up a gem set for each combination of Ruby version and Rails version
|
24
|
+
to be tested against. Open platforms.yml and modify the rubies section if you have different patchlevels for the rubies.
|
25
|
+
|
26
|
+
Installing the various gem sets is done with the following command:
|
27
|
+
|
28
|
+
rake gemsets:install
|
29
|
+
|
30
|
+
This will take 10-15 minutes to complete, as there are many gems to download. After you have done this once you shouldn't have
|
31
|
+
to do it again (unless future versions require new gems).
|
32
|
+
|
33
|
+
== Gotchas
|
34
|
+
* https://rails.lighthouseapp.com/projects/8994/tickets/3865-invalid-gemspec-format-in-and-already-initialized-constant-warnings-with-ruby-192dev
|
data/History.txt
CHANGED
@@ -1,3 +1,32 @@
|
|
1
|
+
== 0.3.0
|
2
|
+
|
3
|
+
This is a major release since we're now supporting both Rails 3 and RSpec 2. Older versions
|
4
|
+
(Rails 2 and RSpec 1) are still supported.
|
5
|
+
|
6
|
+
=== New Features
|
7
|
+
* Support for both Rails-2.x and Rails-3.x (#10 Kristian Mandrup, Aleksey Gureiev, Ashley Moran, Aslak Hellesøy)
|
8
|
+
* Support for both RSpec-1.x and RSpec-2.x (Louis Rose, Aslak Hellesøy)
|
9
|
+
* Features will default to Javascript emulation unless you turn it off with @culerity, (Aslak Hellesøy)
|
10
|
+
* Japanese translation. (MOROHASHI Kyosuke)
|
11
|
+
|
12
|
+
=== Bugfixes
|
13
|
+
* Support projects that don't use ActiveRecord (#14 Aslak Hellesøy)
|
14
|
+
* Running test/unit tests when creating a skeleton (#12 Aleksey Gureiev)
|
15
|
+
* Inform that config/database.yml is overwritten, be smarter about it and inform the user that it is forced. (#15 Aslak Hellesøy)
|
16
|
+
* Reverts changes from issue #5 where verification of query string params was added to the step for being on a page. Adds step discussed in issue #11 for verification of query string. (#5, #11 Eric Milford)
|
17
|
+
* Fixed typos in Capybara's web steps (has_not_xpath? => has_no_xpath?) (Thorbjørn Hermansen, Carlos Antonio da Silva)
|
18
|
+
|
19
|
+
== 0.2.5 2010-02-07
|
20
|
+
|
21
|
+
=== New Features
|
22
|
+
* Added Danish translation (Kristian Mandrup)
|
23
|
+
* Using Gemfile for Rails 3. Tidies it up and adds cucumber gems only if not already present! (Kristian Mandrup)
|
24
|
+
* Added Generators wrapper module for Rails 3 generators so they are now all in Cucumber::Generators (Kristian Mandrup)
|
25
|
+
|
26
|
+
=== Bugfixes
|
27
|
+
* Started to work on solutions for generating suitable support files depending on Rails version
|
28
|
+
- see skeleton_base.rb#create_feature_support and templates/support
|
29
|
+
|
1
30
|
== 0.2.4 2010-01-18
|
2
31
|
|
3
32
|
=== New Features
|
data/README.rdoc
CHANGED
@@ -1,38 +1,64 @@
|
|
1
|
-
=
|
1
|
+
= Cucumber-Rails
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
on the Cukes Mailing List.
|
3
|
+
Cucumber-Rails brings Cucumber to Rails2 and Rails3. It contains 2 generators - one
|
4
|
+
for bootstrapping your Rails app for Cucumber, and a second one for generating features.
|
6
5
|
|
7
|
-
|
8
|
-
|
6
|
+
Cucumber-Rails also contains Cucumber Step Definitions that wrap Capybara or Webrat,
|
7
|
+
giving you a head start for writing Cucumber features against your Rails app.
|
9
8
|
|
10
|
-
==
|
9
|
+
== Installation
|
11
10
|
|
12
|
-
|
11
|
+
=== Rails 3:
|
12
|
+
|
13
|
+
Before you can use the generator, add the necessary gems to your project's Gemfile as follows:
|
14
|
+
|
15
|
+
gem 'capybara'
|
16
|
+
gem 'database_cleaner'
|
17
|
+
gem 'cucumber-rails'
|
18
|
+
|
19
|
+
Or if you prefer the latest and greatest:
|
20
|
+
|
21
|
+
gem 'capybara', :git => 'git://github.com/jnicklas/capybara.git'
|
22
|
+
gem 'database_cleaner', :git => 'git://github.com/bmabey/database_cleaner.git'
|
23
|
+
gem 'cucumber-rails', :git => 'git://github.com/aslakhellesoy/cucumber-rails3.git'
|
24
|
+
|
25
|
+
Then install the gems by running:
|
13
26
|
|
14
|
-
|
27
|
+
bundle install
|
15
28
|
|
16
|
-
|
17
|
-
applications on your system. If you run script/generate without any
|
18
|
-
additional arguments you should see the available generators listed.
|
29
|
+
Finally, bootstrap your Rails app by running:
|
19
30
|
|
20
|
-
|
21
|
-
|
31
|
+
ruby script/rails generate cucumber:skeleton
|
32
|
+
|
33
|
+
=== Rails 2.x:
|
34
|
+
|
35
|
+
Before you can use the generator, install the gem by running:
|
36
|
+
|
37
|
+
gem install cucumber-rails
|
38
|
+
|
39
|
+
Finally, bootstrap your Rails app by running:
|
22
40
|
|
23
41
|
script/generate cucumber
|
24
42
|
|
43
|
+
== Generating a Cucumber feature
|
44
|
+
|
45
|
+
IMPORTANT: Only do this if you are new to Cucumber. We recommend you write your
|
46
|
+
Cucumber features by hand once you get the hang of it.
|
25
47
|
|
26
|
-
|
48
|
+
=== Rails 3:
|
27
49
|
|
28
|
-
|
29
|
-
* feature: Generates a skeleton for a new feature
|
50
|
+
Example:
|
30
51
|
|
31
|
-
|
52
|
+
ruby script/rails generate cucumber:feature post title:string body:text published:boolean
|
53
|
+
ruby script/rails generate scaffold post title:string body:text published:boolean
|
54
|
+
rake db:migrate
|
55
|
+
rake cucumber
|
32
56
|
|
33
|
-
|
57
|
+
=== Rails 2:
|
34
58
|
|
35
|
-
|
59
|
+
Example:
|
36
60
|
|
37
|
-
|
38
|
-
|
61
|
+
ruby script/generate feature post title:string body:text published:boolean
|
62
|
+
ruby script/generate scaffold post title:string body:text published:boolean
|
63
|
+
rake db:migrate
|
64
|
+
rake cucumber
|
data/Rakefile
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
1
3
|
begin
|
2
4
|
require 'jeweler'
|
3
5
|
Jeweler::Tasks.new do |gemspec|
|
@@ -10,10 +12,13 @@ begin
|
|
10
12
|
gemspec.homepage = "http://github.com/aslakhellesoy/cucumber-rails"
|
11
13
|
|
12
14
|
gemspec.add_dependency 'cucumber', '>= 0.6.2'
|
15
|
+
gemspec.add_development_dependency 'aruba', '>= 0.1.5'
|
13
16
|
end
|
14
17
|
Jeweler::GemcutterTasks.new
|
15
18
|
rescue LoadError
|
16
19
|
puts "Jeweler not available. Install it with: sudo gem install jeweler"
|
17
20
|
end
|
18
21
|
|
19
|
-
|
22
|
+
$:.unshift(File.dirname(__FILE__) + '/lib')
|
23
|
+
Dir["#{File.dirname(__FILE__)}/dev_tasks/*.rake"].sort.each { |ext| load ext }
|
24
|
+
task :default => :cucumber
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.3.0
|
data/config/.gitignore
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
aruba-rvm.yml
|
data/cucumber-rails.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{cucumber-rails}
|
8
|
-
s.version = "0.
|
8
|
+
s.version = "0.3.0"
|
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-02-26}
|
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 = [
|
@@ -17,36 +17,25 @@ Gem::Specification.new do |s|
|
|
17
17
|
]
|
18
18
|
s.files = [
|
19
19
|
".gitignore",
|
20
|
+
"HACKING.rdoc",
|
20
21
|
"History.txt",
|
21
22
|
"README.rdoc",
|
22
23
|
"Rakefile",
|
23
24
|
"VERSION",
|
25
|
+
"config/.gitignore",
|
24
26
|
"cucumber-rails.gemspec",
|
27
|
+
"dev_tasks/cucumber.rake",
|
28
|
+
"dev_tasks/rspec.rake",
|
29
|
+
"features/rails2.feature",
|
30
|
+
"features/rails3.feature",
|
31
|
+
"features/step_definitions/cucumber_rails_steps.rb",
|
32
|
+
"features/support/env.rb",
|
33
|
+
"features/support/matchers/files.rb",
|
25
34
|
"generators/cucumber/USAGE",
|
26
35
|
"generators/cucumber/cucumber_generator.rb",
|
27
|
-
"generators/cucumber/templates/
|
28
|
-
"generators/cucumber/templates/environments/cucumber.rb.erb",
|
29
|
-
"generators/cucumber/templates/script/cucumber",
|
30
|
-
"generators/cucumber/templates/step_definitions/capybara_steps.rb.erb",
|
31
|
-
"generators/cucumber/templates/step_definitions/web_steps_cs.rb.erb",
|
32
|
-
"generators/cucumber/templates/step_definitions/web_steps_de.rb.erb",
|
33
|
-
"generators/cucumber/templates/step_definitions/web_steps_es.rb.erb",
|
34
|
-
"generators/cucumber/templates/step_definitions/web_steps_no.rb.erb",
|
35
|
-
"generators/cucumber/templates/step_definitions/web_steps_pt-BR.rb.erb",
|
36
|
-
"generators/cucumber/templates/step_definitions/webrat_steps.rb.erb",
|
37
|
-
"generators/cucumber/templates/support/_rails_each_run.rb",
|
38
|
-
"generators/cucumber/templates/support/_rails_prefork.rb.erb",
|
39
|
-
"generators/cucumber/templates/support/capybara.rb",
|
40
|
-
"generators/cucumber/templates/support/edit_warning.txt",
|
41
|
-
"generators/cucumber/templates/support/paths.rb",
|
42
|
-
"generators/cucumber/templates/support/rails.rb.erb",
|
43
|
-
"generators/cucumber/templates/support/rails_spork.rb.erb",
|
44
|
-
"generators/cucumber/templates/support/webrat.rb",
|
45
|
-
"generators/cucumber/templates/tasks/cucumber.rake.erb",
|
36
|
+
"generators/cucumber/templates/step_definitions/web_steps_ja.rb.erb",
|
46
37
|
"generators/feature/USAGE",
|
47
38
|
"generators/feature/feature_generator.rb",
|
48
|
-
"generators/feature/templates/feature.erb",
|
49
|
-
"generators/feature/templates/steps.erb",
|
50
39
|
"lib/cucumber/rails/action_controller.rb",
|
51
40
|
"lib/cucumber/rails/active_record.rb",
|
52
41
|
"lib/cucumber/rails/capybara_javascript_emulation.rb",
|
@@ -54,17 +43,49 @@ Gem::Specification.new do |s|
|
|
54
43
|
"lib/cucumber/rails/test_unit.rb",
|
55
44
|
"lib/cucumber/rails/world.rb",
|
56
45
|
"lib/cucumber/web/tableish.rb",
|
46
|
+
"lib/generators/cucumber/feature/USAGE",
|
47
|
+
"lib/generators/cucumber/feature/feature_base.rb",
|
48
|
+
"lib/generators/cucumber/feature/feature_generator.rb",
|
49
|
+
"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",
|
57
54
|
"spec/cucumber/web/tableish_spec.rb",
|
55
|
+
"spec/generators/cucumber/skeleton/skeleton_base_spec.rb",
|
56
|
+
"spec/spec.opts",
|
58
57
|
"spec/spec_helper.rb",
|
59
|
-
"
|
58
|
+
"templates/feature/feature.erb",
|
59
|
+
"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_no.rb.erb",
|
69
|
+
"templates/skeleton/step_definitions/web_steps_pt-BR.rb.erb",
|
70
|
+
"templates/skeleton/step_definitions/webrat_steps.rb.erb",
|
71
|
+
"templates/skeleton/support/_rails_each_run.rb",
|
72
|
+
"templates/skeleton/support/_rails_prefork.rb.erb",
|
73
|
+
"templates/skeleton/support/capybara.rb",
|
74
|
+
"templates/skeleton/support/edit_warning.txt",
|
75
|
+
"templates/skeleton/support/paths.rb",
|
76
|
+
"templates/skeleton/support/rails.rb.erb",
|
77
|
+
"templates/skeleton/support/rails_spork.rb.erb",
|
78
|
+
"templates/skeleton/support/webrat.rb",
|
79
|
+
"templates/skeleton/tasks/cucumber.rake.erb"
|
60
80
|
]
|
61
81
|
s.homepage = %q{http://github.com/aslakhellesoy/cucumber-rails}
|
62
82
|
s.rdoc_options = ["--charset=UTF-8"]
|
63
83
|
s.require_paths = ["lib"]
|
64
|
-
s.rubygems_version = %q{1.3.
|
84
|
+
s.rubygems_version = %q{1.3.6}
|
65
85
|
s.summary = %q{Cucumber Generators and Runtime for Rails}
|
66
86
|
s.test_files = [
|
67
87
|
"spec/cucumber/web/tableish_spec.rb",
|
88
|
+
"spec/generators/cucumber/skeleton/skeleton_base_spec.rb",
|
68
89
|
"spec/spec_helper.rb"
|
69
90
|
]
|
70
91
|
|
@@ -74,11 +95,14 @@ Gem::Specification.new do |s|
|
|
74
95
|
|
75
96
|
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
76
97
|
s.add_runtime_dependency(%q<cucumber>, [">= 0.6.2"])
|
98
|
+
s.add_development_dependency(%q<aruba>, [">= 0.1.5"])
|
77
99
|
else
|
78
100
|
s.add_dependency(%q<cucumber>, [">= 0.6.2"])
|
101
|
+
s.add_dependency(%q<aruba>, [">= 0.1.5"])
|
79
102
|
end
|
80
103
|
else
|
81
104
|
s.add_dependency(%q<cucumber>, [">= 0.6.2"])
|
105
|
+
s.add_dependency(%q<aruba>, [">= 0.1.5"])
|
82
106
|
end
|
83
107
|
end
|
84
108
|
|
File without changes
|
@@ -0,0 +1,56 @@
|
|
1
|
+
Feature: Rails 2
|
2
|
+
In order to take over the world
|
3
|
+
Cucumber-Rails should work on major versions
|
4
|
+
of Rails2 and Ruby, with Capybara, Webrat, Spork and DatabaseCleaner
|
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"
|
9
|
+
When I successfully run "rails rails-2-app"
|
10
|
+
Then it should pass with:
|
11
|
+
"""
|
12
|
+
create README
|
13
|
+
"""
|
14
|
+
And I cd to "rails-2-app"
|
15
|
+
When I successfully run "ruby script/generate cucumber <args>"
|
16
|
+
Then the following files should exist:
|
17
|
+
| config/cucumber.yml |
|
18
|
+
| config/environments/cucumber.rb |
|
19
|
+
| script/cucumber |
|
20
|
+
| features/step_definitions/web_steps.rb |
|
21
|
+
| features/support/env.rb |
|
22
|
+
| features/support/paths.rb |
|
23
|
+
| lib/tasks/cucumber.rake |
|
24
|
+
And the file "features/support/env.rb" should contain "<env_rb_1>"
|
25
|
+
And the file "features/support/env.rb" should contain "<env_rb_2>"
|
26
|
+
And the file "config/environments/cucumber.rb" should contain "<cucumber_rb_1>"
|
27
|
+
And the file "config/environments/cucumber.rb" should contain "<cucumber_rb_2>"
|
28
|
+
And the file "config/database.yml" should contain "cucumber:"
|
29
|
+
|
30
|
+
Examples:
|
31
|
+
| args | env_rb_1 | env_rb_2 | cucumber_rb_1 | cucumber_rb_2 |
|
32
|
+
| --webrat --rspec | require 'cucumber/rails/rspec' | require 'webrat' | config.gem 'webrat' | config.gem 'rspec-rails' |
|
33
|
+
| --capybara --testunit | require 'cucumber/rails/world' | require 'capybara/rails' | config.gem 'capybara' | config.gem 'database_cleaner' |
|
34
|
+
|
35
|
+
@announce-cmd
|
36
|
+
Scenario Outline: Run Cucumber
|
37
|
+
Given I am using rvm "1.8.7"
|
38
|
+
And I am using rvm gemset "cucumber-rails-2.3.5"
|
39
|
+
And I successfully run "rails rails-2-app"
|
40
|
+
And I cd to "rails-2-app"
|
41
|
+
And I symlink this repo to "vendor/plugins/cucumber-rails"
|
42
|
+
And I successfully run "ruby script/generate cucumber --capybara"
|
43
|
+
And I successfully run "ruby script/generate feature post title:string body:text published:boolean <feature_args>"
|
44
|
+
And I successfully run "ruby script/generate scaffold post title:string body:text published:boolean"
|
45
|
+
And I successfully run "rake db:migrate"
|
46
|
+
When I successfully run "rake cucumber"
|
47
|
+
Then it should pass with:
|
48
|
+
"""
|
49
|
+
2 scenarios (2 passed)
|
50
|
+
11 steps (11 passed)
|
51
|
+
"""
|
52
|
+
|
53
|
+
Examples:
|
54
|
+
| feature_args |
|
55
|
+
| |
|
56
|
+
| --capybara culerity |
|
@@ -0,0 +1,52 @@
|
|
1
|
+
@announce-cmd
|
2
|
+
Feature: Rails 3
|
3
|
+
In order to take over the world
|
4
|
+
Cucumber-Rails should work on major versions
|
5
|
+
of Rails2 and Ruby, with Capybara, Spork and DatabaseCleaner
|
6
|
+
|
7
|
+
Scenario: Install Cucumber-Rails
|
8
|
+
Given I am using rvm "1.8.7"
|
9
|
+
And I am using rvm gemset "cucumber-rails-3.0.0.beta"
|
10
|
+
When I successfully run "rails rails-3-app"
|
11
|
+
Then it should pass with:
|
12
|
+
"""
|
13
|
+
README
|
14
|
+
"""
|
15
|
+
And I cd to "rails-3-app"
|
16
|
+
And I symlink this repo to "vendor/plugins/cucumber-rails"
|
17
|
+
When I successfully run "rails generate cucumber:skeleton"
|
18
|
+
Then the following files should exist:
|
19
|
+
| config/cucumber.yml |
|
20
|
+
| script/cucumber |
|
21
|
+
| features/step_definitions/web_steps.rb |
|
22
|
+
| features/support/env.rb |
|
23
|
+
| features/support/paths.rb |
|
24
|
+
| lib/tasks/cucumber.rake |
|
25
|
+
And the file "features/support/env.rb" should contain "require 'cucumber/rails/world'"
|
26
|
+
And the file "features/support/env.rb" should contain "require 'capybara/rails'"
|
27
|
+
|
28
|
+
Scenario: Run Cucumber
|
29
|
+
Given I am using rvm "1.8.7"
|
30
|
+
And I am using rvm gemset "cucumber-rails-3.0.0.beta"
|
31
|
+
And I successfully run "rails rails-3-app"
|
32
|
+
And I cd to "rails-3-app"
|
33
|
+
And I symlink this repo to "vendor/plugins/cucumber-rails"
|
34
|
+
And I successfully run "rails generate cucumber:skeleton"
|
35
|
+
And I successfully run "rails generate cucumber:feature post title:string body:text published:boolean"
|
36
|
+
And I successfully run "rails generate scaffold post title:string body:text published:boolean"
|
37
|
+
And I append to "Gemfile" with:
|
38
|
+
"""
|
39
|
+
gem 'cucumber'
|
40
|
+
gem 'database_cleaner'
|
41
|
+
gem 'capybara', :git => 'git://github.com/jnicklas/capybara.git'
|
42
|
+
|
43
|
+
"""
|
44
|
+
And I run "bundle install"
|
45
|
+
And I successfully run "rake db:migrate"
|
46
|
+
And I run "rake cucumber"
|
47
|
+
Then it should pass with:
|
48
|
+
"""
|
49
|
+
2 scenarios (2 passed)
|
50
|
+
11 steps (11 passed)
|
51
|
+
"""
|
52
|
+
|