Skip to content

Commit

Permalink
feat(internal): modified tests for thread and fiber safety (#250)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-ci-bot committed Feb 28, 2025
1 parent 4b26881 commit dfae756
Show file tree
Hide file tree
Showing 48 changed files with 132 additions and 421 deletions.
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@ source "https://rubygems.org"
gemspec

group :development do
gem "async"
gem "minitest"
gem "minitest-focus"
gem "minitest-hooks"
gem "minitest-proveit"
gem "minitest-rg"
gem "rake"
gem "rbs"
gem "rubocop"
Expand Down
44 changes: 34 additions & 10 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -30,30 +30,50 @@ GEM
securerandom (>= 0.3)
tzinfo (~> 2.0, >= 2.0.5)
ast (2.4.2)
async (2.23.0)
console (~> 1.29)
fiber-annotation
io-event (~> 1.9)
metrics (~> 0.12)
traces (~> 0.15)
base64 (0.2.0)
benchmark (0.4.0)
bigdecimal (3.1.9)
concurrent-ruby (1.3.5)
connection_pool (2.5.0)
console (1.29.3)
fiber-annotation
fiber-local (~> 1.1)
json
csv (3.3.2)
drb (2.2.1)
erubi (1.13.1)
ffi (1.17.1)
fiber-annotation (0.2.0)
fiber-local (1.1.0)
fiber-storage
fiber-storage (1.0.0)
fileutils (1.7.3)
i18n (1.14.7)
concurrent-ruby (~> 1.0)
io-event (1.9.0)
json (2.10.1)
language_server-protocol (3.17.0.4)
lint_roller (1.1.0)
listen (3.9.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
logger (1.6.6)
metrics (0.12.1)
minitest (5.25.4)
minitest-focus (1.4.0)
minitest (>= 4, < 6)
minitest-hooks (1.5.2)
minitest (> 5.3)
minitest-proveit (1.0.0)
minitest (> 5, < 7)
minitest-rg (5.3.0)
minitest (~> 5.0)
netrc (0.11.0)
parallel (1.26.3)
parser (3.3.7.1)
Expand Down Expand Up @@ -84,18 +104,18 @@ GEM
rubocop-ast (>= 1.38.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 4.0)
rubocop-ast (1.38.0)
rubocop-ast (1.38.1)
parser (>= 3.3.1.0)
ruby-progressbar (1.13.0)
securerandom (0.4.1)
sorbet (0.5.11834)
sorbet-static (= 0.5.11834)
sorbet-runtime (0.5.11834)
sorbet-static (0.5.11834-x86_64-linux)
sorbet-static-and-runtime (0.5.11834)
sorbet (= 0.5.11834)
sorbet-runtime (= 0.5.11834)
spoom (1.5.3)
sorbet (0.5.11856)
sorbet-static (= 0.5.11856)
sorbet-runtime (0.5.11856)
sorbet-static (0.5.11856-x86_64-linux)
sorbet-static-and-runtime (0.5.11856)
sorbet (= 0.5.11856)
sorbet-runtime (= 0.5.11856)
spoom (1.5.4)
erubi (>= 1.10.0)
prism (>= 0.28.0)
rbi (>= 0.2.3)
Expand All @@ -120,7 +140,7 @@ GEM
strscan (3.1.2)
syntax_tree (6.2.0)
prettier_print (>= 1.2.0)
tapioca (0.16.10)
tapioca (0.16.11)
benchmark
bundler (>= 2.2.25)
netrc (>= 0.11.0)
Expand All @@ -133,6 +153,7 @@ GEM
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
thor (1.3.2)
traces (0.15.2)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (2.6.0)
Expand All @@ -147,9 +168,12 @@ PLATFORMS
x86_64-linux

DEPENDENCIES
async
minitest
minitest-focus
minitest-hooks
minitest-proveit
minitest-rg
modern_treasury!
rake
rbs
Expand Down
File renamed without changes.
10 changes: 1 addition & 9 deletions test/modern_treasury/resources/account_collection_flows_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,7 @@

require_relative "../test_helper"

class ModernTreasury::Test::Resources::AccountCollectionFlowsTest < Minitest::Test
def before_all
@modern_treasury = ModernTreasury::Client.new(
base_url: ENV.fetch("TEST_API_BASE_URL", "http://localhost:4010"),
api_key: "My API Key",
organization_id: "my-organization-ID"
)
end

class ModernTreasury::Test::Resources::AccountCollectionFlowsTest < ModernTreasury::Test::ResourceTest
def test_create_required_params
response = @modern_treasury.account_collection_flows.create(
counterparty_id: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
Expand Down
10 changes: 1 addition & 9 deletions test/modern_treasury/resources/account_details_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,7 @@

require_relative "../test_helper"

class ModernTreasury::Test::Resources::AccountDetailsTest < Minitest::Test
def before_all
@modern_treasury = ModernTreasury::Client.new(
base_url: ENV.fetch("TEST_API_BASE_URL", "http://localhost:4010"),
api_key: "My API Key",
organization_id: "my-organization-ID"
)
end

class ModernTreasury::Test::Resources::AccountDetailsTest < ModernTreasury::Test::ResourceTest
def test_create_required_params
response = @modern_treasury.account_details.create(
"account_id",
Expand Down
10 changes: 1 addition & 9 deletions test/modern_treasury/resources/bulk_requests_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,7 @@

require_relative "../test_helper"

class ModernTreasury::Test::Resources::BulkRequestsTest < Minitest::Test
def before_all
@modern_treasury = ModernTreasury::Client.new(
base_url: ENV.fetch("TEST_API_BASE_URL", "http://localhost:4010"),
api_key: "My API Key",
organization_id: "my-organization-ID"
)
end

class ModernTreasury::Test::Resources::BulkRequestsTest < ModernTreasury::Test::ResourceTest
def test_create_required_params
skip("Multipart documents aren't constructed properly yet")

Expand Down
10 changes: 1 addition & 9 deletions test/modern_treasury/resources/bulk_results_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,7 @@

require_relative "../test_helper"

class ModernTreasury::Test::Resources::BulkResultsTest < Minitest::Test
def before_all
@modern_treasury = ModernTreasury::Client.new(
base_url: ENV.fetch("TEST_API_BASE_URL", "http://localhost:4010"),
api_key: "My API Key",
organization_id: "my-organization-ID"
)
end

class ModernTreasury::Test::Resources::BulkResultsTest < ModernTreasury::Test::ResourceTest
def test_retrieve
response = @modern_treasury.bulk_results.retrieve("id")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,7 @@

require_relative "../test_helper"

class ModernTreasury::Test::Resources::ConnectionLegalEntitiesTest < Minitest::Test
def before_all
@modern_treasury = ModernTreasury::Client.new(
base_url: ENV.fetch("TEST_API_BASE_URL", "http://localhost:4010"),
api_key: "My API Key",
organization_id: "my-organization-ID"
)
end

class ModernTreasury::Test::Resources::ConnectionLegalEntitiesTest < ModernTreasury::Test::ResourceTest
def test_create_required_params
response = @modern_treasury.connection_legal_entities.create(connection_id: "connection_id")

Expand Down
10 changes: 1 addition & 9 deletions test/modern_treasury/resources/connections_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,7 @@

require_relative "../test_helper"

class ModernTreasury::Test::Resources::ConnectionsTest < Minitest::Test
def before_all
@modern_treasury = ModernTreasury::Client.new(
base_url: ENV.fetch("TEST_API_BASE_URL", "http://localhost:4010"),
api_key: "My API Key",
organization_id: "my-organization-ID"
)
end

class ModernTreasury::Test::Resources::ConnectionsTest < ModernTreasury::Test::ResourceTest
def test_list
response = @modern_treasury.connections.list

Expand Down
10 changes: 1 addition & 9 deletions test/modern_treasury/resources/counterparties_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,7 @@

require_relative "../test_helper"

class ModernTreasury::Test::Resources::CounterpartiesTest < Minitest::Test
def before_all
@modern_treasury = ModernTreasury::Client.new(
base_url: ENV.fetch("TEST_API_BASE_URL", "http://localhost:4010"),
api_key: "My API Key",
organization_id: "my-organization-ID"
)
end

class ModernTreasury::Test::Resources::CounterpartiesTest < ModernTreasury::Test::ResourceTest
def test_create_required_params
response = @modern_treasury.counterparties.create(name: "name")

Expand Down
10 changes: 1 addition & 9 deletions test/modern_treasury/resources/documents_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,7 @@

require_relative "../test_helper"

class ModernTreasury::Test::Resources::DocumentsTest < Minitest::Test
def before_all
@modern_treasury = ModernTreasury::Client.new(
base_url: ENV.fetch("TEST_API_BASE_URL", "http://localhost:4010"),
api_key: "My API Key",
organization_id: "my-organization-ID"
)
end

class ModernTreasury::Test::Resources::DocumentsTest < ModernTreasury::Test::ResourceTest
def test_create_required_params
skip("multipart/form-data not yet supported")

Expand Down
10 changes: 1 addition & 9 deletions test/modern_treasury/resources/events_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,7 @@

require_relative "../test_helper"

class ModernTreasury::Test::Resources::EventsTest < Minitest::Test
def before_all
@modern_treasury = ModernTreasury::Client.new(
base_url: ENV.fetch("TEST_API_BASE_URL", "http://localhost:4010"),
api_key: "My API Key",
organization_id: "my-organization-ID"
)
end

class ModernTreasury::Test::Resources::EventsTest < ModernTreasury::Test::ResourceTest
def test_retrieve
response = @modern_treasury.events.retrieve("id")

Expand Down
10 changes: 1 addition & 9 deletions test/modern_treasury/resources/expected_payments_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,7 @@

require_relative "../test_helper"

class ModernTreasury::Test::Resources::ExpectedPaymentsTest < Minitest::Test
def before_all
@modern_treasury = ModernTreasury::Client.new(
base_url: ENV.fetch("TEST_API_BASE_URL", "http://localhost:4010"),
api_key: "My API Key",
organization_id: "my-organization-ID"
)
end

class ModernTreasury::Test::Resources::ExpectedPaymentsTest < ModernTreasury::Test::ResourceTest
def test_create
response = @modern_treasury.expected_payments.create

Expand Down
10 changes: 1 addition & 9 deletions test/modern_treasury/resources/external_accounts_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,7 @@

require_relative "../test_helper"

class ModernTreasury::Test::Resources::ExternalAccountsTest < Minitest::Test
def before_all
@modern_treasury = ModernTreasury::Client.new(
base_url: ENV.fetch("TEST_API_BASE_URL", "http://localhost:4010"),
api_key: "My API Key",
organization_id: "my-organization-ID"
)
end

class ModernTreasury::Test::Resources::ExternalAccountsTest < ModernTreasury::Test::ResourceTest
def test_create_required_params
response = @modern_treasury.external_accounts.create(counterparty_id: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")

Expand Down
10 changes: 1 addition & 9 deletions test/modern_treasury/resources/foreign_exchange_quotes_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,7 @@

require_relative "../test_helper"

class ModernTreasury::Test::Resources::ForeignExchangeQuotesTest < Minitest::Test
def before_all
@modern_treasury = ModernTreasury::Client.new(
base_url: ENV.fetch("TEST_API_BASE_URL", "http://localhost:4010"),
api_key: "My API Key",
organization_id: "my-organization-ID"
)
end

class ModernTreasury::Test::Resources::ForeignExchangeQuotesTest < ModernTreasury::Test::ResourceTest
def test_create_required_params
response = @modern_treasury.foreign_exchange_quotes.create(
internal_account_id: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
Expand Down
10 changes: 1 addition & 9 deletions test/modern_treasury/resources/incoming_payment_details_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,7 @@

require_relative "../test_helper"

class ModernTreasury::Test::Resources::IncomingPaymentDetailsTest < Minitest::Test
def before_all
@modern_treasury = ModernTreasury::Client.new(
base_url: ENV.fetch("TEST_API_BASE_URL", "http://localhost:4010"),
api_key: "My API Key",
organization_id: "my-organization-ID"
)
end

class ModernTreasury::Test::Resources::IncomingPaymentDetailsTest < ModernTreasury::Test::ResourceTest
def test_retrieve
response = @modern_treasury.incoming_payment_details.retrieve("id")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,7 @@

require_relative "../../test_helper"

class ModernTreasury::Test::Resources::InternalAccounts::BalanceReportsTest < Minitest::Test
def before_all
@modern_treasury = ModernTreasury::Client.new(
base_url: ENV.fetch("TEST_API_BASE_URL", "http://localhost:4010"),
api_key: "My API Key",
organization_id: "my-organization-ID"
)
end

class ModernTreasury::Test::Resources::InternalAccounts::BalanceReportsTest < ModernTreasury::Test::ResourceTest
def test_create_required_params
response = @modern_treasury.internal_accounts.balance_reports.create(
"internal_account_id",
Expand Down
10 changes: 1 addition & 9 deletions test/modern_treasury/resources/internal_accounts_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,7 @@

require_relative "../test_helper"

class ModernTreasury::Test::Resources::InternalAccountsTest < Minitest::Test
def before_all
@modern_treasury = ModernTreasury::Client.new(
base_url: ENV.fetch("TEST_API_BASE_URL", "http://localhost:4010"),
api_key: "My API Key",
organization_id: "my-organization-ID"
)
end

class ModernTreasury::Test::Resources::InternalAccountsTest < ModernTreasury::Test::ResourceTest
def test_create_required_params
response = @modern_treasury.internal_accounts.create(
connection_id: "connection_id",
Expand Down
10 changes: 1 addition & 9 deletions test/modern_treasury/resources/invoices/line_items_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,7 @@

require_relative "../../test_helper"

class ModernTreasury::Test::Resources::Invoices::LineItemsTest < Minitest::Test
def before_all
@modern_treasury = ModernTreasury::Client.new(
base_url: ENV.fetch("TEST_API_BASE_URL", "http://localhost:4010"),
api_key: "My API Key",
organization_id: "my-organization-ID"
)
end

class ModernTreasury::Test::Resources::Invoices::LineItemsTest < ModernTreasury::Test::ResourceTest
def test_create_required_params
response = @modern_treasury.invoices.line_items.create("invoice_id", name: "name", unit_amount: 0)

Expand Down
Loading

0 comments on commit dfae756

Please sign in to comment.