File tree Expand file tree Collapse file tree 14 files changed +113
-72
lines changed Expand file tree Collapse file tree 14 files changed +113
-72
lines changed Original file line number Diff line number Diff line change 1+ name : Test
2+ on : [push]
3+ jobs :
4+ runTests :
5+ runs-on : ubuntu-latest
6+
7+ strategy :
8+ matrix :
9+ include :
10+ - ruby-version : 2.3.8
11+ rails-version : 3
12+ - ruby-version : 2.3.8
13+ rails-version : 40
14+ - ruby-version : 2.3.8
15+ rails-version : 42
16+
17+ - ruby-version : 2.3.8
18+ rails-version : 50_rspec
19+ - ruby-version : 2.6.9
20+ rails-version : 50_simplecov
21+ - ruby-version : 2.7.5
22+ rails-version : 6
23+ # - ruby-version: 2.7.5
24+ # rails-version: 70
25+
26+ env :
27+ BUNDLE_GEMFILE : ${{ github.workspace }}/gemfiles/rails_${{ matrix.rails-version }}.gemfile
28+
29+ steps :
30+ - uses : actions/checkout@master
31+ - name : Install ruby
32+ uses : ruby/setup-ruby@v1
33+ with :
34+ ruby-version : ${{ matrix.ruby-version }}
35+ bundler-cache : true
36+ bundler : ' 1.17.3'
37+
38+ - name : Run tests
39+ run : |
40+ bundle exec rake spec
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 33# to test against all, run: appraisal rake spec
44
55if RUBY_VERSION <= '2.4'
6+ # to get a working ruby 2.3: `docker run --rm -it --volume $PWD:/app ruby:2.3-stretch bash`
67 appraise 'rails-3' do
78 gem 'rails' , '~>3.2.22'
89 gem 'test-unit'
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ source 'https://rubygems.org'
66# NB: all other non-listed gems should go into Appraisals,
77# this file is only for quick tests
88
9- unless defined? ( Appraisal )
9+ unless defined? ( Appraisal ) || RUBY_VERSION < '2.6'
1010 # rails should be included before us
1111 gem 'rails' , '~>5.2.6'
1212 gem 'simplecov' , require : false
Original file line number Diff line number Diff line change 33source "https://rubygems.org"
44
55gem "rails", "~>3.2.22"
6- gem "simplecov", require: false
7- gem "sprockets"
8- gem "sass"
96gem "test-unit"
107
118gemspec path: "../"
Original file line number Diff line number Diff line change 33source "https://rubygems.org"
44
55gem "rails", "~>4.0.0"
6- gem "simplecov", require: false
7- gem "sprockets"
8- gem "sass"
96
107gemspec path: "../"
Original file line number Diff line number Diff line change 33source "https://rubygems.org"
44
55gem "rails", "~>4.2.0"
6- gem "simplecov", require: false
7- gem "sprockets"
8- gem "sass"
96
107gemspec path: "../"
Original file line number Diff line number Diff line change @@ -170,15 +170,15 @@ def self._collect_route_groups(all_routes)
170170 when :constraints
171171 value . all? do |constraint_name , constraint_value |
172172 if constraint_value . present?
173- route . constraints [ constraint_name ] && route . constraints [ constraint_name ] . match? ( constraint_value )
173+ route . constraints [ constraint_name ] && route . constraints [ constraint_name ] . match ( constraint_value )
174174 else
175175 route . constraints [ constraint_name ] . blank?
176176 end
177177 end
178178 end
179179 end
180180 else
181- route . path . spec . to_s . match? ( matcher )
181+ route . path . spec . to_s . match ( matcher )
182182 end
183183 end
184184
@@ -197,9 +197,9 @@ def self._touch_request(req)
197197 else # rails < 4.2
198198 dispatcher = route . app
199199 req . env [ 'action_dispatch.request.path_parameters' ] =
200- ( env [ 'action_dispatch.request.path_parameters' ] || { } ) . merge ( parameters )
200+ ( req . env [ 'action_dispatch.request.path_parameters' ] || { } ) . merge ( parameters )
201201 while dispatcher . is_a? ( ActionDispatch ::Routing ::Mapper ::Constraints )
202- dispatcher = ( dispatcher . app if dispatcher . matches? ( env ) )
202+ dispatcher = ( dispatcher . app if dispatcher . matches? ( req . env ) )
203203 end
204204 end
205205 next unless dispatcher
Original file line number Diff line number Diff line change @@ -95,8 +95,10 @@ def expected_routes
9595 namespaces_regex = Regexp . union ( @settings . exclude_namespaces . map { |n | %r{^/#{ n } } } )
9696
9797 routes_groups = all_routes . group_by do |r |
98+ # rails <=4 has regex in verb
99+ verb = r . verb . is_a? ( Regexp ) && r . verb . inspect . gsub ( /[^\w ]/ , '' ) || r . verb
98100 (
99- ( "#{ r . verb . to_s [ 8 ..- 3 ] } #{ r . path . spec } " . strip =~ filter_regex ) ||
101+ ( "#{ verb } #{ r . path . spec } " . strip =~ filter_regex ) ||
100102 ( r . path . spec . to_s =~ namespaces_regex )
101103 ) . present?
102104 end
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ Gem::Specification.new do |spec|
2626 spec . require_paths = [ "lib" ]
2727
2828 spec . add_development_dependency 'appraisal'
29- spec . add_development_dependency "bundler" , ">= 2.2.10"
29+ spec . add_development_dependency "bundler" # , ">= 2.2.10"
3030 spec . add_development_dependency "minitest"
3131 spec . add_development_dependency "rake" , ">= 12.3.3"
3232end
You can’t perform that action at this time.
0 commit comments