Skip to content

Commit

Permalink
Update CI matrix and fix tests (resque#766)
Browse files Browse the repository at this point in the history
* Add Ruby 3.2 to CI matrix

* Copy resque/server/test_helper from Resque

* Tweak matrix

* Ensure that Sinatra > 2.0 is used

For some reason, 1.0 may be installed.
 If 1.0 is used, the following error occurs.
```
<internal:/opt/hostedtoolcache/Ruby/3.2.1/x64/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require': cannot load such file -- rack/showexceptions (LoadError)
Did you mean?  rack/show_exceptions
```

* Suppress RuboCop offences
  • Loading branch information
mishina2228 authored Mar 14, 2023
1 parent 2e3fb0d commit edda557
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
- 2.7
- "3.0"
- 3.1
- 3.2
resque-version:
- "master"
- "~> 2.4.0"
Expand All @@ -41,6 +42,8 @@ jobs:
exclude:
- ruby-version: head
rufus-scheduler: 3.2
- ruby-version: 3.2
rufus-scheduler: 3.2

- ruby-version: 2.3
resque-version: "~> 1.27"
Expand Down
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,6 @@ else
gem 'redis', redis_version
end

gem 'sinatra', '> 2.0'

gemspec
2 changes: 1 addition & 1 deletion test/resque-web_test.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# vim:fileencoding=utf-8
require_relative 'test_helper'

require 'resque/server/test_helper'
require_relative 'server/test_helper'

context 'on GET to /schedule' do
setup { get '/schedule' }
Expand Down
19 changes: 19 additions & 0 deletions test/server/test_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
require 'rack/test'
require 'resque/server'

module Resque
module TestHelper
class Test::Unit::TestCase # rubocop:disable Style/ClassAndModuleChildren
include Rack::Test::Methods
def app
Resque::Server.new
end

def self.should_respond_with_success
test 'should respond with success' do
assert last_response.ok?, last_response.errors
end
end
end
end
end

0 comments on commit edda557

Please sign in to comment.