cucumber-rails 1.3.0 → 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -7,3 +7,5 @@ coverage
7
7
  .yardoc/
8
8
  .rvmrc
9
9
  Gemfile.lock
10
+ .cucumber.rerun
11
+ gemfiles/*.lock
@@ -1,13 +1,34 @@
1
1
  rvm:
2
2
  - 1.9.3
3
- - 1.9.2
4
- - 1.8.7
3
+ - 2.0.0
4
+
5
5
  # whitelist
6
6
  branches:
7
7
  only:
8
8
  - master
9
+
10
+ gemfile:
11
+ - gemfiles/rails_3_0.gemfile
12
+ - gemfiles/rails_3_1.gemfile
13
+ - gemfiles/rails_3_2.gemfile
14
+ - gemfiles/capybara_1_1.gemfile
15
+
16
+ matrix:
17
+ exclude:
18
+ - rvm: 2.0.0
19
+ gemfile: gemfiles/rails_3_0.gemfile
20
+ - rvm: 2.0.0
21
+ gemfile: gemfiles/rails_3_1.gemfile
22
+ - rvm: 2.0.0
23
+ gemfile: gemfiles/capybara_1_1.gemfile
24
+
25
+ services:
26
+ - mongodb
27
+
9
28
  # Needed for selenium browser
10
- before_script: sh -e /etc/init.d/xvfb start
29
+ before_script:
30
+ - "export DISPLAY=:99.0"
31
+ - "sh -e /etc/init.d/xvfb start"
11
32
 
12
33
  notifications:
13
34
  email:
@@ -0,0 +1,53 @@
1
+ appraise "rails_3_0" do
2
+ gem "rails", "~> 3.0.20"
3
+ gem "capybara", "~> 2.0.2"
4
+ gem "turn"
5
+ gem "rspec-rails"
6
+ gem "jquery-rails"
7
+ gem "uglifier"
8
+ gem "sqlite3"
9
+ gem "bson_ext"
10
+ gem "mongoid"
11
+ end
12
+
13
+ appraise "rails_3_1" do
14
+ gem "rails", "~> 3.1.11"
15
+ gem "capybara", "~> 2.0.2"
16
+ gem 'turn'
17
+ gem 'rspec-rails'
18
+ gem 'sass-rails'
19
+ gem 'coffee-rails'
20
+ gem 'uglifier'
21
+ gem 'jquery-rails'
22
+ gem 'sqlite3'
23
+ gem 'bson_ext'
24
+ gem 'mongoid'
25
+ end
26
+
27
+ appraise "rails_3_2" do
28
+ gem "rails", "~> 3.2.12"
29
+ gem "capybara", "~> 2.0.2"
30
+ gem 'turn'
31
+ gem 'rspec-rails'
32
+ gem 'sass-rails'
33
+ gem 'coffee-rails'
34
+ gem 'uglifier'
35
+ gem 'jquery-rails'
36
+ gem 'sqlite3'
37
+ gem 'bson_ext'
38
+ gem 'mongoid'
39
+ end
40
+
41
+ appraise "capybara_1_1" do
42
+ gem "capybara", "~> 1.1.2"
43
+ gem "rails", "~> 3.2.12"
44
+ gem 'turn'
45
+ gem 'rspec-rails'
46
+ gem 'sass-rails'
47
+ gem 'coffee-rails'
48
+ gem 'uglifier'
49
+ gem 'jquery-rails'
50
+ gem 'sqlite3'
51
+ gem 'bson_ext'
52
+ gem 'mongoid'
53
+ end
@@ -0,0 +1,59 @@
1
+ ## About to create a new Github Issue?
2
+
3
+ We appreciate that. But before you do, please learn our basic rules:
4
+
5
+ * This is not a support forum. If you have a question, please go to [The Cukes Google Group](http://groups.google.com/group/cukes).
6
+ * Do you have an idea for a new feature? Then don't expect it to be implemented unless you or someone else sends a [pull request](https://help.github.com/articles/using-pull-requests). You might be better to start a discussion on [the google group](http://groups.google.com/group/cukes).
7
+ * Reporting a bug? Please tell us:
8
+ * which version of Cucumber you're using
9
+ * which version of Ruby you're using.
10
+ * How to reproduce it. Bugs with a failing test in a [pull request](https://help.github.com/articles/using-pull-requests) get fixed much quicker. Some bugs may never be fixed.
11
+ * Want to paste some code or output? Put \`\`\` on a line above and below your code/output. See [GFM](https://help.github.com/articles/github-flavored-markdown)'s *Fenced Code Blocks* for details.
12
+ * We love [pull requests](https://help.github.com/articles/using-pull-requests). But if you don't have a test to go with it we probably won't merge it.
13
+
14
+ # Contributing to cucumber-rails
15
+
16
+ This document is a guide for those maintaining cucumber-Rails, and others who would like to submit patches.
17
+
18
+ ## Note on Patches/Pull Requests
19
+
20
+ * Fork the project. Make a branch for your change.
21
+ * Make your feature addition or bug fix.
22
+ * Make sure your patch is well covered by tests. We don't accept changes to cucumber-rails that aren't tested.
23
+ * Please do not change the Rakefile, version, or history.
24
+ (if you want to have your own version, that is fine but
25
+ bump version in a commit by itself so we can ignore when we merge your change)
26
+ * Send us a pull request.
27
+
28
+ ## Running tests
29
+
30
+ gem install bundler
31
+ bundle install
32
+ bundle exec rake
33
+
34
+ ## Release Process
35
+
36
+ * Make sure `History.md` is updated with the upcoming version number, and has entries for all fixes.
37
+ * No need to add a `History.md` header at this point - this should be done when a new change is made, later.
38
+ * Make sure you have up-to-date and clean copy of cucumber/cucumber.github.com.git at the same level as cucumber repo.
39
+
40
+ Now release it
41
+
42
+ bundle update
43
+ bundle exec rake
44
+ git commit -m "Release X.Y.Z"
45
+ rake release
46
+
47
+ ## Gaining Release Karma
48
+
49
+ To become a release manager, create a pull request adding your name to the list below, and include your Rubygems email address in the ticket. One of the existing Release managers will then add you.
50
+
51
+ Current release managers:
52
+ * Matt Wynne
53
+ * Aslak Hellesøy
54
+ * Kosmas Chatzimichalis
55
+
56
+ To grant release karma, issue the following command:
57
+
58
+ gem owner cucumber --add <NEW OWNER RUBYGEMS EMAIL>
59
+
data/Gemfile CHANGED
@@ -1,2 +1,17 @@
1
- source :rubygems
1
+ source "https://rubygems.org"
2
+
3
+ # Test dependencies for Rails in the default test task, as test-generated
4
+ # apps do not run bundler for speed reasons. Kept here so they can be
5
+ # excluded from Appraisal-generated gemfiles.
6
+ gem 'rails', '~> 3.2.12'
7
+ gem 'turn'
8
+ gem 'rspec-rails'
9
+ gem 'sass-rails'
10
+ gem 'coffee-rails'
11
+ gem 'uglifier'
12
+ gem 'jquery-rails'
13
+ gem 'sqlite3'
14
+ gem 'bson_ext'
15
+ gem 'mongoid'
16
+
2
17
  gemspec
@@ -0,0 +1,3 @@
1
+ source "https://rubygems.org"
2
+
3
+ gemspec
data/History.md CHANGED
@@ -1,4 +1,17 @@
1
- ## [v1.3.0](https://github.com/cucumber/cucumber-rails/compare/v1.2.1...v1.3.0)
1
+ ## [v1.3.1](https://github.com/cucumber/cucumber-rails/compare/v1.3.0...v1.3.1) (2013-03-15)
2
+
3
+ ### New Features
4
+
5
+ * Multiple-gemfile testing and travis configuration ([#240](https://github.com/cucumber/cucumber-rails/pull/240) Simon Coffey)
6
+
7
+ ### Changed Features
8
+
9
+ * Fix a typo in a template ([#228](https://github.com/cucumber/cucumber-rails/pull/228) Robin Dupret)
10
+ * Depend upon the generic test:prepare task ([#230](https://github.com/cucumber/cucumber-rails/pull/230) Graeme Mathieson)
11
+ * Allow users to disable database_cleaner hooks ([#232](https://github.com/cucumber/cucumber-rails/pull/232) Simon Coffey)
12
+ * Rails 4.0.0-beta ActionController::Integration depreciation fix ([#234](https://github.com/cucumber/cucumber-rails/pull/234) Daniel Bruns)
13
+
14
+ ## [v1.3.0](https://github.com/cucumber/cucumber-rails/compare/v1.2.1...v1.3.0) (2012-02-19)
2
15
 
3
16
  ### New Features
4
17
 
@@ -8,14 +21,14 @@
8
21
 
9
22
  * select_date arguments should be reversed ([#190](https://github.com/cucumber/cucumber-rails/issues/190), [#191](https://github.com/cucumber/cucumber-rails/pull/191) Gavin Hughes)
10
23
 
11
- ## [v1.2.1](https://github.com/cucumber/cucumber-rails/compare/v1.2.0...v1.2.1)
24
+ ## [v1.2.1](https://github.com/cucumber/cucumber-rails/compare/v1.2.0...v1.2.1) (2011-12-04)
12
25
 
13
26
  ### New features
14
27
 
15
28
  * Allow ability to use deletion as a javascript database strategy ([#185](https://github.com/cucumber/cucumber-rails/pull/185) Thijs de Vries)
16
29
  * Support custom JS strategies ([#184](https://github.com/cucumber/cucumber-rails/pull/184) Michael Pabst)
17
30
 
18
- ## [v1.2.0](https://github.com/cucumber/cucumber-rails/compare/v1.1.1...v1.2.0)
31
+ ## [v1.2.0](https://github.com/cucumber/cucumber-rails/compare/v1.1.1...v1.2.0) (2011-11-03)
19
32
 
20
33
  ### Removed features
21
34
  * The (deprecated) tableish method has been removed. See https://gist.github.com/1299371 for an alternative. (Aslak Hellesøy)
@@ -23,14 +36,14 @@
23
36
  ### Bugfixes
24
37
  * Non-threadsafe database connections shared between threads ([#166](https://github.com/cucumber/cucumber-rails/issues/166) Matt Wynne)
25
38
 
26
- ## [v1.1.1](https://github.com/cucumber/cucumber-rails/compare/v1.1.0...v1.1.1)
39
+ ## [v1.1.1](https://github.com/cucumber/cucumber-rails/compare/v1.1.0...v1.1.1) (2011-10-03)
27
40
 
28
41
  ### Removed features
29
42
 
30
43
  The `cucumber:feature` generator has been removed. The reasoning behind this is the same as for
31
44
  removing `web_steps.rb`, `paths.rb` and `selectors.rb` in v1.1.0.
32
45
 
33
- ## [v1.1.0](https://github.com/cucumber/cucumber-rails/compare/v1.0.6...v1.1.0)
46
+ ## [v1.1.0](https://github.com/cucumber/cucumber-rails/compare/v1.0.6...v1.1.0) (2011-09-28)
34
47
 
35
48
  ### Removed features
36
49
 
@@ -71,23 +84,23 @@ You can learn more about the reasoning behind this change at the following links
71
84
 
72
85
  You can learn more about what Capybara has to offer in Capybara's [README](https://github.com/jnicklas/capybara).
73
86
 
74
- ## [v1.0.6](https://github.com/cucumber/cucumber-rails/compare/v1.0.5...v1.0.6)
87
+ ## [v1.0.6](https://github.com/cucumber/cucumber-rails/compare/v1.0.5...v1.0.6) (2011-09-25)
75
88
 
76
89
  ### Bugfixes
77
90
  * Fix deprecation warnings ([#169](https://github.com/cucumber/cucumber-rails/issues/169), [#170](https://github.com/cucumber/cucumber-rails/pull/170) Micah Geisel)
78
91
  * Deprecate #tableish. The Capybara::Node::Finders API has obsoleted the need for it. ([#145](https://github.com/cucumber/cucumber-rails/issues/145) Aslak Hellesøy)
79
92
 
80
- ## [v1.0.5](https://github.com/cucumber/cucumber-rails/compare/v1.0.4...v1.0.5)
93
+ ## [v1.0.5](https://github.com/cucumber/cucumber-rails/compare/v1.0.4...v1.0.5) (2011-09-14)
81
94
 
82
95
  ### Bugfixes
83
96
  * No = dependencies in gemspec, since rubies with old YAML (sych) can't read them. (Aslak Hellesøy)
84
97
 
85
- ## [v1.0.4](https://github.com/cucumber/cucumber-rails/compare/v1.0.3...v1.0.4)
98
+ ## [v1.0.4](https://github.com/cucumber/cucumber-rails/compare/v1.0.3...v1.0.4) (2011-09-12)
86
99
 
87
100
  ### Bugfixes
88
101
  * Active_record hook prevents features that access multiple database from running correctly ([#152](https://github.com/cucumber/cucumber-rails/issues/152) winnipegtransit)
89
102
 
90
- ## [v1.0.3](https://github.com/cucumber/cucumber-rails/compare/v1.0.2...v1.0.3)
103
+ ## [v1.0.3](https://github.com/cucumber/cucumber-rails/compare/v1.0.2...v1.0.3) (2011-09-11)
91
104
 
92
105
  ### Bugfixes
93
106
  * sqlite3-ruby is now sqlite3 ([#158](https://github.com/cucumber/cucumber-rails/pull/158) Trung Le)
@@ -97,29 +110,29 @@ You can learn more about what Capybara has to offer in Capybara's [README](https
97
110
  * Extend javascript emulation to handle rails CSRF protection ([#164](https://github.com/cucumber/cucumber-rails/pull/164) Jonathon M. Abbott)
98
111
  * Add steps for finding fields with errors ([#162](https://github.com/cucumber/cucumber-rails/pull/162) Mike Burns)
99
112
 
100
- ## [v1.0.2](https://github.com/cucumber/cucumber-rails/compare/v1.0.1...v1.0.2)
113
+ ## [v1.0.2](https://github.com/cucumber/cucumber-rails/compare/v1.0.1...v1.0.2) (2011-06-26)
101
114
 
102
115
  ### Bugfixes
103
116
  * Removed the dependency on rack-test, since it is not used directly. v1.0.1 was incompatible with Rails 3.0.9. (Aslak Hellesøy)
104
117
 
105
- ## [v1.0.1](https://github.com/cucumber/cucumber-rails/compare/v1.0.0...v1.0.1)
118
+ ## [v1.0.1](https://github.com/cucumber/cucumber-rails/compare/v1.0.0...v1.0.1) (2011-06-25)
106
119
 
107
120
  ### New Features
108
121
  * Added a @no-database-cleaner tag you can add if you don't want to run DatabaseCleaner. Useful for debugging if you want to leave data in the database. Typical use case is to run `rails server --environment test` to look at/try app with data from test. (Aslak Hellesøy)
109
122
  * History file is now in Markdown format. (Aslak Hellesøy)
110
123
 
111
- ## [v1.0.0](https://github.com/cucumber/cucumber-rails/compare/v0.5.2...v1.0.0)
124
+ ## [v1.0.0](https://github.com/cucumber/cucumber-rails/compare/v0.5.2...v1.0.0) (2011-06-20)
112
125
 
113
126
  ### New Features
114
127
  * Upgraded Cucumber dependency to 1.0.0. (Aslak Hellesøy)
115
128
 
116
- ## [v0.5.2](https://github.com/cucumber/cucumber-rails/compare/v0.5.1...v0.5.2)
129
+ ## [v0.5.2](https://github.com/cucumber/cucumber-rails/compare/v0.5.1...v0.5.2) (2011-06-07)
117
130
 
118
131
  ### New Features
119
132
  * Upgraded to Capybara 1.0.0.rc1 (Aslak Hellesøy)
120
133
  * Add stats to generator (#144 Aslak Hellesøy)
121
134
 
122
- ## [v0.5.1](https://github.com/cucumber/cucumber-rails/compare/v0.5.0...v0.5.1)
135
+ ## [v0.5.1](https://github.com/cucumber/cucumber-rails/compare/v0.5.0...v0.5.1) (2011-05-25)
123
136
 
124
137
  ### Bugfixes
125
138
  * Mixed DB access feature for @javascript drivers (#142 Alexander Mankuta)
@@ -127,14 +140,14 @@ You can learn more about what Capybara has to offer in Capybara's [README](https
127
140
  * New project can't find capybara's "visit" (#143 Aslak Hellesøy)
128
141
  * rails generate cucumber:install attempts double run (#140 Aslak Hellesøy)
129
142
 
130
- ## [v0.5.0](https://github.com/cucumber/cucumber-rails/compare/v0.5.0.beta1...v0.5.0)
143
+ ## [v0.5.0](https://github.com/cucumber/cucumber-rails/compare/v0.5.0.beta1...v0.5.0) (2011-05-17)
131
144
 
132
145
  ### Bugfixes
133
146
  * undefined method `add_assertion' for nil:NilClass (#96, #97, #98 Aslak Hellesøy)
134
147
  * Capybara name error from env.rb (#125 Aslak Hellesøy)
135
148
  * Fixed date-localization bug (#138 Michael Opitz)
136
149
 
137
- ## [v0.5.0.beta1](https://github.com/cucumber/cucumber-rails/compare/v0.4.1...v0.5.0.beta1)
150
+ ## [v0.5.0.beta1](https://github.com/cucumber/cucumber-rails/compare/v0.4.1...v0.5.0.beta1) (2011-05-09)
138
151
 
139
152
  ### Removed features
140
153
  * Dropped support for Rails 2 (Aslak Hellesøy)
@@ -146,14 +159,14 @@ You can learn more about what Capybara has to offer in Capybara's [README](https
146
159
  * Generated paths.rb cleanup (#133 Tim Pope)
147
160
  * Allow css pseudo-classes in scopers (#122 twalpole)
148
161
 
149
- ## [v0.4.1](https://github.com/cucumber/cucumber-rails/compare/v0.4.0...v0.4.1)
162
+ ## [v0.4.1](https://github.com/cucumber/cucumber-rails/compare/v0.4.0...v0.4.1) (2011-04-05)
150
163
 
151
164
  ### Bugfixes
152
165
  * Fixed incorrect warning in generated files. (#115 Emanuele Vicentini)
153
166
  * Fixed incorrect hooks for DatabaseCleaner (#113 Markus Bengts)
154
167
  * Throw an error if the user forgot to add DatabaseCleaner to the Gemfile, allowing them to decide whether or not to use it. (#36 Aslak Hellesøy, Ryan Bigg)
155
168
 
156
- ## [v0.4.0](https://github.com/cucumber/cucumber-rails/compare/v0.3.2...v0.4.0)
169
+ ## [v0.4.0](https://github.com/cucumber/cucumber-rails/compare/v0.3.2...v0.4.0) (2011-03-20)
157
170
 
158
171
  ### New Features
159
172
  * Add selectors helper (#63 Bodaniel Jeanes)
@@ -176,12 +189,12 @@ You can learn more about what Capybara has to offer in Capybara's [README](https
176
189
  * Cucumber::Rails::World.use_transactional_fixtures. TODO: Explain what to do instead.
177
190
  No more Cucumber::Rails::World.use_transactional_fixtures = false. Use DatabaseCleaner.strategy = :none instead
178
191
 
179
- ## [v0.3.2](https://github.com/cucumber/cucumber-rails/compare/v0.3.1...v0.3.2)
192
+ ## [v0.3.2](https://github.com/cucumber/cucumber-rails/compare/v0.3.1...v0.3.2) (2010-06-06) The `rails-2.3.x` support branch branches off from here.
180
193
  * web_steps.rb uses "([^"]*)" instead of "([^\"]*)" (Aslak Hellesøy)
181
194
  * Renamed cucumber:skeleton to cucumber:install (Rails 3 generator). (Aslak Hellesøy)
182
195
  * Upgraded to be compatible with rspec 2.0.0.beta.10 (#35 Gabor Ratky, Pete Yandell)
183
196
 
184
- ## [v0.3.1](https://github.com/cucumber/cucumber-rails/compare/v0.3.0...v0.3.1)
197
+ ## [v0.3.1](https://github.com/cucumber/cucumber-rails/compare/v0.3.0...v0.3.1) (2010-05-04)
185
198
 
186
199
  This release has a lot of bugfixes! The test suite (based on Aruba) verifies that Cucumber-Rails
187
200
  now works with various combinations of:
@@ -210,7 +223,7 @@ separate rerun profile, so all rerun.txt related issues should now be gone.
210
223
  * "Rspec is not missing constant Matchers!" error. (#27 David Chelimsky, Aslak Hellesøy)
211
224
  * @culerity tag breaks Rails 3 RESTful helpers (#17 Aslak Hellesøy)
212
225
 
213
- ## [v0.3.0](https://github.com/cucumber/cucumber-rails/compare/v0.2.4...v0.3.0)
226
+ ## [v0.3.0](https://github.com/cucumber/cucumber-rails/compare/v0.2.4...v0.3.0) (2010-02-26)
214
227
 
215
228
  This is a major release since we're now supporting both Rails 3 and RSpec 2. Older versions
216
229
  (Rails 2 and RSpec 1) are still supported.
@@ -238,7 +251,7 @@ This is a major release since we're now supporting both Rails 3 and RSpec 2. Old
238
251
  * Started to work on solutions for generating suitable support files depending on Rails version
239
252
  - see skeleton_base.rb#create_feature_support and templates/support
240
253
 
241
- ## [v0.2.4](https://github.com/cucumber/cucumber-rails/compare/v0.2.3...v0.2.4)
254
+ ## [v0.2.4](https://github.com/cucumber/cucumber-rails/compare/v0.2.3...v0.2.4) (2010-01-18)
242
255
 
243
256
  ### New Features
244
257
  * Added Spanish translation (Gabriel)
@@ -253,7 +266,7 @@ This is a major release since we're now supporting both Rails 3 and RSpec 2. Old
253
266
  * Capybara web_steps.rb with_scope didn't work in nested steps (Lenny Marks)
254
267
  * Fixed "should not see" steps in web_steps.rb to use the correct selector (Toni Tuominen)
255
268
 
256
- ## [v0.2.3](https://github.com/cucumber/cucumber-rails/compare/v0.2.2...v0.2.3)
269
+ ## [v0.2.3](https://github.com/cucumber/cucumber-rails/compare/v0.2.2...v0.2.3) (2010-01-03)
257
270
 
258
271
  ### New Features
259
272
  * The #tableish Proc can return Strings as well as Nokogiri nodes now. (Aslak Hellesøy)
@@ -261,7 +274,7 @@ This is a major release since we're now supporting both Rails 3 and RSpec 2. Old
261
274
  ### Bugfixes
262
275
  * Handle all types of URIs in "I should be on ..." steps. (#5 Andrew D. Smith)
263
276
 
264
- ## [v0.2.2](https://github.com/cucumber/cucumber-rails/compare/v0.2.1...v0.2.2)
277
+ ## [v0.2.2](https://github.com/cucumber/cucumber-rails/compare/v0.2.1...v0.2.2) (2009-12-21)
265
278
 
266
279
  ### Bugfixes
267
280
  * Fix bad link in gemspec. (Aslak Hellesøy)
@@ -272,7 +285,7 @@ This is a major release since we're now supporting both Rails 3 and RSpec 2. Old
272
285
  ### New features
273
286
  * Czech translations. (Jiří Zajpt)
274
287
 
275
- ## [v0.2.1](https://github.com/cucumber/cucumber-rails/compare/v0.2.0...v0.2.1)
288
+ ## [v0.2.1](https://github.com/cucumber/cucumber-rails/compare/v0.2.0...v0.2.1) (2009-12-16)
276
289
 
277
290
  Small bugfix release
278
291
 
data/README.md CHANGED
@@ -1,16 +1,15 @@
1
1
  # Cucumber-Rails
2
2
 
3
3
  [![Build Status](https://secure.travis-ci.org/cucumber/cucumber-rails.png)](http://travis-ci.org/cucumber/cucumber-rails)
4
- [![Dependency Status](https://gemnasium.com/cucumber/cucumber-rails.png)](https://gemnasium.com/cucumber/cucumber-rails)
5
4
 
6
- Cucumber-Rails brings Cucumber to Rails 3.x. For Rails 2x support, see the [Cucumber Wiki](https://github.com/cucumber/cucumber/wiki/Ruby-on-Rails).
5
+ Cucumber-Rails brings Cucumber to Rails 3.x. For Rails 2.3.x support, see the [rails-2.3.x branch](https://github.com/cucumber/cucumber-rails/tree/rails-2.3.x).
7
6
 
8
7
  ## Installation
9
8
 
10
9
  Before you can use the generator, add the gem to your project's Gemfile as follows:
11
10
 
12
11
  group :test do
13
- gem 'cucumber-rails'
12
+ gem 'cucumber-rails', :require => false
14
13
  # database_cleaner is not required, but highly recommended
15
14
  gem 'database_cleaner'
16
15
  end
@@ -55,10 +54,35 @@ I strongly recommend rvm and ruby 1.9.3. When you have that, cd into your cucumb
55
54
  gem install bundler
56
55
  bundle install
57
56
 
58
- ### Running all features
57
+ ### Running all tests
59
58
 
60
- With all dependencies installed, all features should pass:
59
+ With all dependencies installed, all specs and features should pass:
61
60
 
62
- rake cucumber
61
+ rake
63
62
 
64
63
  One of the features uses MongoDB, which needs to be running in order to make features/mongoid.feature to pass.
64
+
65
+ ### Running Appraisal suite
66
+
67
+ In order to test against multiple versions of key dependencies, the [Appraisal](https://github.com/thoughtbot/appraisal) is used to generate multiple gemfiles, stored in the `gemfiles/` directory. Normally these will only run on Travis; however, if you want to run the full test suite against all gemfiles, run the following commands:
68
+
69
+ rake gemfiles:install
70
+ rake test:all
71
+
72
+ To run the suite against a named gemfile, use the following:
73
+
74
+ rake test:gemfile[rails_3_0]
75
+
76
+ To remove and rebuild the different gemfiles (for example, to update a rails version or its dependencies), use the following:
77
+
78
+ rake gemfiles:rebuild
79
+
80
+ ### Adding dependencies
81
+
82
+ To support the multiple-gemfile testing, when adding a new dependency the following rules apply:
83
+
84
+ 1. If it's a runtime dependency of the gem, add it to the gemspec
85
+ 2. If it's a primary development dependency, add it to the gemspec
86
+ 3. If it's a dependency of a generated rails app in a test, add it to the Gemfile (for local test runs) and each appraisal section (if necessary).
87
+
88
+ For example, rspec is a primary development dependency, so it lives in the gemspec. By contrast, coffee-rails is a dependency of apps generated with rails 3.1 and 3.2, so lives in the main Gemfile and the rails 3.1 and 3.2 appraisal sections.
data/Rakefile CHANGED
@@ -1,9 +1,12 @@
1
1
  # encoding: utf-8
2
2
  CUCUMBER_RAILS_VERSION = Gem::Specification.load(File.dirname(__FILE__) + '/cucumber-rails.gemspec').version.version
3
3
  require 'rubygems'
4
+ require 'bundler'
5
+ require 'bundler/setup'
6
+ require 'appraisal'
4
7
  require 'rdoc' # https://github.com/lsegal/yard/commit/b861dcc2d7f7e1fbbed7b552ac2e4f7caf68bafa
5
8
  require 'rake/clean'
6
- require 'bundler'
9
+ require 'pathname'
7
10
  Bundler::GemHelper.install_tasks
8
11
 
9
12
  $:.unshift(File.dirname(__FILE__) + '/lib')
@@ -11,18 +14,36 @@ Dir["#{File.dirname(__FILE__)}/dev_tasks/*.rake"].sort.each { |ext| load ext }
11
14
 
12
15
  CLEAN.include('doc', 'tmp')
13
16
 
14
- # Needed for selenium browser
15
- # See http://about.travis-ci.org/docs/user/selenium-setup/
16
- task :travis do
17
- ["rspec spec", "rake cucumber"].each do |cmd|
18
- puts "Starting to run #{cmd}..."
19
- system("export DISPLAY=:99.0 && bundle exec #{cmd}")
20
- raise "#{cmd} failed!" unless $?.exitstatus == 0
17
+ task :default => :test
18
+
19
+ task :test => [:spec, :cucumber]
20
+
21
+ namespace :test do
22
+ desc "Run tests against all gemfiles"
23
+ task :all do
24
+ Rake::Task['appraisal'].invoke('test')
25
+ end
26
+
27
+ desc "Run tests against specified gemfile, e.g. rake test:gemfile[rails_3_0]"
28
+ task :gemfile, :name do |task, args|
29
+ unless args.name && Pathname.new("gemfiles/#{args.name}.gemfile").exist?
30
+ raise ArgumentError "You must provide the name of an existing Appraisal gemfile, e.g. 'rake test:gemfile[rails_3_2]'"
31
+ end
32
+ Rake::Task["appraisal:#{args.name}"].invoke('test')
21
33
  end
22
34
  end
23
35
 
24
- if ENV['TRAVIS']
25
- task :default => :travis
26
- else
27
- task :default => [:spec, :cucumber]
28
- end
36
+ namespace :gemfiles do
37
+ desc "Install dependencies for all gemfiles"
38
+ task :install do
39
+ ENV['BUNDLE_GEMFILE'] = "Gemfile.appraisal"
40
+ Rake::Task['appraisal:install'].invoke
41
+ end
42
+
43
+ task :clean do
44
+ FileUtils.rm_rf("gemfiles/*")
45
+ end
46
+
47
+ desc "Rebuild generated gemfiles and install dependencies"
48
+ task :rebuild => [:clean, :install]
49
+ end