Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "1.34.0"
".": "1.34.1"
}
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 1.34.1 (2026-03-19)

Full Changelog: [v1.34.0...v1.34.1](https://github.com/knocklabs/knock-ruby/compare/v1.34.0...v1.34.1)

### Refactors

* **tests:** switch from prism to steady ([825cb06](https://github.com/knocklabs/knock-ruby/commit/825cb069ecda68a5dd702589424e75b1840534b2))

## 1.34.0 (2026-03-16)

Full Changelog: [v1.33.0...v1.34.0](https://github.com/knocklabs/knock-ruby/compare/v1.33.0...v1.34.0)
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ $ bundle exec rake

## Running tests

Most tests require you to [set up a mock server](https://github.com/stoplightio/prism) against the OpenAPI spec to run the tests.
Most tests require you to [set up a mock server](https://github.com/dgellow/steady) against the OpenAPI spec to run the tests.

```sh
$ ./scripts/mock
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ GIT
PATH
remote: .
specs:
knockapi (1.34.0)
knockapi (1.34.1)
cgi
connection_pool

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ To use this gem, install via Bundler by adding the following to your application
<!-- x-release-please-start-version -->

```ruby
gem "knockapi", "~> 1.34.0"
gem "knockapi", "~> 1.34.1"
```

<!-- x-release-please-end -->
Expand Down
2 changes: 1 addition & 1 deletion lib/knockapi/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module Knockapi
VERSION = "1.34.0"
VERSION = "1.34.1"
end
26 changes: 13 additions & 13 deletions scripts/mock
Original file line number Diff line number Diff line change
Expand Up @@ -19,34 +19,34 @@ fi

echo "==> Starting mock server with URL ${URL}"

# Run prism mock on the given spec
# Run steady mock on the given spec
if [ "$1" == "--daemon" ]; then
# Pre-install the package so the download doesn't eat into the startup timeout
npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism --version
npm exec --package=@stdy/cli@0.19.3 -- steady --version

npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL" &> .prism.log &
npm exec --package=@stdy/cli@0.19.3 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-query-object-format=brackets "$URL" &> .stdy.log &

# Wait for server to come online (max 30s)
# Wait for server to come online via health endpoint (max 30s)
echo -n "Waiting for server"
attempts=0
while ! grep -q "✖ fatal\|Prism is listening" ".prism.log" ; do
while ! curl --silent --fail "http://127.0.0.1:4010/_x-steady/health" >/dev/null 2>&1; do
if ! kill -0 $! 2>/dev/null; then
echo
cat .stdy.log
exit 1
fi
attempts=$((attempts + 1))
if [ "$attempts" -ge 300 ]; then
echo
echo "Timed out waiting for Prism server to start"
cat .prism.log
echo "Timed out waiting for Steady server to start"
cat .stdy.log
exit 1
fi
echo -n "."
sleep 0.1
done

if grep -q "✖ fatal" ".prism.log"; then
cat .prism.log
exit 1
fi

echo
else
npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL"
npm exec --package=@stdy/cli@0.19.3 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-query-object-format=brackets "$URL"
fi
16 changes: 8 additions & 8 deletions scripts/test
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ GREEN='\033[0;32m'
YELLOW='\033[0;33m'
NC='\033[0m' # No Color

function prism_is_running() {
curl --silent "http://localhost:4010" >/dev/null 2>&1
function steady_is_running() {
curl --silent "http://127.0.0.1:4010/_x-steady/health" >/dev/null 2>&1
}

kill_server_on_port() {
Expand All @@ -25,7 +25,7 @@ function is_overriding_api_base_url() {
[ -n "$TEST_API_BASE_URL" ]
}

if ! is_overriding_api_base_url && ! prism_is_running ; then
if ! is_overriding_api_base_url && ! steady_is_running ; then
# When we exit this script, make sure to kill the background mock server process
trap 'kill_server_on_port 4010' EXIT

Expand All @@ -36,19 +36,19 @@ fi
if is_overriding_api_base_url ; then
echo -e "${GREEN}✔ Running tests against ${TEST_API_BASE_URL}${NC}"
echo
elif ! prism_is_running ; then
echo -e "${RED}ERROR:${NC} The test suite will not run without a mock Prism server"
elif ! steady_is_running ; then
echo -e "${RED}ERROR:${NC} The test suite will not run without a mock Steady server"
echo -e "running against your OpenAPI spec."
echo
echo -e "To run the server, pass in the path or url of your OpenAPI"
echo -e "spec to the prism command:"
echo -e "spec to the steady command:"
echo
echo -e " \$ ${YELLOW}npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock path/to/your.openapi.yml${NC}"
echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.19.3 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-query-object-format=brackets${NC}"
echo

exit 1
else
echo -e "${GREEN}✔ Mock prism server is running with your OpenAPI spec${NC}"
echo -e "${GREEN}✔ Mock steady server is running with your OpenAPI spec${NC}"
echo
fi

Expand Down
6 changes: 0 additions & 6 deletions test/knockapi/resources/audiences_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

class Knockapi::Test::Resources::AudiencesTest < Knockapi::Test::ResourceTest
def test_add_members_required_params
skip("Mock server doesn't support callbacks yet")

response = @knock.audiences.add_members("key", members: [{user: {id: "dr_sattler"}}])

assert_pattern do
Expand All @@ -14,8 +12,6 @@ def test_add_members_required_params
end

def test_list_members
skip("Mock server doesn't support callbacks yet")

response = @knock.audiences.list_members("key")

assert_pattern do
Expand All @@ -31,8 +27,6 @@ def test_list_members
end

def test_remove_members_required_params
skip("Mock server doesn't support callbacks yet")

response = @knock.audiences.remove_members("key", members: [{user: {id: "dr_sattler"}}])

assert_pattern do
Expand Down
2 changes: 0 additions & 2 deletions test/knockapi/resources/bulk_operations_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

class Knockapi::Test::Resources::BulkOperationsTest < Knockapi::Test::ResourceTest
def test_get
skip("Mock server doesn't support callbacks yet")

response = @knock.bulk_operations.get("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")

assert_pattern do
Expand Down
2 changes: 0 additions & 2 deletions test/knockapi/resources/channels/bulk_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

class Knockapi::Test::Resources::Channels::BulkTest < Knockapi::Test::ResourceTest
def test_update_message_status
skip("Mock server doesn't support callbacks yet")

response = @knock.channels.bulk.update_message_status("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", :seen)

assert_pattern do
Expand Down
2 changes: 0 additions & 2 deletions test/knockapi/resources/integrations/census_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

class Knockapi::Test::Resources::Integrations::CensusTest < Knockapi::Test::ResourceTest
def test_custom_destination_required_params
skip("Mock server doesn't support callbacks yet")

response = @knock.integrations.census.custom_destination(id: "id", jsonrpc: "jsonrpc", method_: "method")

assert_pattern do
Expand Down
2 changes: 0 additions & 2 deletions test/knockapi/resources/integrations/hightouch_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

class Knockapi::Test::Resources::Integrations::HightouchTest < Knockapi::Test::ResourceTest
def test_embedded_destination_required_params
skip("Mock server doesn't support callbacks yet")

response =
@knock.integrations.hightouch.embedded_destination(id: "id", jsonrpc: "jsonrpc", method_: "method")

Expand Down
16 changes: 0 additions & 16 deletions test/knockapi/resources/messages/batch_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

class Knockapi::Test::Resources::Messages::BatchTest < Knockapi::Test::ResourceTest
def test_archive_required_params
skip("Mock server doesn't support callbacks yet")

response =
@knock.messages.batch.archive(
message_ids: %w[
Expand All @@ -20,8 +18,6 @@ def test_archive_required_params
end

def test_get_content_required_params
skip("Mock server doesn't support callbacks yet")

response = @knock.messages.batch.get_content(message_ids: ["string"])

assert_pattern do
Expand All @@ -30,8 +26,6 @@ def test_get_content_required_params
end

def test_mark_as_interacted_required_params
skip("Mock server doesn't support callbacks yet")

response = @knock.messages.batch.mark_as_interacted(message_ids: ["1jNaXzB2RZX3LY8wVQnfCKyPnv7"])

assert_pattern do
Expand All @@ -40,8 +34,6 @@ def test_mark_as_interacted_required_params
end

def test_mark_as_read_required_params
skip("Mock server doesn't support callbacks yet")

response =
@knock.messages.batch.mark_as_read(
message_ids: %w[2w3YUpTTOxuDvZFji8OMsKrG176 2w3YVRbPXMIh8Zq6oBFcVDA5xes]
Expand All @@ -53,8 +45,6 @@ def test_mark_as_read_required_params
end

def test_mark_as_seen_required_params
skip("Mock server doesn't support callbacks yet")

response =
@knock.messages.batch.mark_as_seen(
message_ids: %w[2w3YUpTTOxuDvZFji8OMsKrG176 2w3YVRbPXMIh8Zq6oBFcVDA5xes]
Expand All @@ -66,8 +56,6 @@ def test_mark_as_seen_required_params
end

def test_mark_as_unread_required_params
skip("Mock server doesn't support callbacks yet")

response =
@knock.messages.batch.mark_as_unread(
message_ids: %w[2w3YUpTTOxuDvZFji8OMsKrG176 2w3YVRbPXMIh8Zq6oBFcVDA5xes]
Expand All @@ -79,8 +67,6 @@ def test_mark_as_unread_required_params
end

def test_mark_as_unseen_required_params
skip("Mock server doesn't support callbacks yet")

response =
@knock.messages.batch.mark_as_unseen(
message_ids: %w[2w3YUpTTOxuDvZFji8OMsKrG176 2w3YVRbPXMIh8Zq6oBFcVDA5xes]
Expand All @@ -92,8 +78,6 @@ def test_mark_as_unseen_required_params
end

def test_unarchive_required_params
skip("Mock server doesn't support callbacks yet")

response =
@knock.messages.batch.unarchive(
message_ids: %w[2w3YUpTTOxuDvZFji8OMsKrG176 2w3YVRbPXMIh8Zq6oBFcVDA5xes]
Expand Down
26 changes: 0 additions & 26 deletions test/knockapi/resources/messages_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

class Knockapi::Test::Resources::MessagesTest < Knockapi::Test::ResourceTest
def test_list
skip("Mock server doesn't support callbacks yet")

response = @knock.messages.list

assert_pattern do
Expand Down Expand Up @@ -48,8 +46,6 @@ def test_list
end

def test_archive
skip("Mock server doesn't support callbacks yet")

response = @knock.messages.archive("1jNaXzB2RZX3LY8wVQnfCKyPnv7")

assert_pattern do
Expand Down Expand Up @@ -85,8 +81,6 @@ def test_archive
end

def test_get
skip("Mock server doesn't support callbacks yet")

response = @knock.messages.get("1jNaXzB2RZX3LY8wVQnfCKyPnv7")

assert_pattern do
Expand Down Expand Up @@ -122,8 +116,6 @@ def test_get
end

def test_get_content
skip("Mock server doesn't support callbacks yet")

response = @knock.messages.get_content("message_id")

assert_pattern do
Expand All @@ -141,8 +133,6 @@ def test_get_content
end

def test_list_activities
skip("Mock server doesn't support callbacks yet")

response = @knock.messages.list_activities("message_id")

assert_pattern do
Expand Down Expand Up @@ -170,8 +160,6 @@ def test_list_activities
end

def test_list_delivery_logs
skip("Mock server doesn't support callbacks yet")

response = @knock.messages.list_delivery_logs("message_id")

assert_pattern do
Expand Down Expand Up @@ -199,8 +187,6 @@ def test_list_delivery_logs
end

def test_list_events
skip("Mock server doesn't support callbacks yet")

response = @knock.messages.list_events("message_id")

assert_pattern do
Expand All @@ -227,8 +213,6 @@ def test_list_events
end

def test_mark_as_interacted
skip("Mock server doesn't support callbacks yet")

response = @knock.messages.mark_as_interacted("1jNaXzB2RZX3LY8wVQnfCKyPnv7")

assert_pattern do
Expand Down Expand Up @@ -264,8 +248,6 @@ def test_mark_as_interacted
end

def test_mark_as_read
skip("Mock server doesn't support callbacks yet")

response = @knock.messages.mark_as_read("1jNaXzB2RZX3LY8wVQnfCKyPnv7")

assert_pattern do
Expand Down Expand Up @@ -301,8 +283,6 @@ def test_mark_as_read
end

def test_mark_as_seen
skip("Mock server doesn't support callbacks yet")

response = @knock.messages.mark_as_seen("1jNaXzB2RZX3LY8wVQnfCKyPnv7")

assert_pattern do
Expand Down Expand Up @@ -338,8 +318,6 @@ def test_mark_as_seen
end

def test_mark_as_unread
skip("Mock server doesn't support callbacks yet")

response = @knock.messages.mark_as_unread("1jNaXzB2RZX3LY8wVQnfCKyPnv7")

assert_pattern do
Expand Down Expand Up @@ -375,8 +353,6 @@ def test_mark_as_unread
end

def test_mark_as_unseen
skip("Mock server doesn't support callbacks yet")

response = @knock.messages.mark_as_unseen("1jNaXzB2RZX3LY8wVQnfCKyPnv7")

assert_pattern do
Expand Down Expand Up @@ -412,8 +388,6 @@ def test_mark_as_unseen
end

def test_unarchive
skip("Mock server doesn't support callbacks yet")

response = @knock.messages.unarchive("1jNaXzB2RZX3LY8wVQnfCKyPnv7")

assert_pattern do
Expand Down
Loading
Loading