test_kaferi_cloud 2.0.2 → 2.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (187) hide show
  1. checksums.yaml +4 -4
  2. data/{D://tmp//2018-02027//Ruby//.gitignore → .gitignore} +0 -0
  3. data/{D://tmp//2018-02027//Ruby//.swagger-codegen-ignore → .swagger-codegen-ignore} +0 -0
  4. data/{D://tmp//2018-02027//Ruby//.swagger-codegen/ → .swagger-codegen}/VERSION +0 -0
  5. data/{D://tmp//2018-02027//Ruby//LICENSE → LICENSE} +0 -0
  6. data/{D://tmp//2018-02027//Ruby//README.md → README.md} +0 -0
  7. data/{D://tmp//2018-02027//Ruby//lib/ → lib}/test_kaferi_cloud.rb +0 -0
  8. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//api/ → lib/test_kaferi_cloud/api}/pdf_api.rb +0 -0
  9. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud/ → lib/test_kaferi_cloud}/api_client.rb +0 -0
  10. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud/ → lib/test_kaferi_cloud}/api_error.rb +0 -0
  11. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud/ → lib/test_kaferi_cloud}/configuration.rb +0 -0
  12. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models/ → lib/test_kaferi_cloud/models}/annotation.rb +0 -0
  13. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models/ → lib/test_kaferi_cloud/models}/annotation_response.rb +0 -0
  14. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models/ → lib/test_kaferi_cloud/models}/annotations.rb +0 -0
  15. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models/ → lib/test_kaferi_cloud/models}/annotations_response.rb +0 -0
  16. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models/ → lib/test_kaferi_cloud/models}/append_document.rb +0 -0
  17. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models/ → lib/test_kaferi_cloud/models}/attachment.rb +0 -0
  18. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models/ → lib/test_kaferi_cloud/models}/attachment_response.rb +0 -0
  19. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models/ → lib/test_kaferi_cloud/models}/attachments.rb +0 -0
  20. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models/ → lib/test_kaferi_cloud/models}/attachments_response.rb +0 -0
  21. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models/ → lib/test_kaferi_cloud/models}/bookmarks.rb +0 -0
  22. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models/ → lib/test_kaferi_cloud/models}/bookmarks_response.rb +0 -0
  23. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models/ → lib/test_kaferi_cloud/models}/color.rb +0 -0
  24. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models/ → lib/test_kaferi_cloud/models}/document.rb +0 -0
  25. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models/ → lib/test_kaferi_cloud/models}/document_pages_response.rb +0 -0
  26. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models/ → lib/test_kaferi_cloud/models}/document_properties.rb +0 -0
  27. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models/ → lib/test_kaferi_cloud/models}/document_properties_response.rb +0 -0
  28. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models/ → lib/test_kaferi_cloud/models}/document_property.rb +0 -0
  29. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models/ → lib/test_kaferi_cloud/models}/document_property_response.rb +0 -0
  30. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models/ → lib/test_kaferi_cloud/models}/document_response.rb +0 -0
  31. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models/ → lib/test_kaferi_cloud/models}/document_text_replace_response.rb +0 -0
  32. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models/ → lib/test_kaferi_cloud/models}/field.rb +0 -0
  33. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models/ → lib/test_kaferi_cloud/models}/field_response.rb +0 -0
  34. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models/ → lib/test_kaferi_cloud/models}/field_type.rb +0 -0
  35. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models/ → lib/test_kaferi_cloud/models}/fields.rb +0 -0
  36. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models/ → lib/test_kaferi_cloud/models}/fields_response.rb +0 -0
  37. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models/ → lib/test_kaferi_cloud/models}/font_styles.rb +0 -0
  38. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models/ → lib/test_kaferi_cloud/models}/horizontal_alignment.rb +0 -0
  39. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models/ → lib/test_kaferi_cloud/models}/http_status_code.rb +0 -0
  40. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models/ → lib/test_kaferi_cloud/models}/image.rb +0 -0
  41. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models/ → lib/test_kaferi_cloud/models}/image_response.rb +0 -0
  42. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models/ → lib/test_kaferi_cloud/models}/images.rb +0 -0
  43. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models/ → lib/test_kaferi_cloud/models}/images_list_request.rb +0 -0
  44. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models/ → lib/test_kaferi_cloud/models}/images_response.rb +0 -0
  45. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models/ → lib/test_kaferi_cloud/models}/line_spacing.rb +0 -0
  46. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models/ → lib/test_kaferi_cloud/models}/link.rb +0 -0
  47. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models/ → lib/test_kaferi_cloud/models}/link_action_type.rb +0 -0
  48. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models/ → lib/test_kaferi_cloud/models}/link_annotation.rb +0 -0
  49. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models/ → lib/test_kaferi_cloud/models}/link_annotation_response.rb +0 -0
  50. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models/ → lib/test_kaferi_cloud/models}/link_annotations.rb +0 -0
  51. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models/ → lib/test_kaferi_cloud/models}/link_annotations_response.rb +0 -0
  52. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models/ → lib/test_kaferi_cloud/models}/link_element.rb +0 -0
  53. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models/ → lib/test_kaferi_cloud/models}/link_highlighting_mode.rb +0 -0
  54. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models/ → lib/test_kaferi_cloud/models}/merge_documents.rb +0 -0
  55. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models/ → lib/test_kaferi_cloud/models}/optimize_options.rb +0 -0
  56. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models/ → lib/test_kaferi_cloud/models}/page.rb +0 -0
  57. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models/ → lib/test_kaferi_cloud/models}/page_text_replace_response.rb +0 -0
  58. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models/ → lib/test_kaferi_cloud/models}/page_word_count.rb +0 -0
  59. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models/ → lib/test_kaferi_cloud/models}/pages.rb +0 -0
  60. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models/ → lib/test_kaferi_cloud/models}/paragraph.rb +0 -0
  61. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models/ → lib/test_kaferi_cloud/models}/rectangle.rb +0 -0
  62. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models/ → lib/test_kaferi_cloud/models}/rotation.rb +0 -0
  63. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models/ → lib/test_kaferi_cloud/models}/saa_spose_response.rb +0 -0
  64. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models/ → lib/test_kaferi_cloud/models}/segment.rb +0 -0
  65. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models/ → lib/test_kaferi_cloud/models}/signature.rb +0 -0
  66. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models/ → lib/test_kaferi_cloud/models}/signature_type.rb +0 -0
  67. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models/ → lib/test_kaferi_cloud/models}/split_result.rb +0 -0
  68. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models/ → lib/test_kaferi_cloud/models}/split_result_document.rb +0 -0
  69. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models/ → lib/test_kaferi_cloud/models}/split_result_response.rb +0 -0
  70. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models/ → lib/test_kaferi_cloud/models}/stamp.rb +0 -0
  71. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models/ → lib/test_kaferi_cloud/models}/stamp_type.rb +0 -0
  72. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models/ → lib/test_kaferi_cloud/models}/text_format.rb +0 -0
  73. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models/ → lib/test_kaferi_cloud/models}/text_format_response.rb +0 -0
  74. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models/ → lib/test_kaferi_cloud/models}/text_horizontal_alignment.rb +0 -0
  75. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models/ → lib/test_kaferi_cloud/models}/text_item.rb +0 -0
  76. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models/ → lib/test_kaferi_cloud/models}/text_item_response.rb +0 -0
  77. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models/ → lib/test_kaferi_cloud/models}/text_items.rb +0 -0
  78. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models/ → lib/test_kaferi_cloud/models}/text_items_response.rb +0 -0
  79. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models/ → lib/test_kaferi_cloud/models}/text_line.rb +0 -0
  80. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models/ → lib/test_kaferi_cloud/models}/text_rect.rb +0 -0
  81. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models/ → lib/test_kaferi_cloud/models}/text_rects.rb +0 -0
  82. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models/ → lib/test_kaferi_cloud/models}/text_rects_response.rb +0 -0
  83. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models/ → lib/test_kaferi_cloud/models}/text_replace.rb +0 -0
  84. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models/ → lib/test_kaferi_cloud/models}/text_replace_list_request.rb +0 -0
  85. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models/ → lib/test_kaferi_cloud/models}/text_replace_request.rb +0 -0
  86. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models/ → lib/test_kaferi_cloud/models}/text_replace_response.rb +0 -0
  87. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models/ → lib/test_kaferi_cloud/models}/text_state.rb +0 -0
  88. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models/ → lib/test_kaferi_cloud/models}/tiff_export_options.rb +0 -0
  89. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models/ → lib/test_kaferi_cloud/models}/vertical_alignment.rb +0 -0
  90. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models/ → lib/test_kaferi_cloud/models}/word_count.rb +0 -0
  91. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models/ → lib/test_kaferi_cloud/models}/word_count_response.rb +0 -0
  92. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models/ → lib/test_kaferi_cloud/models}/wrap_mode.rb +0 -0
  93. data/{D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud/ → lib/test_kaferi_cloud}/version.rb +1 -1
  94. data/spec/api/pdf_api_spec.rb +956 -0
  95. data/spec/api_client_spec.rb +235 -0
  96. data/spec/configuration_spec.rb +51 -0
  97. data/spec/models/annotation_response_spec.rb +63 -0
  98. data/spec/models/annotation_spec.rb +87 -0
  99. data/spec/models/annotations_response_spec.rb +63 -0
  100. data/spec/models/annotations_spec.rb +57 -0
  101. data/spec/models/append_document_spec.rb +63 -0
  102. data/spec/models/attachment_response_spec.rb +63 -0
  103. data/spec/models/attachment_spec.rb +93 -0
  104. data/spec/models/attachments_response_spec.rb +63 -0
  105. data/spec/models/attachments_spec.rb +57 -0
  106. data/spec/models/bookmarks_response_spec.rb +63 -0
  107. data/spec/models/bookmarks_spec.rb +57 -0
  108. data/spec/models/color_spec.rb +69 -0
  109. data/spec/models/document_pages_response_spec.rb +63 -0
  110. data/spec/models/document_properties_response_spec.rb +63 -0
  111. data/spec/models/document_properties_spec.rb +57 -0
  112. data/spec/models/document_property_response_spec.rb +63 -0
  113. data/spec/models/document_property_spec.rb +69 -0
  114. data/spec/models/document_response_spec.rb +69 -0
  115. data/spec/models/document_spec.rb +63 -0
  116. data/spec/models/document_text_replace_response_spec.rb +69 -0
  117. data/spec/models/field_response_spec.rb +63 -0
  118. data/spec/models/field_spec.rb +81 -0
  119. data/spec/models/field_type_spec.rb +45 -0
  120. data/spec/models/fields_response_spec.rb +63 -0
  121. data/spec/models/fields_spec.rb +57 -0
  122. data/spec/models/font_styles_spec.rb +45 -0
  123. data/spec/models/horizontal_alignment_spec.rb +45 -0
  124. data/spec/models/http_status_code_spec.rb +45 -0
  125. data/spec/models/image_response_spec.rb +63 -0
  126. data/spec/models/image_spec.rb +63 -0
  127. data/spec/models/images_list_request_spec.rb +51 -0
  128. data/spec/models/images_response_spec.rb +63 -0
  129. data/spec/models/images_spec.rb +57 -0
  130. data/spec/models/line_spacing_spec.rb +45 -0
  131. data/spec/models/link_action_type_spec.rb +45 -0
  132. data/spec/models/link_annotation_response_spec.rb +63 -0
  133. data/spec/models/link_annotation_spec.rb +75 -0
  134. data/spec/models/link_annotations_response_spec.rb +63 -0
  135. data/spec/models/link_annotations_spec.rb +57 -0
  136. data/spec/models/link_element_spec.rb +51 -0
  137. data/spec/models/link_highlighting_mode_spec.rb +45 -0
  138. data/spec/models/link_spec.rb +69 -0
  139. data/spec/models/merge_documents_spec.rb +51 -0
  140. data/spec/models/optimize_options_spec.rb +87 -0
  141. data/spec/models/page_spec.rb +69 -0
  142. data/spec/models/page_text_replace_response_spec.rb +69 -0
  143. data/spec/models/page_word_count_spec.rb +57 -0
  144. data/spec/models/pages_spec.rb +57 -0
  145. data/spec/models/paragraph_spec.rb +117 -0
  146. data/spec/models/rectangle_spec.rb +69 -0
  147. data/spec/models/rotation_spec.rb +45 -0
  148. data/spec/models/saa_spose_response_spec.rb +57 -0
  149. data/spec/models/segment_spec.rb +57 -0
  150. data/spec/models/signature_spec.rb +123 -0
  151. data/spec/models/signature_type_spec.rb +45 -0
  152. data/spec/models/split_result_document_spec.rb +75 -0
  153. data/spec/models/split_result_response_spec.rb +63 -0
  154. data/spec/models/split_result_spec.rb +51 -0
  155. data/spec/models/stamp_spec.rb +177 -0
  156. data/spec/models/stamp_type_spec.rb +45 -0
  157. data/spec/models/text_format_response_spec.rb +63 -0
  158. data/spec/models/text_format_spec.rb +69 -0
  159. data/spec/models/text_horizontal_alignment_spec.rb +45 -0
  160. data/spec/models/text_item_response_spec.rb +63 -0
  161. data/spec/models/text_item_spec.rb +63 -0
  162. data/spec/models/text_items_response_spec.rb +63 -0
  163. data/spec/models/text_items_spec.rb +57 -0
  164. data/spec/models/text_line_spec.rb +57 -0
  165. data/spec/models/text_rect_spec.rb +63 -0
  166. data/spec/models/text_rects_response_spec.rb +63 -0
  167. data/spec/models/text_rects_spec.rb +51 -0
  168. data/spec/models/text_replace_list_request_spec.rb +69 -0
  169. data/spec/models/text_replace_request_spec.rb +81 -0
  170. data/spec/models/text_replace_response_spec.rb +63 -0
  171. data/spec/models/text_replace_spec.rb +75 -0
  172. data/spec/models/text_state_spec.rb +75 -0
  173. data/spec/models/tiff_export_options_spec.rb +141 -0
  174. data/spec/models/vertical_alignment_spec.rb +45 -0
  175. data/spec/models/word_count_response_spec.rb +63 -0
  176. data/spec/models/word_count_spec.rb +51 -0
  177. data/spec/models/wrap_mode_spec.rb +45 -0
  178. data/spec/spec_helper.rb +120 -0
  179. data/{D://tmp//2018-02027//Ruby//test_kaferi_cloud.gemspec → test_kaferi_cloud.gemspec} +2 -1
  180. metadata +179 -101
  181. data/D://tmp//2018-02027//Ruby//.idea//.rakeTasks +0 -7
  182. data/D://tmp//2018-02027//Ruby//.idea//inspectionProfiles//Project_Default.xml +0 -6
  183. data/D://tmp//2018-02027//Ruby//.idea//misc.xml +0 -4
  184. data/D://tmp//2018-02027//Ruby//.idea//modules.xml +0 -8
  185. data/D://tmp//2018-02027//Ruby//.idea//ruby.iml +0 -15
  186. data/D://tmp//2018-02027//Ruby//.idea//vcs.xml +0 -6
  187. data/D://tmp//2018-02027//Ruby//.idea//workspace.xml +0 -776
@@ -0,0 +1,235 @@
1
+ =begin
2
+ --------------------------------------------------------------------------------------------------------------------
3
+ Copyright (c) 2018 Aspose.Pdf for Cloud
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ of this software and associated documentation files (the "Software"), to deal
6
+ in the Software without restriction, including without limitation the rights
7
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the Software is
9
+ furnished to do so, subject to the following conditions:
10
+ The above copyright notice and this permission notice shall be included in all
11
+ copies or substantial portions of the Software.
12
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
15
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
17
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
18
+ SOFTWARE.
19
+ --------------------------------------------------------------------------------------------------------------------
20
+ =end
21
+
22
+ require 'spec_helper'
23
+
24
+ describe TestKaferiCloud::ApiClient do
25
+ context 'initialization' do
26
+ context 'URL stuff' do
27
+ context 'host' do
28
+ it 'removes http from host' do
29
+ TestKaferiCloud.configure { |c| c.host = 'http://example.com' }
30
+ expect(TestKaferiCloud::Configuration.default.host).to eq('example.com')
31
+ end
32
+
33
+ it 'removes https from host' do
34
+ TestKaferiCloud.configure { |c| c.host = 'https://wookiee.com' }
35
+ expect(TestKaferiCloud::ApiClient.default.config.host).to eq('wookiee.com')
36
+ end
37
+
38
+ it 'removes trailing path from host' do
39
+ TestKaferiCloud.configure { |c| c.host = 'hobo.com/v4' }
40
+ expect(TestKaferiCloud::Configuration.default.host).to eq('hobo.com')
41
+ end
42
+ end
43
+
44
+ context 'base_path' do
45
+ it "prepends a slash to base_path" do
46
+ TestKaferiCloud.configure { |c| c.base_path = 'v4/dog' }
47
+ expect(TestKaferiCloud::Configuration.default.base_path).to eq('/v4/dog')
48
+ end
49
+
50
+ it "doesn't prepend a slash if one is already there" do
51
+ TestKaferiCloud.configure { |c| c.base_path = '/v4/dog' }
52
+ expect(TestKaferiCloud::Configuration.default.base_path).to eq('/v4/dog')
53
+ end
54
+
55
+ it "ends up as a blank string if nil" do
56
+ TestKaferiCloud.configure { |c| c.base_path = nil }
57
+ expect(TestKaferiCloud::Configuration.default.base_path).to eq('')
58
+ end
59
+ end
60
+ end
61
+ end
62
+
63
+ describe "params_encoding in #build_request" do
64
+ let(:config) { TestKaferiCloud::Configuration.new }
65
+ let(:api_client) { TestKaferiCloud::ApiClient.new(config) }
66
+
67
+ it "defaults to nil" do
68
+ expect(TestKaferiCloud::Configuration.default.params_encoding).to eq(nil)
69
+ expect(config.params_encoding).to eq(nil)
70
+
71
+ request = api_client.build_request(:get, '/test')
72
+ expect(request.options[:params_encoding]).to eq(nil)
73
+ end
74
+
75
+ it "can be customized" do
76
+ config.params_encoding = :multi
77
+ request = api_client.build_request(:get, '/test')
78
+ expect(request.options[:params_encoding]).to eq(:multi)
79
+ end
80
+ end
81
+
82
+ describe "timeout in #build_request" do
83
+ let(:config) { TestKaferiCloud::Configuration.new }
84
+ let(:api_client) { TestKaferiCloud::ApiClient.new(config) }
85
+
86
+ it "defaults to 0" do
87
+ expect(TestKaferiCloud::Configuration.default.timeout).to eq(0)
88
+ expect(config.timeout).to eq(0)
89
+
90
+ request = api_client.build_request(:get, '/test')
91
+ expect(request.options[:timeout]).to eq(0)
92
+ end
93
+
94
+ it "can be customized" do
95
+ config.timeout = 100
96
+ request = api_client.build_request(:get, '/test')
97
+ expect(request.options[:timeout]).to eq(100)
98
+ end
99
+ end
100
+
101
+ describe "#deserialize" do
102
+ it "handles Array<Integer>" do
103
+ api_client = TestKaferiCloud::ApiClient.new
104
+ headers = {'Content-Type' => 'application/json'}
105
+ response = double('response', headers: headers, body: '[12, 34]')
106
+ data = api_client.deserialize(response, 'Array<Integer>')
107
+ expect(data).to be_instance_of(Array)
108
+ expect(data).to eq([12, 34])
109
+ end
110
+
111
+ it "handles Array<Array<Integer>>" do
112
+ api_client = TestKaferiCloud::ApiClient.new
113
+ headers = {'Content-Type' => 'application/json'}
114
+ response = double('response', headers: headers, body: '[[12, 34], [56]]')
115
+ data = api_client.deserialize(response, 'Array<Array<Integer>>')
116
+ expect(data).to be_instance_of(Array)
117
+ expect(data).to eq([[12, 34], [56]])
118
+ end
119
+
120
+ it "handles Hash<String, String>" do
121
+ api_client = TestKaferiCloud::ApiClient.new
122
+ headers = {'Content-Type' => 'application/json'}
123
+ response = double('response', headers: headers, body: '{"message": "Hello"}')
124
+ data = api_client.deserialize(response, 'Hash<String, String>')
125
+ expect(data).to be_instance_of(Hash)
126
+ expect(data).to eq({:message => 'Hello'})
127
+ end
128
+ end
129
+
130
+ describe "#object_to_hash" do
131
+ it "ignores nils and includes empty arrays" do
132
+ # uncomment below to test object_to_hash for model
133
+ #api_client = TestKaferiCloud::ApiClient.new
134
+ #_model = TestKaferiCloud::ModelName.new
135
+ # update the model attribute below
136
+ #_model.id = 1
137
+ # update the expected value (hash) below
138
+ #expected = {id: 1, name: '', tags: []}
139
+ #expect(api_client.object_to_hash(_model)).to eq(expected)
140
+ end
141
+ end
142
+
143
+ describe "#build_collection_param" do
144
+ let(:param) { ['aa', 'bb', 'cc'] }
145
+ let(:api_client) { TestKaferiCloud::ApiClient.new }
146
+
147
+ it "works for csv" do
148
+ expect(api_client.build_collection_param(param, :csv)).to eq('aa,bb,cc')
149
+ end
150
+
151
+ it "works for ssv" do
152
+ expect(api_client.build_collection_param(param, :ssv)).to eq('aa bb cc')
153
+ end
154
+
155
+ it "works for tsv" do
156
+ expect(api_client.build_collection_param(param, :tsv)).to eq("aa\tbb\tcc")
157
+ end
158
+
159
+ it "works for pipes" do
160
+ expect(api_client.build_collection_param(param, :pipes)).to eq('aa|bb|cc')
161
+ end
162
+
163
+ it "works for multi" do
164
+ expect(api_client.build_collection_param(param, :multi)).to eq(['aa', 'bb', 'cc'])
165
+ end
166
+
167
+ it "fails for invalid collection format" do
168
+ expect(proc { api_client.build_collection_param(param, :INVALID) }).to raise_error(RuntimeError, 'unknown collection format: :INVALID')
169
+ end
170
+ end
171
+
172
+ describe "#json_mime?" do
173
+ let(:api_client) { TestKaferiCloud::ApiClient.new }
174
+
175
+ it "works" do
176
+ expect(api_client.json_mime?(nil)).to eq false
177
+ expect(api_client.json_mime?('')).to eq false
178
+
179
+ expect(api_client.json_mime?('application/json')).to eq true
180
+ expect(api_client.json_mime?('application/json; charset=UTF8')).to eq true
181
+ expect(api_client.json_mime?('APPLICATION/JSON')).to eq true
182
+
183
+ expect(api_client.json_mime?('application/xml')).to eq false
184
+ expect(api_client.json_mime?('text/plain')).to eq false
185
+ expect(api_client.json_mime?('application/jsonp')).to eq false
186
+ end
187
+ end
188
+
189
+ describe "#select_header_accept" do
190
+ let(:api_client) { TestKaferiCloud::ApiClient.new }
191
+
192
+ it "works" do
193
+ expect(api_client.select_header_accept(nil)).to be_nil
194
+ expect(api_client.select_header_accept([])).to be_nil
195
+
196
+ expect(api_client.select_header_accept(['application/json'])).to eq('application/json')
197
+ expect(api_client.select_header_accept(['application/xml', 'application/json; charset=UTF8'])).to eq('application/json; charset=UTF8')
198
+ expect(api_client.select_header_accept(['APPLICATION/JSON', 'text/html'])).to eq('APPLICATION/JSON')
199
+
200
+ expect(api_client.select_header_accept(['application/xml'])).to eq('application/xml')
201
+ expect(api_client.select_header_accept(['text/html', 'application/xml'])).to eq('text/html,application/xml')
202
+ end
203
+ end
204
+
205
+ describe "#select_header_content_type" do
206
+ let(:api_client) { TestKaferiCloud::ApiClient.new }
207
+
208
+ it "works" do
209
+ expect(api_client.select_header_content_type(nil)).to eq('application/json')
210
+ expect(api_client.select_header_content_type([])).to eq('application/json')
211
+
212
+ expect(api_client.select_header_content_type(['application/json'])).to eq('application/json')
213
+ expect(api_client.select_header_content_type(['application/xml', 'application/json; charset=UTF8'])).to eq('application/json; charset=UTF8')
214
+ expect(api_client.select_header_content_type(['APPLICATION/JSON', 'text/html'])).to eq('APPLICATION/JSON')
215
+ expect(api_client.select_header_content_type(['application/xml'])).to eq('application/xml')
216
+ expect(api_client.select_header_content_type(['text/plain', 'application/xml'])).to eq('text/plain')
217
+ end
218
+ end
219
+
220
+ describe "#sanitize_filename" do
221
+ let(:api_client) { TestKaferiCloud::ApiClient.new }
222
+
223
+ it "works" do
224
+ expect(api_client.sanitize_filename('sun')).to eq('sun')
225
+ expect(api_client.sanitize_filename('sun.gif')).to eq('sun.gif')
226
+ expect(api_client.sanitize_filename('../sun.gif')).to eq('sun.gif')
227
+ expect(api_client.sanitize_filename('/var/tmp/sun.gif')).to eq('sun.gif')
228
+ expect(api_client.sanitize_filename('./sun.gif')).to eq('sun.gif')
229
+ expect(api_client.sanitize_filename('..\sun.gif')).to eq('sun.gif')
230
+ expect(api_client.sanitize_filename('\var\tmp\sun.gif')).to eq('sun.gif')
231
+ expect(api_client.sanitize_filename('c:\var\tmp\sun.gif')).to eq('sun.gif')
232
+ expect(api_client.sanitize_filename('.\sun.gif')).to eq('sun.gif')
233
+ end
234
+ end
235
+ end
@@ -0,0 +1,51 @@
1
+ =begin
2
+ --------------------------------------------------------------------------------------------------------------------
3
+ Copyright (c) 2018 Aspose.Pdf for Cloud
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ of this software and associated documentation files (the "Software"), to deal
6
+ in the Software without restriction, including without limitation the rights
7
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the Software is
9
+ furnished to do so, subject to the following conditions:
10
+ The above copyright notice and this permission notice shall be included in all
11
+ copies or substantial portions of the Software.
12
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
15
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
17
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
18
+ SOFTWARE.
19
+ --------------------------------------------------------------------------------------------------------------------
20
+ =end
21
+
22
+ require 'spec_helper'
23
+
24
+ describe TestKaferiCloud::Configuration do
25
+ let(:config) { TestKaferiCloud::Configuration.default }
26
+
27
+ before(:each) do
28
+ # uncomment below to setup host and base_path
29
+ #require 'URI'
30
+ #uri = URI.parse("https://localhost/v1.1")
31
+ #TestKaferiCloud.configure do |c|
32
+ # c.host = uri.host
33
+ # c.base_path = uri.path
34
+ #end
35
+ end
36
+
37
+ describe '#base_url' do
38
+ it 'should have the default value' do
39
+ # uncomment below to test default value of the base path
40
+ #expect(config.base_url).to eq("https://localhost/v1.1")
41
+ end
42
+
43
+ it 'should remove trailing slashes' do
44
+ [nil, '', '/', '//'].each do |base_path|
45
+ config.base_path = base_path
46
+ # uncomment below to test trailing slashes
47
+ #expect(config.base_url).to eq("https://localhost/v1.1")
48
+ end
49
+ end
50
+ end
51
+ end
@@ -0,0 +1,63 @@
1
+ =begin
2
+ --------------------------------------------------------------------------------------------------------------------
3
+ Copyright (c) 2018 Aspose.Pdf for Cloud
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ of this software and associated documentation files (the "Software"), to deal
6
+ in the Software without restriction, including without limitation the rights
7
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the Software is
9
+ furnished to do so, subject to the following conditions:
10
+ The above copyright notice and this permission notice shall be included in all
11
+ copies or substantial portions of the Software.
12
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
15
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
17
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
18
+ SOFTWARE.
19
+ --------------------------------------------------------------------------------------------------------------------
20
+ =end
21
+
22
+ require 'spec_helper'
23
+ require 'json'
24
+ require 'date'
25
+
26
+ # Unit tests for TestKaferiCloud::AnnotationResponse
27
+ # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
28
+ # Please update as you see appropriate
29
+ describe 'AnnotationResponse' do
30
+ before do
31
+ # run before each test
32
+ @instance = TestKaferiCloud::AnnotationResponse.new
33
+ end
34
+
35
+ after do
36
+ # run after each test
37
+ end
38
+
39
+ describe 'test an instance of AnnotationResponse' do
40
+ it 'should create an instance of AnnotationResponse' do
41
+ expect(@instance).to be_instance_of(TestKaferiCloud::AnnotationResponse)
42
+ end
43
+ end
44
+ describe 'test attribute "code"' do
45
+ it 'should work' do
46
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
47
+ end
48
+ end
49
+
50
+ describe 'test attribute "status"' do
51
+ it 'should work' do
52
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
53
+ end
54
+ end
55
+
56
+ describe 'test attribute "annotation"' do
57
+ it 'should work' do
58
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
59
+ end
60
+ end
61
+
62
+ end
63
+
@@ -0,0 +1,87 @@
1
+ =begin
2
+ --------------------------------------------------------------------------------------------------------------------
3
+ Copyright (c) 2018 Aspose.Pdf for Cloud
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ of this software and associated documentation files (the "Software"), to deal
6
+ in the Software without restriction, including without limitation the rights
7
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the Software is
9
+ furnished to do so, subject to the following conditions:
10
+ The above copyright notice and this permission notice shall be included in all
11
+ copies or substantial portions of the Software.
12
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
15
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
17
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
18
+ SOFTWARE.
19
+ --------------------------------------------------------------------------------------------------------------------
20
+ =end
21
+
22
+ require 'spec_helper'
23
+ require 'json'
24
+ require 'date'
25
+
26
+ # Unit tests for TestKaferiCloud::Annotation
27
+ # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
28
+ # Please update as you see appropriate
29
+ describe 'Annotation' do
30
+ before do
31
+ # run before each test
32
+ @instance = TestKaferiCloud::Annotation.new
33
+ end
34
+
35
+ after do
36
+ # run after each test
37
+ end
38
+
39
+ describe 'test an instance of Annotation' do
40
+ it 'should create an instance of Annotation' do
41
+ expect(@instance).to be_instance_of(TestKaferiCloud::Annotation)
42
+ end
43
+ end
44
+ describe 'test attribute "links"' do
45
+ it 'should work' do
46
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
47
+ end
48
+ end
49
+
50
+ describe 'test attribute "color"' do
51
+ it 'should work' do
52
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
53
+ end
54
+ end
55
+
56
+ describe 'test attribute "contents"' do
57
+ it 'should work' do
58
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
59
+ end
60
+ end
61
+
62
+ describe 'test attribute "creation_date"' do
63
+ it 'should work' do
64
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
65
+ end
66
+ end
67
+
68
+ describe 'test attribute "subject"' do
69
+ it 'should work' do
70
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
71
+ end
72
+ end
73
+
74
+ describe 'test attribute "title"' do
75
+ it 'should work' do
76
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
77
+ end
78
+ end
79
+
80
+ describe 'test attribute "modified"' do
81
+ it 'should work' do
82
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
83
+ end
84
+ end
85
+
86
+ end
87
+
@@ -0,0 +1,63 @@
1
+ =begin
2
+ --------------------------------------------------------------------------------------------------------------------
3
+ Copyright (c) 2018 Aspose.Pdf for Cloud
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ of this software and associated documentation files (the "Software"), to deal
6
+ in the Software without restriction, including without limitation the rights
7
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the Software is
9
+ furnished to do so, subject to the following conditions:
10
+ The above copyright notice and this permission notice shall be included in all
11
+ copies or substantial portions of the Software.
12
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
15
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
17
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
18
+ SOFTWARE.
19
+ --------------------------------------------------------------------------------------------------------------------
20
+ =end
21
+
22
+ require 'spec_helper'
23
+ require 'json'
24
+ require 'date'
25
+
26
+ # Unit tests for TestKaferiCloud::AnnotationsResponse
27
+ # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
28
+ # Please update as you see appropriate
29
+ describe 'AnnotationsResponse' do
30
+ before do
31
+ # run before each test
32
+ @instance = TestKaferiCloud::AnnotationsResponse.new
33
+ end
34
+
35
+ after do
36
+ # run after each test
37
+ end
38
+
39
+ describe 'test an instance of AnnotationsResponse' do
40
+ it 'should create an instance of AnnotationsResponse' do
41
+ expect(@instance).to be_instance_of(TestKaferiCloud::AnnotationsResponse)
42
+ end
43
+ end
44
+ describe 'test attribute "code"' do
45
+ it 'should work' do
46
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
47
+ end
48
+ end
49
+
50
+ describe 'test attribute "status"' do
51
+ it 'should work' do
52
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
53
+ end
54
+ end
55
+
56
+ describe 'test attribute "annotations"' do
57
+ it 'should work' do
58
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
59
+ end
60
+ end
61
+
62
+ end
63
+