Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rails 6 support / Bump tested ruby versions / Clean up #209

Merged
merged 13 commits into from
Apr 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.3.3
2.7.1
26 changes: 6 additions & 20 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,38 +12,24 @@ before_install:
- mkdir geckodriver
- tar -xzf geckodriver-v0.20.1-linux64.tar.gz -C geckodriver
- export PATH=$PATH:$PWD/geckodriver
- gem install bundler -v 1.16.1

before_script: "bundle exec rake test:ci:install"

script: "bundle exec rake test:ci"

### Build Matrix

max_ruby_version: &max_ruby 2.3.3

rvm:
- 2.2.5
- *max_ruby
- ruby-head
- 2.5.8
- 2.6.6
- 2.7.1

global:
gemfile:
- Gemfile

# Run unit tests across all Ruby versions
# Run all tests across all Ruby versions
env:
- UNITS=true

matrix:
allow_failures:
- rvm: ruby-head

# Integration tests
include:
- env: RAILS_VERSION=4.2
rvm: *max_ruby

- env: RAILS_VERSION=5.0
rvm: *max_ruby

- RAILS_VERSION=5.2
- RAILS_VERSION=6.0
9 changes: 2 additions & 7 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
case(RUBY_VERSION)

when "2.2.5" then
when '2.5.8', '2.6.6', '2.7.1' then
appraise "capybara-3.0-ruby#{RUBY_VERSION}" do
gem 'capybara', '~> 3.0.2'
end
when "2.3.3" then
appraise "capybara-3.0-ruby#{RUBY_VERSION}" do
gem 'capybara', '~> 3.0.2'
gem 'capybara', '~> 3.0'
end
end

2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ gem 'gem-release', '0.7.4'

gemspec

gem 'rake', '~> 11.0'
gem 'rake', '~> 13.0'
gem 'test-unit', '~> 3.0'

if RUBY_VERSION =~ /\A1\.9/
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ gem 'ae_page_objects'

### Rails

AePageObjects is built to work with Rails (versions 3.X-5.0) out of the box. To use with Rails,
AePageObjects is built to work with Rails out of the box. To use with Rails,
add this line to your test helper:

```ruby
Expand Down
15 changes: 7 additions & 8 deletions development.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,10 @@ in the gemspec.

### Supported Ruby versions

AePageObjects supports the same minimum Ruby version as Capybara, which is currently 1.9.3. The minimum Ruby version
AePageObjects supports the same minimum Ruby version as Capybara. The minimum Ruby version
is specified in the gemspec.

The test suite tests against the minimum version and a designated maximum version, specified in `.travis.yml`. The test
suite also runs against `ruby-head`, though failures are ignored.
The test suite tests against the minimum version and a designated maximum version, specified in `.travis.yml`.

### Supported Rails versions

Expand Down Expand Up @@ -117,11 +116,11 @@ that the stub/mock setup within the tests works across Capybara versions.
Integration tests using page objects written via AePageObjects run against all versions of Capybara as well. These tests run using a Rails
application, using the most recent version of Rails possible that supports the Ruby version that the version of Capybara under test supports.

Today, all Capybara integration tests are run in the Rails 4.2 application using Ruby 2.2.5. To run these tests:
To run these tests:

```
RAILS_VERSION=4.2 rake test:integration:selenium:install
RAILS_VERSION=4.2 rake test:integration:selenium
RAILS_VERSION=6.0 rake test:integration:selenium:install
RAILS_VERSION=6.0 rake test:integration:selenium
```


Expand All @@ -143,8 +142,8 @@ These tests use the most recent Ruby and Capybara versions possible for the vers
To run the integration tests against a specific version of Rails:

```
RAILS_VERSION=4.0 rake test:integration:selenium:install
RAILS_VERSION=4.0 rake test:integration:selenium
RAILS_VERSION=6.0 rake test:integration:selenium:install
RAILS_VERSION=6.0 rake test:integration:selenium
```

## CI
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ gem "appraisal", "~> 2.0"
gem "mocha", "= 0.13.3"
gem "selenium-webdriver", "~> 3.11.0"
gem "gem-release", "0.7.4"
gem "rake", "~> 11.0"
gem "rake", "~> 13.0"
gem "test-unit", "~> 3.0"
gem "capybara", "~> 3.0.2"
gem "capybara", "~> 3.0"

gemspec path: "../"
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ gem "appraisal", "~> 2.0"
gem "mocha", "= 0.13.3"
gem "selenium-webdriver", "~> 3.11.0"
gem "gem-release", "0.7.4"
gem "rake", "~> 11.0"
gem "rake", "~> 13.0"
gem "test-unit", "~> 3.0"
gem "capybara", "~> 3.0.2"
gem "capybara", "~> 3.0"

gemspec path: "../"
13 changes: 13 additions & 0 deletions gemfiles/capybara_3.0_ruby2.7.1.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "appraisal", "~> 2.0"
gem "mocha", "= 0.13.3"
gem "selenium-webdriver", "~> 3.11.0"
gem "gem-release", "0.7.4"
gem "rake", "~> 13.0"
gem "test-unit", "~> 3.0"
gem "capybara", "~> 3.0"

gemspec path: "../"
8 changes: 4 additions & 4 deletions lib/ae_page_objects/rails/application_router.rb
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,12 @@ def generate_path(named_route, *args)
private

def recognizer
@recognizer ||= case ::Rails.version
when /\A3\.[01]/
@recognizer ||= case ::Rails.gem_version
when Gem::Requirement.new('>= 3.0', '< 3.2')
Recognizer::Rails3.new
when /\A3\.2/
when Gem::Requirement.new('~> 3.2')
Recognizer::Rails32.new
when /\A(4\.[012]|5\.0)/
when Gem::Requirement.new('>= 4.0', '< 7.0')
Recognizer::Rails4Plus.new
else
warn "[WARNING]: AePageObjects is not tested against Rails #{::Rails.version} and may behave in an undefined manner."
Expand Down
11 changes: 0 additions & 11 deletions test/test_apps/4.2/Appraisals

This file was deleted.

32 changes: 0 additions & 32 deletions test/test_apps/4.2/Gemfile

This file was deleted.

2 changes: 0 additions & 2 deletions test/test_apps/4.2/app/assets/javascripts/books.js

This file was deleted.

13 changes: 0 additions & 13 deletions test/test_apps/4.2/app/assets/stylesheets/application.css

This file was deleted.

3 changes: 0 additions & 3 deletions test/test_apps/4.2/app/assets/stylesheets/authors.css.scss

This file was deleted.

3 changes: 0 additions & 3 deletions test/test_apps/4.2/app/assets/stylesheets/books.css.scss

This file was deleted.

69 changes: 0 additions & 69 deletions test/test_apps/4.2/app/assets/stylesheets/scaffolds.css.scss

This file was deleted.

1 change: 0 additions & 1 deletion test/test_apps/4.2/app/controllers

This file was deleted.

2 changes: 0 additions & 2 deletions test/test_apps/4.2/app/helpers/authors_helper.rb

This file was deleted.

2 changes: 0 additions & 2 deletions test/test_apps/4.2/app/helpers/books_helper.rb

This file was deleted.

1 change: 0 additions & 1 deletion test/test_apps/4.2/app/views

This file was deleted.

4 changes: 0 additions & 4 deletions test/test_apps/4.2/bin/rails

This file was deleted.

23 changes: 0 additions & 23 deletions test/test_apps/4.2/config/application.rb

This file was deleted.

4 changes: 0 additions & 4 deletions test/test_apps/4.2/config/boot.rb

This file was deleted.

7 changes: 0 additions & 7 deletions test/test_apps/4.2/config/database.yml

This file was deleted.

5 changes: 0 additions & 5 deletions test/test_apps/4.2/config/environment.rb

This file was deleted.

Loading