Skip to content

Commit

Permalink
Remove access to full parts and params
Browse files Browse the repository at this point in the history
This could probably have been fully deleted, since it's only used in
test. This allows us to remove unnecessary and expensive data from the
spec files.
  • Loading branch information
jhawthorn committed Dec 12, 2023
1 parent f7ae78f commit 1ea75fb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions lib/elastomer_client/client/rest_api_spec/rest_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,17 @@ def body?
class Url
attr_reader :path
attr_reader :paths
attr_reader :parts
attr_reader :params
attr_reader :parts_keys
attr_reader :params_keys

def initialize(path:, paths: [], parts: {}, params: {})
@path = path
@paths = Array(paths)
@parts = parts
@params = params
@parts_keys = parts.keys
@params_keys = params.keys

@parts_set = Set.new(@parts.keys)
@params_set = Set.new(@params.keys)
@parts_set = Set.new(@parts_keys)
@params_set = Set.new(@params_keys)
end

def select_parts(from:)
Expand Down
4 changes: 2 additions & 2 deletions test/client/rest_api_spec/rest_api_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@
end

it "accesses the path parts" do
assert_equal %w[index metric], @rest_api.url.parts.keys
assert_equal %w[index metric], @rest_api.url.parts_keys
end

it "accesses the request params" do
assert_equal %w[local master_timeout flat_settings ignore_unavailable allow_no_indices expand_wildcards], @rest_api.url.params.keys
assert_equal %w[local master_timeout flat_settings ignore_unavailable allow_no_indices expand_wildcards], @rest_api.url.params_keys
end
end
end

0 comments on commit 1ea75fb

Please sign in to comment.