Skip to content

Commit 99760f9

Browse files
committed
Remove access to full parts and params
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.
1 parent 7a8e81d commit 99760f9

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

lib/elastomer_client/client/rest_api_spec/rest_api.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,17 @@ def body?
2828
class Url
2929
attr_reader :path
3030
attr_reader :paths
31-
attr_reader :parts
32-
attr_reader :params
31+
attr_reader :parts_keys
32+
attr_reader :params_keys
3333

3434
def initialize(path:, paths: [], parts: {}, params: {})
3535
@path = path
3636
@paths = Array(paths)
37-
@parts = parts
38-
@params = params
37+
@parts_keys = parts.keys
38+
@params_keys = params.keys
3939

40-
@parts_set = Set.new(@parts.keys)
41-
@params_set = Set.new(@params.keys)
40+
@parts_set = Set.new(@parts_keys)
41+
@params_set = Set.new(@params_keys)
4242
end
4343

4444
def select_parts(from:)

test/client/rest_api_spec/rest_api_test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,11 @@
8888
end
8989

9090
it "accesses the path parts" do
91-
assert_equal %w[index metric], @rest_api.url.parts.keys
91+
assert_equal %w[index metric], @rest_api.url.parts_keys
9292
end
9393

9494
it "accesses the request params" do
95-
assert_equal %w[local master_timeout flat_settings ignore_unavailable allow_no_indices expand_wildcards], @rest_api.url.params.keys
95+
assert_equal %w[local master_timeout flat_settings ignore_unavailable allow_no_indices expand_wildcards], @rest_api.url.params_keys
9696
end
9797
end
9898
end

0 commit comments

Comments
 (0)