Skip to content

Commit a94d6ed

Browse files
authored
Fix failing specs and replace TravisCI with GitHub Actions (#357)
* Fix failing specs * Add GitHub Actions CI workflow * Remove TravisCI * Replace TravisCI badge with GitHub Actions * An older Ubuntu is needed for Ruby 2.2 * Adopt fix proposed by #356
1 parent 34919d7 commit a94d6ed

File tree

6 files changed

+46
-11
lines changed

6 files changed

+46
-11
lines changed

.github/workflows/ci.yml

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: CI
2+
on:
3+
pull_request:
4+
push:
5+
branches:
6+
- master
7+
jobs:
8+
spec:
9+
name: "RSpec / Ruby ${{ matrix.ruby }}"
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
ruby:
14+
[
15+
"2.3",
16+
"2.4",
17+
"2.5",
18+
"2.6",
19+
"2.7",
20+
"3.0",
21+
"3.1",
22+
"3.2"
23+
]
24+
steps:
25+
- uses: actions/checkout@v4
26+
- uses: ruby/setup-ruby@v1
27+
with:
28+
ruby-version: ${{ matrix.ruby }}
29+
bundler-cache: true
30+
- run: bundle exec rake spec
31+
spec-legacy:
32+
name: "RSpec / Ruby 2.2"
33+
runs-on: ubuntu-20.04
34+
steps:
35+
- uses: actions/checkout@v4
36+
uses: ruby/setup-ruby@v1
37+
with:
38+
ruby-version: 2.2
39+
bundler-cache: true
40+
- name: rake spec
41+
run: bundle exec rake spec

.travis.yml

-7
This file was deleted.

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# EM-HTTP-Request
22

3-
[![Gem Version](https://badge.fury.io/rb/em-http-request.svg)](http://rubygems.org/gems/em-http-request) [![Build Status](https://travis-ci.org/igrigorik/em-http-request.svg)](https://travis-ci.org/igrigorik/em-http-request)
3+
[![Gem Version](https://badge.fury.io/rb/em-http-request.svg)](http://rubygems.org/gems/em-http-request)
4+
[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/igrigorik/em-http-request/ci.yml)](https://github.com/igrigorik/em-http-request/actions/workflows/ci.yml)
45

56
Async (EventMachine) HTTP client, with support for:
67

lib/em-http/http_connection.rb

+1
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ def post_init
190190
# the connection because we're processing invalid HTTP
191191
@p.reset!
192192
unbind
193+
:stop
193194
end
194195
end
195196

spec/external_spec.rb

+1-2
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,10 @@
8080
end
8181

8282
it "should detect deflate encoding" do
83-
# pending "need an endpoint which supports deflate.. MSN is no longer"
8483
EventMachine.run {
8584

8685
options = {:head => {"accept-encoding" => "deflate"}, :redirects => 5}
87-
http = EventMachine::HttpRequest.new('http://www.libpng.org/').get options
86+
http = EventMachine::HttpRequest.new('https://www.bing.com/').get options
8887

8988
http.errback { failed(http) }
9089
http.callback {

spec/ssl_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
http.errback { failed(http) }
1111
http.callback {
12-
http.response_header.status.should == 302
12+
http.response_header.status.should == 301
1313
EventMachine.stop
1414
}
1515
}

0 commit comments

Comments
 (0)