Skip to content

Commit d629ecf

Browse files
authored
Prefer sus for tests and 100% test coverage. (#28)
1 parent d384583 commit d629ecf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+2456
-1589
lines changed

.github/workflows/coverage.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- macos
2222

2323
ruby:
24-
- "3.1"
24+
- "3.2"
2525

2626
steps:
2727
- uses: actions/checkout@v3
@@ -47,7 +47,7 @@ jobs:
4747
- uses: actions/checkout@v3
4848
- uses: ruby/setup-ruby@v1
4949
with:
50-
ruby-version: "3.1"
50+
ruby-version: "3.2"
5151
bundler-cache: true
5252

5353
- uses: actions/download-artifact@v3

.github/workflows/documentation.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232

3333
- uses: ruby/setup-ruby@v1
3434
with:
35-
ruby-version: "3.1"
35+
ruby-version: "3.2"
3636
bundler-cache: true
3737

3838
- name: Installing packages

.github/workflows/test-external.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ jobs:
2323
- "2.7"
2424
- "3.0"
2525
- "3.1"
26+
- "3.2"
2627

2728
steps:
2829
- uses: actions/checkout@v3

.github/workflows/test.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ jobs:
2424
- "2.7"
2525
- "3.0"
2626
- "3.1"
27+
- "3.2"
2728

2829
experimental: [false]
2930

.rspec

Lines changed: 0 additions & 3 deletions
This file was deleted.

config/sus.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
require 'covered/sus'
2+
include Covered::Sus

gems.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# frozen_string_literal: true
22

33
# Released under the MIT License.
4-
# Copyright, 2018-2022, by Samuel Williams.
4+
# Copyright, 2018-2023, by Samuel Williams.
55

66
source "https://rubygems.org"
77

@@ -16,9 +16,9 @@
1616
end
1717

1818
group :test do
19+
gem "sus", "~> 0.16.0"
1920
gem "bake-test"
2021
gem "bake-test-external"
2122

22-
gem 'async-io'
23-
gem 'async-rspec'
23+
gem "covered"
2424
end

guides/getting-started/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,14 @@ reference.to_s
5959

6060
### URL
6161

62-
{ruby Protocol::HTTP::URL} is used to parse incoming URLs to extract the query string and other relevant details.
62+
{ruby Protocol::HTTP::URL} is used to parse incoming URLs to extract the query and other relevant details.
6363

6464
``` ruby
6565
require 'protocol/http/url'
6666

6767
reference = Protocol::HTTP::Reference.parse("/search?q=kittens")
6868

69-
parameters = Protocol::HTTP::URL.decode(reference.query_string)
69+
parameters = Protocol::HTTP::URL.decode(reference.query)
7070
# => {"q"=>"kittens"}
7171
```
7272

lib/protocol/http/accept_encoding.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ class AcceptEncoding < Middleware
1717

1818
DEFAULT_WRAPPERS = {
1919
'gzip' => Body::Inflate.method(:for),
20-
'identity' => ->(body){body},
20+
21+
# There is no point including this:
22+
# 'identity' => ->(body){body},
2123
}
2224

2325
def initialize(app, wrappers = DEFAULT_WRAPPERS)

lib/protocol/http/body/deflate.rb

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,6 @@ class ZStream < Wrapper
2121
'gzip' => GZIP,
2222
}
2323

24-
def self.encoding_name(window_size)
25-
if window_size <= -8
26-
return 'deflate'
27-
elsif window_size >= 16
28-
return 'gzip'
29-
else
30-
return 'compress'
31-
end
32-
end
33-
3424
def initialize(body, stream)
3525
super(body)
3626

0 commit comments

Comments
 (0)