Skip to content

Commit

Permalink
Add tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
ioquatix committed May 10, 2024
1 parent bd0d779 commit f18ff22
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/falcon/command/virtual.rb
Expand Up @@ -3,6 +3,8 @@
# Released under the MIT License.
# Copyright, 2018-2024, by Samuel Williams.

require 'async/service'

require_relative '../environment/virtual'

require 'samovar'
Expand Down
15 changes: 15 additions & 0 deletions test/falcon/command/virtual.rb
Expand Up @@ -42,6 +42,21 @@ def around

let(:insecure_client) {Async::HTTP::Client.new(command.insecure_endpoint, retries: 0)}

with 'no paths' do
let (:paths) {[]}

it "should still start correctly" do
request = Protocol::HTTP::Request.new("https", "hello.localhost", "GET", "/index")

Async do
response = insecure_client.get("/index")

expect(response).to be(:failure?)
pp response
end
end
end

it "gets redirected from insecure to secure endpoint" do
request = Protocol::HTTP::Request.new("http", "hello.localhost", "GET", "/index")

Expand Down

0 comments on commit f18ff22

Please sign in to comment.