Skip to content

Commit a381551

Browse files
committed
test: corrected Endpoint spec to ensure Polymarket::Client is used
1 parent 5303a22 commit a381551

File tree

3 files changed

+3
-12
lines changed

3 files changed

+3
-12
lines changed

lib/domeapi/polymarket/endpoint.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class Endpoint
1313
#
1414
# @return [void]
1515
def initialize(client = nil)
16-
@client = client || ::Rubyists::Domeapi::Client.new
16+
@client = client || Client.new
1717
end
1818
end
1919
end

lib/domeapi/polymarket/markets.rb

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,11 @@ module Rubyists
44
module Domeapi
55
module Polymarket
66
# Markets API endpoints
7-
class Markets
7+
class Markets < Endpoint
88
include Listable
99

1010
polymarket_path 'markets'
1111

12-
attr_reader :client
13-
1412
# Filter for Polymarket markets,
1513
# from https://docs.domeapi.io/api-reference/endpoint/get-markets
1614
class Filter < Contract
@@ -26,13 +24,6 @@ class Filter < Contract
2624
end
2725
end
2826

29-
# @param client [Rubyists::Domeapi::Polymarket::Client]
30-
#
31-
# @return [void]
32-
def initialize(client = Rubyists::Domeapi::Polymarket::Client.new)
33-
@client = client
34-
end
35-
3627
# Fetch current or historical price for a market
3728
#
3829
# @param token_id [String]

test/domeapi/polymarket/endpoint_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
it 'initializes with default client' do
77
endpoint = Rubyists::Domeapi::Polymarket::Endpoint.new
88

9-
_(endpoint.client).must_be_instance_of Rubyists::Domeapi::Client
9+
_(endpoint.client).must_be_instance_of Rubyists::Domeapi::Polymarket::Client
1010
end
1111

1212
it 'initializes with provided client' do

0 commit comments

Comments
 (0)