Skip to content
This repository has been archived by the owner on Nov 8, 2024. It is now read-only.

Add test for configurable port #17

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions features/configurable_port.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
Feature: Configurable port

Background:
Given I have "dredd-hooks-php" command installed

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/php/{{mylanguage}}/

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 updated.

And I have "dredd" command installed
And a file named "server.rb" with:
"""
require 'sinatra'
get '/message' do
"Hello World!\n\n"
end
"""

And a file named "apiary.apib" with:
"""
# My Api
## GET /message
+ Response 200 (text/html;charset=utf-8)
Hello World!
"""

@announce
Scenario:
Given a file named "hookfile/.{{myextension}}" with:
"""
## So, replace following pseudo code with yours:
#
#require 'mylanguagehooks'
#
#key = 'hooks_modifications'
#
#before("/message > GET") { |transaction|
# puts 'listening on different port'
#}
"""

When I run `dredd ./apiary.apib http://localhost:4567 --hooks-worker-handler-port 61325 --server "ruby server.rb" --language "dredd-hooks-{{mylanguage}}" --hookfiles ./hookfile.{{myextension}}`
Then the exit status should be 0
Then the output should contain:
"""
listening on different port
"""