cucumber-rails2 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +4 -0
- data/HACKING.rdoc +24 -0
- data/History.txt +145 -0
- data/LICENSE +22 -0
- data/README.rdoc +70 -0
- data/Rakefile +24 -0
- data/VERSION +1 -0
- data/config/.gitignore +1 -0
- data/cucumber-rails2.gemspec +111 -0
- data/dev_tasks/cucumber.rake +5 -0
- data/dev_tasks/rspec.rake +13 -0
- data/features/rails2.feature +64 -0
- data/features/rails3.feature +97 -0
- data/features/rerun_profile.feature +39 -0
- data/features/step_definitions/cucumber_rails_steps.rb +35 -0
- data/features/support/env.rb +4 -0
- data/features/support/matchers/files.rb +17 -0
- data/generators/cucumber/USAGE +13 -0
- data/generators/cucumber/cucumber_generator.rb +88 -0
- data/generators/feature/USAGE +12 -0
- data/generators/feature/feature_generator.rb +47 -0
- data/lib/cucumber/rails/action_controller.rb +65 -0
- data/lib/cucumber/rails/active_record.rb +34 -0
- data/lib/cucumber/rails/capybara_javascript_emulation.rb +81 -0
- data/lib/cucumber/rails/rspec.rb +22 -0
- data/lib/cucumber/rails/test_unit.rb +7 -0
- data/lib/cucumber/rails/world.rb +48 -0
- data/lib/cucumber/web/tableish.rb +118 -0
- 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/install/USAGE +15 -0
- data/lib/generators/cucumber/install/install_base.rb +202 -0
- data/lib/generators/cucumber/install/install_generator.rb +64 -0
- data/spec/cucumber/web/tableish_spec.rb +192 -0
- data/spec/generators/cucumber/install/install_base_spec.rb +84 -0
- data/spec/spec.opts +2 -0
- data/spec/spec_helper.rb +6 -0
- data/templates/feature/feature.erb +63 -0
- data/templates/feature/steps.erb +14 -0
- data/templates/install/config/cucumber.yml.erb +8 -0
- data/templates/install/environments/cucumber.rb.erb +37 -0
- data/templates/install/script/cucumber +10 -0
- data/templates/install/step_definitions/capybara_steps.rb.erb +214 -0
- data/templates/install/step_definitions/web_steps_cs.rb.erb +136 -0
- data/templates/install/step_definitions/web_steps_da.rb.erb +114 -0
- data/templates/install/step_definitions/web_steps_de.rb.erb +136 -0
- data/templates/install/step_definitions/web_steps_es.rb.erb +136 -0
- data/templates/install/step_definitions/web_steps_ja.rb.erb +139 -0
- data/templates/install/step_definitions/web_steps_ko.rb.erb +141 -0
- data/templates/install/step_definitions/web_steps_no.rb.erb +114 -0
- data/templates/install/step_definitions/web_steps_pt-BR.rb.erb +140 -0
- data/templates/install/step_definitions/webrat_steps.rb.erb +276 -0
- data/templates/install/support/_rails_each_run.rb.erb +35 -0
- data/templates/install/support/_rails_prefork.rb.erb +12 -0
- data/templates/install/support/capybara.rb +9 -0
- data/templates/install/support/edit_warning.txt +5 -0
- data/templates/install/support/paths.rb +33 -0
- data/templates/install/support/rails.rb.erb +4 -0
- data/templates/install/support/rails_spork.rb.erb +13 -0
- data/templates/install/support/webrat.rb +8 -0
- data/templates/install/tasks/cucumber.rake.erb +48 -0
- metadata +143 -0
data/.gitignore
ADDED
data/HACKING.rdoc
ADDED
@@ -0,0 +1,24 @@
|
|
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. You need rvm.
|
13
|
+
|
14
|
+
sudo gem install rvm
|
15
|
+
rvm install ruby-1.8.7-p249 ruby-1.9.1-p378
|
16
|
+
|
17
|
+
== Running all features
|
18
|
+
|
19
|
+
rake cucumber
|
20
|
+
|
21
|
+
This takes a long time because a lot of gems have to be installed. (This is done while running the cucumber features)
|
22
|
+
|
23
|
+
== Gotchas
|
24
|
+
* https://rails.lighthouseapp.com/projects/8994/tickets/3865-invalid-gemspec-format-in-and-already-initialized-constant-warnings-with-ruby-192dev
|
data/History.txt
ADDED
@@ -0,0 +1,145 @@
|
|
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
|
9
|
+
|
10
|
+
This release has a lot of bugfixes! The test suite (based on Aruba) verifies that Cucumber-Rails
|
11
|
+
now works with various combinations of:
|
12
|
+
|
13
|
+
* Cucumber 0.6.x/0.7.2
|
14
|
+
* Rails2/Rails3
|
15
|
+
* RSpec1/RSpec2/Test-Unit/Mini-Uint
|
16
|
+
* Webrat/CapyBara
|
17
|
+
* MRI 1.8.6/1.8.7/1.9.1
|
18
|
+
|
19
|
+
This one requires a special mention: The handy (but error prone) rerun functionality has moved to a
|
20
|
+
separate rerun profile, so all rerun.txt related issues should now be gone.
|
21
|
+
|
22
|
+
== New features
|
23
|
+
* New Capybara Step Definitions for Dates. (Rob Holland)
|
24
|
+
* Steps now recognise "Given I am on the users page" etc. (Solomon White)
|
25
|
+
* Relegate rerun to its own profile and rake task (Mike Sassak)
|
26
|
+
* Added new Then /^(?:|I )should see JSON:$/ step definition to Capybara - useful for REST. (Aslak Hellesøy)
|
27
|
+
* The #tableish method now understands tables with colspan and rowspan
|
28
|
+
* Support RSpec 2 (Johan Kiviniemi, Aslak Hellesøy, Rolf Bjaanes)
|
29
|
+
* Added @no-js-emulation, which turns off javascript emulation for delete links when not using browser testing. (Rob Holland, Aslak Hellesøy)
|
30
|
+
* Korean translation (Shim Taewon)
|
31
|
+
|
32
|
+
=== Bugfixes
|
33
|
+
* No longer need to install the test-unit gem on 1.9.1 (Aslak Hellesøy)
|
34
|
+
* capybara rack-test field should contain step support for textarea (#28 Nicholas Rutherford)
|
35
|
+
* "Rspec is not missing constant Matchers!" error. (#27 David Chelimsky, Aslak Hellesøy)
|
36
|
+
* @culerity tag breaks Rails 3 RESTful helpers (#17 Aslak Hellesøy)
|
37
|
+
|
38
|
+
== 0.3.0 2010-02-25
|
39
|
+
|
40
|
+
This is a major release since we're now supporting both Rails 3 and RSpec 2. Older versions
|
41
|
+
(Rails 2 and RSpec 1) are still supported.
|
42
|
+
|
43
|
+
=== New Features
|
44
|
+
* Support for both Rails-2.x and Rails-3.x (#10 Kristian Mandrup, Aleksey Gureiev, Ashley Moran, Aslak Hellesøy)
|
45
|
+
* Support for both RSpec-1.x and RSpec-2.x (Louis Rose, Aslak Hellesøy)
|
46
|
+
* Features will default to Javascript emulation unless you turn it off with @culerity, (Aslak Hellesøy)
|
47
|
+
* Japanese translation. (MOROHASHI Kyosuke)
|
48
|
+
|
49
|
+
=== Bugfixes
|
50
|
+
* Support projects that don't use ActiveRecord (#14 Aslak Hellesøy)
|
51
|
+
* Running test/unit tests when creating a skeleton (#12 Aleksey Gureiev)
|
52
|
+
* Inform that config/database.yml is overwritten, be smarter about it and inform the user that it is forced. (#15 Aslak Hellesøy)
|
53
|
+
* 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)
|
54
|
+
* Fixed typos in Capybara's web steps (has_not_xpath? => has_no_xpath?) (Thorbjørn Hermansen, Carlos Antonio da Silva)
|
55
|
+
|
56
|
+
== 0.2.5 2010-02-07
|
57
|
+
|
58
|
+
=== New Features
|
59
|
+
* Added Danish translation (Kristian Mandrup)
|
60
|
+
* Using Gemfile for Rails 3. Tidies it up and adds cucumber gems only if not already present! (Kristian Mandrup)
|
61
|
+
* Added Generators wrapper module for Rails 3 generators so they are now all in Cucumber::Generators (Kristian Mandrup)
|
62
|
+
|
63
|
+
=== Bugfixes
|
64
|
+
* Started to work on solutions for generating suitable support files depending on Rails version
|
65
|
+
- see skeleton_base.rb#create_feature_support and templates/support
|
66
|
+
|
67
|
+
== 0.2.4 2010-01-18
|
68
|
+
|
69
|
+
=== New Features
|
70
|
+
* Added Spanish translation (Gabriel)
|
71
|
+
|
72
|
+
=== Bugfixes
|
73
|
+
* Fixed some broken Webrat/Test::Unit step definitions. (Aslak Hellesøy)
|
74
|
+
* Better Javascript emulation with Capybara (#7 Thorbjørn Hermansen)
|
75
|
+
* Removed stray quote in i18n web_steps.rb (Gabriel)
|
76
|
+
* Update hooks to new boolean logic (#6 Jon Larkowski, Michael MacDonald)
|
77
|
+
* Fixed incompatibility with Rails 3 (Mutwin Kraus)
|
78
|
+
* Fixed broken "fill in the following" step for Capybara web_steps (Lenny Marks)
|
79
|
+
* Capybara web_steps.rb with_scope didn't work in nested steps (Lenny Marks)
|
80
|
+
* Fixed "should not see" steps in web_steps.rb to use the correct selector (Toni Tuominen)
|
81
|
+
|
82
|
+
== 0.2.3 2010-01-03
|
83
|
+
|
84
|
+
=== New Features
|
85
|
+
* The #tableish Proc can return Strings as well as Nokogiri nodes now. (Aslak Hellesøy)
|
86
|
+
|
87
|
+
=== Bugfixes
|
88
|
+
* Handle all types of URIs in "I should be on ..." steps. (#5 Andrew D. Smith)
|
89
|
+
|
90
|
+
== 0.2.2 2009-12-21
|
91
|
+
|
92
|
+
=== Bugfixes
|
93
|
+
* Fix bad link in gemspec. (Aslak Hellesøy)
|
94
|
+
* Unified file attaching step names. (Jiří Zajpt)
|
95
|
+
* Fix typos in variable names in several step definitions. (Jiří Zajpt)
|
96
|
+
* cucumber.rake finds the wrong vendored cucumber when a plugin name starts with "cucumber" (#4 James Herdman, Paco Benavent, Aslak Hellesøy)
|
97
|
+
|
98
|
+
=== New features
|
99
|
+
* Czech translations. (Jiří Zajpt)
|
100
|
+
|
101
|
+
== 0.2.1 2009-12-15
|
102
|
+
|
103
|
+
Small bugfix release
|
104
|
+
|
105
|
+
=== Bugfixes
|
106
|
+
* Made sure database_cleaner is always set up as a dependency in config/environments/cucumber.rb. (Aslak Hellesøy)
|
107
|
+
|
108
|
+
== 0.2.0 2009-12-14
|
109
|
+
|
110
|
+
This is the first release of cucumber-rails, which was factored out of cucumber.
|
111
|
+
We're calling it 0.2.0 just because we did some prereleases in the 0.1 series,
|
112
|
+
and to celebrate that cucumber-rails now supports Capybara as an alternative to Webrat.
|
113
|
+
|
114
|
+
=== UPGRADING FROM A PREVIOUS CUCUMBER SETUP
|
115
|
+
|
116
|
+
1) Remove your features/support/version_check.rb
|
117
|
+
2) Remove your features/step_definitions/webrat_steps.rb
|
118
|
+
If you have added your own custom step definitions to this file,
|
119
|
+
put them in a different file under features/step_definitions
|
120
|
+
3) run "ruby script/generate cucumber --help" to see what options you have.
|
121
|
+
4) run "ruby script/generate cucumber" - plus whatever options you think fit for you.
|
122
|
+
Answer "n" (no) when asked to overwrite paths.rb.
|
123
|
+
Answer "y" (yes) when asked to overwrite other files, but do "d" (diff) first.
|
124
|
+
If you have edits in some of these files that you want to keep, store the diff
|
125
|
+
in a temporary file and reapply after you have overwritten the file. ALso consider
|
126
|
+
adding your custom code to another file that won't be overwritten the next time
|
127
|
+
you upgrade.
|
128
|
+
|
129
|
+
Many people have edits in their env.rb file. This is something you should try
|
130
|
+
to avoid in the future. Instead, keep your custom setup in a different file
|
131
|
+
under features/support - Cucumber loads all files under features/**/*.rb anyway.
|
132
|
+
|
133
|
+
If you have a Spork setup, see the end of this thread:
|
134
|
+
http://groups.google.com/group/cukes/browse_thread/thread/475385cc26377215
|
135
|
+
|
136
|
+
=== New features
|
137
|
+
* Added an @emulate_rails_javascript tag that will emulate onclick with Capybara (Aslak Hellesøy, Rob Holland)
|
138
|
+
* Added a smart config/cucumber.yml file that will rerun previously failing scenarios (Aslak Hellesøy)
|
139
|
+
* Support for Capybara. Run "script/generate --capybara" if you want that. (Rob Holland, Aslak Hellesøy)
|
140
|
+
* New #tableish method to extract table-like data from a HTML page. Pure Nokogiri/CSS3/XPath. (Aslak Hellesøy)
|
141
|
+
|
142
|
+
=== Bugfixes
|
143
|
+
* Webrat step "Then I should be on" should use request_uri instead of path for missing query string parameters (ZhangJinzhu)
|
144
|
+
* Added MIME type parameter to attach file step definition (Felix Flores)
|
145
|
+
* Added check when including ActiveSupport::Testing::SetupAndTeardown for older Rails versions (Jeremy Durham)
|
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
ADDED
@@ -0,0 +1,70 @@
|
|
1
|
+
= Cucumber-Rails
|
2
|
+
|
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.
|
5
|
+
|
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.
|
8
|
+
|
9
|
+
== Installation
|
10
|
+
|
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
|
+
gem 'cucumber', '0.7.2'
|
19
|
+
gem 'rspec-rails', '2.0.0.beta.8'
|
20
|
+
gem 'spork'
|
21
|
+
gem 'launchy' # So you can do Then show me the page
|
22
|
+
|
23
|
+
Then install the gems by running:
|
24
|
+
|
25
|
+
bundle install
|
26
|
+
|
27
|
+
Learn about the various options:
|
28
|
+
|
29
|
+
ruby script/rails generate cucumber:install --help
|
30
|
+
|
31
|
+
Finally, bootstrap your Rails app, for example:
|
32
|
+
|
33
|
+
ruby script/rails generate cucumber:install --rspec --capybara
|
34
|
+
|
35
|
+
=== Rails 2.x:
|
36
|
+
|
37
|
+
Before you can use the generator, install the gem by running:
|
38
|
+
|
39
|
+
gem install cucumber-rails
|
40
|
+
|
41
|
+
Learn about the various options:
|
42
|
+
|
43
|
+
ruby script/generate cucumber --help
|
44
|
+
|
45
|
+
Finally, bootstrap your Rails app, for example:
|
46
|
+
|
47
|
+
ruby script/generate cucumber --rspec --capybara
|
48
|
+
|
49
|
+
== Generating a Cucumber feature
|
50
|
+
|
51
|
+
IMPORTANT: Only do this if you are new to Cucumber. We recommend you write your
|
52
|
+
Cucumber features by hand once you get the hang of it.
|
53
|
+
|
54
|
+
=== Rails 3:
|
55
|
+
|
56
|
+
Example:
|
57
|
+
|
58
|
+
ruby script/rails generate cucumber:feature post title:string body:text published:boolean
|
59
|
+
ruby script/rails generate scaffold post title:string body:text published:boolean
|
60
|
+
rake db:migrate
|
61
|
+
rake cucumber
|
62
|
+
|
63
|
+
=== Rails 2:
|
64
|
+
|
65
|
+
Example:
|
66
|
+
|
67
|
+
ruby script/generate feature post title:string body:text published:boolean
|
68
|
+
ruby script/generate scaffold post title:string body:text published:boolean
|
69
|
+
rake db:migrate
|
70
|
+
rake cucumber
|
data/Rakefile
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
begin
|
4
|
+
require 'jeweler'
|
5
|
+
Jeweler::Tasks.new do |gemspec|
|
6
|
+
gemspec.name = "cucumber-rails"
|
7
|
+
gemspec.summary = "Cucumber Generators and Runtime for Rails"
|
8
|
+
gemspec.description = "Cucumber Generators and Runtime for Rails"
|
9
|
+
gemspec.email = "cukes@googlegroups.com"
|
10
|
+
gemspec.homepage = "http://cukes.info"
|
11
|
+
gemspec.authors = ["Dennis Blöte", "Aslak Hellesøy", "Rob Holland"]
|
12
|
+
gemspec.homepage = "http://github.com/aslakhellesoy/cucumber-rails"
|
13
|
+
|
14
|
+
gemspec.add_dependency 'cucumber', '>= 0.8.0'
|
15
|
+
gemspec.add_development_dependency 'aruba', '>= 0.1.9'
|
16
|
+
end
|
17
|
+
Jeweler::GemcutterTasks.new
|
18
|
+
rescue LoadError
|
19
|
+
puts "Jeweler not available. Install it with: sudo gem install jeweler"
|
20
|
+
end
|
21
|
+
|
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
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.3.2
|
data/config/.gitignore
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
aruba-rvm.yml
|
@@ -0,0 +1,111 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{cucumber-rails2}
|
8
|
+
s.version = "0.3.3"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Dennis Bl\303\266te", "Aslak Helles\303\270y", "Rob Holland"]
|
12
|
+
s.date = %q{2010-06-06}
|
13
|
+
s.description = %q{Cucumber Generators and Runtime for Rails}
|
14
|
+
s.email = %q{cukes@googlegroups.com}
|
15
|
+
s.extra_rdoc_files = [
|
16
|
+
"LICENSE",
|
17
|
+
"README.rdoc"
|
18
|
+
]
|
19
|
+
s.files = [
|
20
|
+
".gitignore",
|
21
|
+
"HACKING.rdoc",
|
22
|
+
"History.txt",
|
23
|
+
"LICENSE",
|
24
|
+
"README.rdoc",
|
25
|
+
"Rakefile",
|
26
|
+
"VERSION",
|
27
|
+
"config/.gitignore",
|
28
|
+
"cucumber-rails2.gemspec",
|
29
|
+
"dev_tasks/cucumber.rake",
|
30
|
+
"dev_tasks/rspec.rake",
|
31
|
+
"features/rails2.feature",
|
32
|
+
"features/rails3.feature",
|
33
|
+
"features/rerun_profile.feature",
|
34
|
+
"features/step_definitions/cucumber_rails_steps.rb",
|
35
|
+
"features/support/env.rb",
|
36
|
+
"features/support/matchers/files.rb",
|
37
|
+
"generators/cucumber/USAGE",
|
38
|
+
"generators/cucumber/cucumber_generator.rb",
|
39
|
+
"generators/feature/USAGE",
|
40
|
+
"generators/feature/feature_generator.rb",
|
41
|
+
"lib/cucumber/rails/action_controller.rb",
|
42
|
+
"lib/cucumber/rails/active_record.rb",
|
43
|
+
"lib/cucumber/rails/capybara_javascript_emulation.rb",
|
44
|
+
"lib/cucumber/rails/rspec.rb",
|
45
|
+
"lib/cucumber/rails/test_unit.rb",
|
46
|
+
"lib/cucumber/rails/world.rb",
|
47
|
+
"lib/cucumber/web/tableish.rb",
|
48
|
+
"lib/generators/cucumber/feature/USAGE",
|
49
|
+
"lib/generators/cucumber/feature/feature_base.rb",
|
50
|
+
"lib/generators/cucumber/feature/feature_generator.rb",
|
51
|
+
"lib/generators/cucumber/feature/named_arg.rb",
|
52
|
+
"lib/generators/cucumber/install/USAGE",
|
53
|
+
"lib/generators/cucumber/install/install_base.rb",
|
54
|
+
"lib/generators/cucumber/install/install_generator.rb",
|
55
|
+
"spec/cucumber/web/tableish_spec.rb",
|
56
|
+
"spec/generators/cucumber/install/install_base_spec.rb",
|
57
|
+
"spec/spec.opts",
|
58
|
+
"spec/spec_helper.rb",
|
59
|
+
"templates/feature/feature.erb",
|
60
|
+
"templates/feature/steps.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"
|
83
|
+
]
|
84
|
+
s.homepage = %q{http://github.com/aslakhellesoy/cucumber-rails}
|
85
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
86
|
+
s.require_paths = ["lib"]
|
87
|
+
s.rubygems_version = %q{1.3.7}
|
88
|
+
s.summary = %q{Cucumber Generators and Runtime for Rails}
|
89
|
+
s.test_files = [
|
90
|
+
"spec/cucumber/web/tableish_spec.rb",
|
91
|
+
"spec/generators/cucumber/install/install_base_spec.rb",
|
92
|
+
"spec/spec_helper.rb"
|
93
|
+
]
|
94
|
+
|
95
|
+
if s.respond_to? :specification_version then
|
96
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
97
|
+
s.specification_version = 3
|
98
|
+
|
99
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
100
|
+
s.add_runtime_dependency(%q<cucumber>, ["~> 1.1.0"])
|
101
|
+
s.add_development_dependency(%q<aruba>, [">= 0.1.9"])
|
102
|
+
else
|
103
|
+
s.add_dependency(%q<cucumber>, [">= 0.8.0"])
|
104
|
+
s.add_dependency(%q<aruba>, [">= 0.1.9"])
|
105
|
+
end
|
106
|
+
else
|
107
|
+
s.add_dependency(%q<cucumber>, [">= 0.8.0"])
|
108
|
+
s.add_dependency(%q<aruba>, [">= 0.1.9"])
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
@@ -0,0 +1,13 @@
|
|
1
|
+
begin
|
2
|
+
require 'spec/rake/spectask'
|
3
|
+
|
4
|
+
desc "Run RSpec"
|
5
|
+
Spec::Rake::SpecTask.new do |t|
|
6
|
+
t.spec_opts = %w{--color --diff --format profile}
|
7
|
+
t.spec_files = FileList['spec/**/*_spec.rb']
|
8
|
+
t.rcov = ENV['RCOV']
|
9
|
+
t.rcov_opts = %w{--exclude osx\/objc,gems\/,spec\/}
|
10
|
+
end
|
11
|
+
rescue LoadError
|
12
|
+
task :spec
|
13
|
+
end
|
@@ -0,0 +1,64 @@
|
|
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
|
+
@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:
|
10
|
+
"""
|
11
|
+
source :gemcutter
|
12
|
+
gem 'rails', '<rails_version>'
|
13
|
+
gem 'sqlite3-ruby', '1.2.5'
|
14
|
+
gem 'capybara', '0.3.8'
|
15
|
+
gem 'webrat', '0.7.1'
|
16
|
+
gem 'rspec-rails', '1.3.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'
|
22
|
+
"""
|
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"
|
55
|
+
Then it should pass with:
|
56
|
+
"""
|
57
|
+
3 scenarios (3 passed)
|
58
|
+
14 steps (14 passed)
|
59
|
+
"""
|
60
|
+
|
61
|
+
Examples:
|
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 |
|