From 8be78745af1dc723fa93f2b9bcd280f3a01ba832 Mon Sep 17 00:00:00 2001 From: Beni Cherniavsky-Paskin Date: Sat, 15 Dec 2018 23:23:11 +0200 Subject: [PATCH] Add tests for non-suffix y->ies plurals #376 --- test/test_missing_methods.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/test_missing_methods.rb b/test/test_missing_methods.rb index a52181a4..67614c95 100644 --- a/test/test_missing_methods.rb +++ b/test/test_missing_methods.rb @@ -41,6 +41,18 @@ def test_missing end end + def test_nonsuffix_plurals + stub_request(:get, %r{/apis/extensions/v1beta1$}).to_return( + body: open_test_file('extensions_v1beta1_api_resource_list.json'), + status: 200 + ) + client = Kubeclient::Client.new('http://localhost:8080/apis/extensions', 'v1beta1') + assert_equal(true, client.respond_to?(:get_network_policy)) + assert_equal(true, client.respond_to?(:get_network_policies)) + assert_equal(true, client.respond_to?(:get_pod_security_policy)) + assert_equal(true, client.respond_to?(:get_pod_security_policies)) + end + def test_irregular_names stub_core_api_list client = Kubeclient::Client.new('http://localhost:8080/api/', 'v1')