diff --git a/README.md b/README.md index dcf3eba..7544c4f 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ -# Aspose.Cells Cloud SDK for Ruby [![NuGet](https://img.shields.io/nuget/v/Aspose.Cells-Cloud.svg)](https://www.nuget.org/packages/Aspose.Cells-Cloud/) +# Aspose.Cells Cloud SDK for Ruby - API version: 3.0 -- SDK version: 19.9 +- SDK version: 19.10 This repository contains Aspose.Cells Cloud SDK for Ruby source code. This SDK allows you to work with Aspose.Cells Cloud REST APIs in your Ruby applications quickly and easily, with zero initial cost. diff --git a/docs/CellsApi.md b/docs/CellsApi.md index 8423c32..9ddc640 100644 --- a/docs/CellsApi.md +++ b/docs/CellsApi.md @@ -198,6 +198,7 @@ Method | HTTP request | Description [**cells_workbook_put_document_protect_from_changes**](CellsApi.md#cells_workbook_put_document_protect_from_changes) | **PUT** /cells/{name}/writeProtection | Protect document from changes. [**cells_workbook_put_workbook_create**](CellsApi.md#cells_workbook_put_workbook_create) | **PUT** /cells/{name} | Create new workbook using deferent methods. [**cells_worksheet_validations_delete_worksheet_validation**](CellsApi.md#cells_worksheet_validations_delete_worksheet_validation) | **DELETE** /cells/{name}/worksheets/{sheetName}/validations/{validationIndex} | Delete worksheet validation by index. +[**cells_worksheet_validations_delete_worksheet_validations**](CellsApi.md#cells_worksheet_validations_delete_worksheet_validations) | **DELETE** /cells/{name}/worksheets/{sheetName}/validations | Clear all validation in worksheet. [**cells_worksheet_validations_get_worksheet_validation**](CellsApi.md#cells_worksheet_validations_get_worksheet_validation) | **GET** /cells/{name}/worksheets/{sheetName}/validations/{validationIndex} | Get worksheet validation by index. [**cells_worksheet_validations_get_worksheet_validations**](CellsApi.md#cells_worksheet_validations_get_worksheet_validations) | **GET** /cells/{name}/worksheets/{sheetName}/validations | Get worksheet validations. [**cells_worksheet_validations_post_worksheet_validation**](CellsApi.md#cells_worksheet_validations_post_worksheet_validation) | **POST** /cells/{name}/worksheets/{sheetName}/validations/{validationIndex} | Update worksheet validation by index. @@ -2511,7 +2512,7 @@ sheet_name = 'sheet_name_example' # String | cell_area = 'cell_area_example' # String | opts = { - formatcondition: AsposeCellsCloud::FormatCondition.new, # FormatCondition | + format_condition: AsposeCellsCloud::FormatCondition.new, # FormatCondition | folder: 'folder_example', # String | storage: 'storage_example' # String | storage name. } @@ -2532,7 +2533,7 @@ Name | Type | Description | Notes **name** | **String**| | **sheet_name** | **String**| | **cell_area** | **String**| | - **formatcondition** | [**FormatCondition**](FormatCondition.md)| | [optional] + **format_condition** | [**FormatCondition**](FormatCondition.md)| | [optional] **folder** | **String**| | [optional] **storage** | **String**| storage name. | [optional] @@ -7883,7 +7884,7 @@ No authorization required # **cells_post_set_cell_html_string** -> CellResponse cells_post_set_cell_html_string(name, sheet_name, cell_name, opts) +> CellResponse cells_post_set_cell_html_string(name, sheet_name, cell_name, html_string, opts) Set htmlstring value into cell @@ -7900,6 +7901,8 @@ sheet_name = 'sheet_name_example' # String | Worksheet name. cell_name = 'cell_name_example' # String | The cell name. +html_string = 'B' # String | + opts = { folder: 'folder_example', # String | The workbook folder. storage: 'storage_example' # String | storage name. @@ -7907,7 +7910,7 @@ opts = { begin #Set htmlstring value into cell - result = api_instance.cells_post_set_cell_html_string(name, sheet_name, cell_name, opts) + result = api_instance.cells_post_set_cell_html_string(name, sheet_name, cell_name, html_string, opts) p result rescue AsposeCellsCloud::ApiError => e puts "Exception when calling CellsApi->cells_post_set_cell_html_string: #{e}" @@ -7921,6 +7924,7 @@ Name | Type | Description | Notes **name** | **String**| Workbook name. | **sheet_name** | **String**| Worksheet name. | **cell_name** | **String**| The cell name. | + **html_string** | **String**| | **folder** | **String**| The workbook folder. | [optional] **storage** | **String**| storage name. | [optional] @@ -10921,7 +10925,7 @@ No authorization required # **cells_workbook_post_import_data** -> CellsCloudResponse cells_workbook_post_import_data(name, importdata, opts) +> CellsCloudResponse cells_workbook_post_import_data(name, import_data, opts) @@ -10934,7 +10938,7 @@ api_instance = AsposeCellsCloud::CellsApi.new name = 'name_example' # String | -importdata = AsposeCellsCloud::ImportOption.new # ImportOption | +import_data = AsposeCellsCloud::ImportOption.new # ImportOption | opts = { folder: 'folder_example', # String | @@ -10942,7 +10946,7 @@ opts = { } begin - result = api_instance.cells_workbook_post_import_data(name, importdata, opts) + result = api_instance.cells_workbook_post_import_data(name, import_data, opts) p result rescue AsposeCellsCloud::ApiError => e puts "Exception when calling CellsApi->cells_workbook_post_import_data: #{e}" @@ -10954,7 +10958,7 @@ end Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **name** | **String**| | - **importdata** | [**ImportOption**](ImportOption.md)| | + **import_data** | [**ImportOption**](ImportOption.md)| | **folder** | **String**| | [optional] **storage** | **String**| storage name. | [optional] @@ -11633,6 +11637,60 @@ No authorization required +# **cells_worksheet_validations_delete_worksheet_validations** +> CellsCloudResponse cells_worksheet_validations_delete_worksheet_validations(name, sheet_name, opts) + +Clear all validation in worksheet. + +### Example +```ruby +# load the gem +require 'aspose_cells_cloud' + +api_instance = AsposeCellsCloud::CellsApi.new + +name = 'name_example' # String | Document name. + +sheet_name = 'sheet_name_example' # String | Worksheet name. + +opts = { + folder: 'folder_example', # String | Document's folder. + storage: 'storage_example' # String | storage name. +} + +begin + #Clear all validation in worksheet. + result = api_instance.cells_worksheet_validations_delete_worksheet_validations(name, sheet_name, opts) + p result +rescue AsposeCellsCloud::ApiError => e + puts "Exception when calling CellsApi->cells_worksheet_validations_delete_worksheet_validations: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **name** | **String**| Document name. | + **sheet_name** | **String**| Worksheet name. | + **folder** | **String**| Document's folder. | [optional] + **storage** | **String**| storage name. | [optional] + +### Return type + +[**CellsCloudResponse**](CellsCloudResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + # **cells_worksheet_validations_get_worksheet_validation** > ValidationResponse cells_worksheet_validations_get_worksheet_validation(name, sheet_name, validation_index, opts) diff --git a/lib/aspose_cells_cloud/api/cells_api.rb b/lib/aspose_cells_cloud/api/cells_api.rb index d7fc08c..0efbc31 100644 --- a/lib/aspose_cells_cloud/api/cells_api.rb +++ b/lib/aspose_cells_cloud/api/cells_api.rb @@ -26,10 +26,11 @@ module AsposeCellsCloud class CellsApi attr_accessor :api_client - def initialize(app_sid,app_key, api_client = ApiClient.default) + def initialize(app_sid,app_key, app_version = 'v3.0', api_client = ApiClient.default) @api_client = api_client @api_client.config.app_key = app_key @api_client.config.app_sid = app_sid + @api_client.config.api_version = app_version end # Removes a date filter. @@ -3064,7 +3065,7 @@ def cells_conditional_formattings_get_worksheet_conditional_formattings_with_htt # @param sheet_name # @param cell_area # @param [Hash] opts the optional parameters - # @option opts [FormatCondition] :formatcondition + # @option opts [FormatCondition] :format_condition # @option opts [String] :folder # @option opts [String] :storage storage name. # @return [CellsCloudResponse] @@ -3079,7 +3080,7 @@ def cells_conditional_formattings_put_worksheet_conditional_formatting(name, she # @param sheet_name # @param cell_area # @param [Hash] opts the optional parameters - # @option opts [FormatCondition] :formatcondition + # @option opts [FormatCondition] :format_condition # @option opts [String] :folder # @option opts [String] :storage storage name. # @return [Array<(CellsCloudResponse, Fixnum, Hash)>] CellsCloudResponse data, response status code and response headers @@ -3120,7 +3121,7 @@ def cells_conditional_formattings_put_worksheet_conditional_formatting_with_http form_params = {} # http body (model) - post_body = @api_client.object_to_http_body(opts[:'formatcondition']) + post_body = @api_client.object_to_http_body(opts[:'format_condition']) #auth_names = [] auth_names = ['JWT'] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, @@ -10285,12 +10286,13 @@ def cells_post_row_style_with_http_info(name, sheet_name, row_index, opts = {}) # @param name Workbook name. # @param sheet_name Worksheet name. # @param cell_name The cell name. + # @param html_string # @param [Hash] opts the optional parameters # @option opts [String] :folder The workbook folder. # @option opts [String] :storage storage name. # @return [CellResponse] - def cells_post_set_cell_html_string(name, sheet_name, cell_name, opts = {}) - data, _status_code, _headers = cells_post_set_cell_html_string_with_http_info(name, sheet_name, cell_name, opts) + def cells_post_set_cell_html_string(name, sheet_name, cell_name, html_string, opts = {}) + data, _status_code, _headers = cells_post_set_cell_html_string_with_http_info(name, sheet_name, cell_name, html_string, opts) return data end @@ -10299,11 +10301,12 @@ def cells_post_set_cell_html_string(name, sheet_name, cell_name, opts = {}) # @param name Workbook name. # @param sheet_name Worksheet name. # @param cell_name The cell name. + # @param html_string # @param [Hash] opts the optional parameters # @option opts [String] :folder The workbook folder. # @option opts [String] :storage storage name. # @return [Array<(CellResponse, Fixnum, Hash)>] CellResponse data, response status code and response headers - def cells_post_set_cell_html_string_with_http_info(name, sheet_name, cell_name, opts = {}) + def cells_post_set_cell_html_string_with_http_info(name, sheet_name, cell_name, html_string, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: CellsApi.cells_post_set_cell_html_string ..." end @@ -10320,6 +10323,10 @@ def cells_post_set_cell_html_string_with_http_info(name, sheet_name, cell_name, if @api_client.config.client_side_validation && cell_name.nil? fail ArgumentError, "Missing the required parameter 'cell_name' when calling CellsApi.cells_post_set_cell_html_string" end + # verify the required parameter 'html_string' is set + if @api_client.config.client_side_validation && html_string.nil? + fail ArgumentError, "Missing the required parameter 'html_string' when calling CellsApi.cells_post_set_cell_html_string" + end # resource path local_var_path = "/cells/{name}/worksheets/{sheetName}/cells/{cellName}/htmlstring".sub('{' + 'name' + '}', name.to_s).sub('{' + 'sheetName' + '}', sheet_name.to_s).sub('{' + 'cellName' + '}', cell_name.to_s) @@ -10339,7 +10346,7 @@ def cells_post_set_cell_html_string_with_http_info(name, sheet_name, cell_name, form_params = {} # http body (model) - post_body = nil + post_body = @api_client.object_to_http_body(html_string) #auth_names = [] auth_names = ['JWT'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, @@ -14269,25 +14276,25 @@ def cells_workbook_post_encrypt_document_with_http_info(name, opts = {}) # # # @param name - # @param importdata + # @param import_data # @param [Hash] opts the optional parameters # @option opts [String] :folder # @option opts [String] :storage storage name. # @return [CellsCloudResponse] - def cells_workbook_post_import_data(name, importdata, opts = {}) - data, _status_code, _headers = cells_workbook_post_import_data_with_http_info(name, importdata, opts) + def cells_workbook_post_import_data(name, import_data, opts = {}) + data, _status_code, _headers = cells_workbook_post_import_data_with_http_info(name, import_data, opts) return data end # # # @param name - # @param importdata + # @param import_data # @param [Hash] opts the optional parameters # @option opts [String] :folder # @option opts [String] :storage storage name. # @return [Array<(CellsCloudResponse, Fixnum, Hash)>] CellsCloudResponse data, response status code and response headers - def cells_workbook_post_import_data_with_http_info(name, importdata, opts = {}) + def cells_workbook_post_import_data_with_http_info(name, import_data, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: CellsApi.cells_workbook_post_import_data ..." end @@ -14296,9 +14303,9 @@ def cells_workbook_post_import_data_with_http_info(name, importdata, opts = {}) if @api_client.config.client_side_validation && name.nil? fail ArgumentError, "Missing the required parameter 'name' when calling CellsApi.cells_workbook_post_import_data" end - # verify the required parameter 'importdata' is set - if @api_client.config.client_side_validation && importdata.nil? - fail ArgumentError, "Missing the required parameter 'importdata' when calling CellsApi.cells_workbook_post_import_data" + # verify the required parameter 'import_data' is set + if @api_client.config.client_side_validation && import_data.nil? + fail ArgumentError, "Missing the required parameter 'import_data' when calling CellsApi.cells_workbook_post_import_data" end # resource path local_var_path = "/cells/{name}/importdata".sub('{' + 'name' + '}', name.to_s) @@ -14319,7 +14326,7 @@ def cells_workbook_post_import_data_with_http_info(name, importdata, opts = {}) form_params = {} # http body (model) - post_body = @api_client.object_to_http_body(importdata) + post_body = @api_client.object_to_http_body(import_data) #auth_names = [] auth_names = ['JWT'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, @@ -14942,12 +14949,13 @@ def cells_workbook_put_convert_workbook_with_http_info(workbook, opts = {}) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params['Content-Type'] = @api_client.select_header_content_type(['application/octet-stream']) + # form parameters form_params = {} # http body (model) - post_body =workbook + # post_body = @api_client.object_to_http_body(workbook) + post_body = workbook #auth_names = [] auth_names = ['JWT'] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, @@ -15172,6 +15180,75 @@ def cells_worksheet_validations_delete_worksheet_validation_with_http_info(name, return data, status_code, headers end + # Clear all validation in worksheet. + # + # @param name Document name. + # @param sheet_name Worksheet name. + # @param [Hash] opts the optional parameters + # @option opts [String] :folder Document's folder. + # @option opts [String] :storage storage name. + # @return [CellsCloudResponse] + def cells_worksheet_validations_delete_worksheet_validations(name, sheet_name, opts = {}) + data, _status_code, _headers = cells_worksheet_validations_delete_worksheet_validations_with_http_info(name, sheet_name, opts) + return data + end + + # Clear all validation in worksheet. + # + # @param name Document name. + # @param sheet_name Worksheet name. + # @param [Hash] opts the optional parameters + # @option opts [String] :folder Document's folder. + # @option opts [String] :storage storage name. + # @return [Array<(CellsCloudResponse, Fixnum, Hash)>] CellsCloudResponse data, response status code and response headers + def cells_worksheet_validations_delete_worksheet_validations_with_http_info(name, sheet_name, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug "Calling API: CellsApi.cells_worksheet_validations_delete_worksheet_validations ..." + end + @api_client.request_token_if_needed + # verify the required parameter 'name' is set + if @api_client.config.client_side_validation && name.nil? + fail ArgumentError, "Missing the required parameter 'name' when calling CellsApi.cells_worksheet_validations_delete_worksheet_validations" + end + # verify the required parameter 'sheet_name' is set + if @api_client.config.client_side_validation && sheet_name.nil? + fail ArgumentError, "Missing the required parameter 'sheet_name' when calling CellsApi.cells_worksheet_validations_delete_worksheet_validations" + end + # resource path + local_var_path = "/cells/{name}/worksheets/{sheetName}/validations".sub('{' + 'name' + '}', name.to_s).sub('{' + 'sheetName' + '}', sheet_name.to_s) + + # query parameters + query_params = {} + query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil? + query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil? + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + #auth_names = [] + auth_names = ['JWT'] + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'CellsCloudResponse') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CellsApi#cells_worksheet_validations_delete_worksheet_validations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Get worksheet validation by index. # # @param name Document name. @@ -18922,7 +18999,7 @@ def upload_file_with_http_info(path, file, opts = {}) header_params['Content-Type'] = @api_client.select_header_content_type(['application/octet-stream']) # form parameters form_params = {} -# form_params["File"] = file + # form_params["File"] = file # http body (model) post_body = file diff --git a/lib/aspose_cells_cloud/api_client.rb b/lib/aspose_cells_cloud/api_client.rb index f42140f..a5e9d06 100644 --- a/lib/aspose_cells_cloud/api_client.rb +++ b/lib/aspose_cells_cloud/api_client.rb @@ -422,7 +422,11 @@ def request_token_if_needed # resource path local_var_path = "/connect/token" - url = build_request_url(local_var_path).gsub('/v3.0', '') + if @config.api_version === "v1.1" + local_var_path ="/oauth2/token" + end + url = build_request_url(local_var_path).gsub('/'+config.api_version, '') + #url = build_request_url(local_var_path).gsub('/v3.0', '') # header parameters header_params = {} diff --git a/lib/aspose_cells_cloud/configuration.rb b/lib/aspose_cells_cloud/configuration.rb index 69aa3f9..567e57a 100644 --- a/lib/aspose_cells_cloud/configuration.rb +++ b/lib/aspose_cells_cloud/configuration.rb @@ -37,6 +37,9 @@ class Configuration # Defines url host attr_accessor :host + # Defines api version + attr_accessor :api_version + # Defines the access token (Bearer) used with OAuth2. attr_accessor :access_token @@ -118,6 +121,7 @@ class Configuration def initialize @scheme = 'https' @host = 'api.aspose.cloud' + @api_version = 'v3.0' @timeout = 5 * 60 @client_side_validation = true @verify_ssl = true @@ -153,7 +157,8 @@ def host=(host) end def base_url - url = "#{scheme}://#{[host, '/v3.0'].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') + #url = "#{scheme}://#{[host, '/v3.0'].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') + url = "#{scheme}://#{[host, '/'+ api_version ].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') URI.encode(url) end diff --git a/lib/aspose_cells_cloud/version.rb b/lib/aspose_cells_cloud/version.rb index 4545c10..2d54024 100644 --- a/lib/aspose_cells_cloud/version.rb +++ b/lib/aspose_cells_cloud/version.rb @@ -21,5 +21,5 @@ =end module AsposeCellsCloud - VERSION = "19.9" + VERSION = "19.10" end diff --git a/spec/api/cells_api_spec.rb b/spec/api/cells_api_spec.rb index 1e876d1..18de88e 100644 --- a/spec/api/cells_api_spec.rb +++ b/spec/api/cells_api_spec.rb @@ -18,7 +18,7 @@ # Please update as you see appropriate describe 'CellsApi' do before do - @instance = AsposeCellsCloud::CellsApi.new("66164C51-693E-4904-A121-545961673EC1","536e76768419db9585afdd37bb5f7533") + @instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,"v3.0") end after do @@ -47,8 +47,10 @@ update_reference = true folder = $TEMPFOLDER storage = nil - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_delete_worksheet_columns(name, sheet_name, column_index, columns, update_reference, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_delete_worksheet_columns(name, sheet_name, column_index, columns, update_reference, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -70,8 +72,10 @@ row_index = 100 folder = $TEMPFOLDER storage = nil - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_delete_worksheet_row(name, sheet_name, row_index, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_delete_worksheet_row(name, sheet_name, row_index, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -97,8 +101,10 @@ update_reference = true folder = $TEMPFOLDER storage = nil - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_delete_worksheet_rows(name, sheet_name, startrow, { :total_rows=>total_rows, :update_reference=>update_reference,:folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_delete_worksheet_rows(name, sheet_name, startrow, { :total_rows=>total_rows, :update_reference=>update_reference,:folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -120,8 +126,10 @@ cell_or_method_name = 'firstcell' folder = $TEMPFOLDER storage = nil - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_get_worksheet_cell(name, sheet_name, cell_or_method_name, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_get_worksheet_cell(name, sheet_name, cell_or_method_name, { :folder=>folder}) + print(result) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -143,8 +151,10 @@ cell_name = 'C1' folder = $TEMPFOLDER storage = nil - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_get_worksheet_cell_style(name, sheet_name, cell_name, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_get_worksheet_cell_style(name, sheet_name, cell_name, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -168,8 +178,10 @@ count = 3 folder = $TEMPFOLDER storage = nil - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_get_worksheet_cells(name, sheet_name, {:offest=>offest, :count=>count, :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_get_worksheet_cells(name, sheet_name, {:offest=>offest, :count=>count, :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -191,8 +203,10 @@ column_index = 100 folder = $TEMPFOLDER storage = nil - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_get_worksheet_column(name, sheet_name, column_index, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_get_worksheet_column(name, sheet_name, column_index, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -212,8 +226,10 @@ sheet_name = $SHEET1 folder = $TEMPFOLDER storage = nil - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_get_worksheet_columns(name, sheet_name, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_get_worksheet_columns(name, sheet_name, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -235,8 +251,10 @@ row_index = 100 folder = $TEMPFOLDER storage = nil - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_get_worksheet_row(name, sheet_name, row_index, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_get_worksheet_row(name, sheet_name, row_index, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -256,8 +274,10 @@ sheet_name = $SHEET1 folder = $TEMPFOLDER storage = nil - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_get_worksheet_rows(name, sheet_name, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_get_worksheet_rows(name, sheet_name, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -281,8 +301,10 @@ options = AsposeCellsCloud::CalculationOptions.new({Recursive:true,IgnoreError:true}) folder = $TEMPFOLDER storage = nil - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_post_cell_calculate(name, sheet_name, cell_name, { :options=>options,:folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_post_cell_calculate(name, sheet_name, cell_name, { :options=>options,:folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -306,8 +328,10 @@ options = nil folder = $TEMPFOLDER storage = nil - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_post_cell_characters(name, sheet_name, cell_name, { :options=>options,:folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_post_cell_characters(name, sheet_name, cell_name, { :options=>options,:folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -337,8 +361,10 @@ end_column = 2 folder = $TEMPFOLDER storage = nil - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_post_clear_contents(name, sheet_name, {:range=>range, :start_row=>start_row, :start_column=>start_column, :end_row=>end_row, :end_column=>end_column, :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_post_clear_contents(name, sheet_name, {:range=>range, :start_row=>start_row, :start_column=>start_column, :end_row=>end_row, :end_column=>end_column, :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -368,8 +394,10 @@ end_column = 2 folder = $TEMPFOLDER storage = nil - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_post_clear_formats(name, sheet_name, {:range=>range, :start_row=>start_row, :start_column=>start_column, :end_row=>end_row, :end_column=>end_column, :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_post_clear_formats(name, sheet_name, {:range=>range, :start_row=>start_row, :start_column=>start_column, :end_row=>end_row, :end_column=>end_column, :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -393,8 +421,10 @@ style = AsposeCellsCloud::Style.new folder = $TEMPFOLDER storage = nil - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_post_column_style(name, sheet_name, column_index, { :style=>style, :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_post_column_style(name, sheet_name, column_index, { :style=>style, :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -424,8 +454,10 @@ column = 1 folder = $TEMPFOLDER storage = nil - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_post_copy_cell_into_cell(name, dest_cell_name, sheet_name, worksheet, {:cellname=>cellname, :row=>row, :column=>column, :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_post_copy_cell_into_cell(name, dest_cell_name, sheet_name, worksheet, {:cellname=>cellname, :row=>row, :column=>column, :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -453,8 +485,10 @@ worksheet = $SHEET2 folder = $TEMPFOLDER storage = nil - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_post_copy_worksheet_columns(name, sheet_name, source_column_index, destination_column_index, column_number, { :worksheet=>worksheet,:folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_post_copy_worksheet_columns(name, sheet_name, source_column_index, destination_column_index, column_number, { :worksheet=>worksheet,:folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -482,8 +516,10 @@ worksheet = $SHEET2 folder = $TEMPFOLDER storage = nil - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_post_copy_worksheet_rows(name, sheet_name, source_row_index, destination_row_index, row_number, {:worksheet=>worksheet, :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_post_copy_worksheet_rows(name, sheet_name, source_row_index, destination_row_index, row_number, {:worksheet=>worksheet, :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -509,8 +545,10 @@ hide = true folder = $TEMPFOLDER storage = nil - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_post_group_worksheet_columns(name, sheet_name, first_index, last_index, { :hide=>hide, :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_post_group_worksheet_columns(name, sheet_name, first_index, last_index, { :hide=>hide, :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -536,8 +574,10 @@ hide = true folder = $TEMPFOLDER storage = nil - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_post_group_worksheet_rows(name, sheet_name, first_index, last_index, {:hide=>hide, :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_post_group_worksheet_rows(name, sheet_name, first_index, last_index, {:hide=>hide, :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -561,8 +601,10 @@ total_columns = 2 folder = $TEMPFOLDER storage = nil - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_post_hide_worksheet_columns(name, sheet_name, start_column, total_columns, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_post_hide_worksheet_columns(name, sheet_name, start_column, total_columns, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -586,8 +628,10 @@ total_rows = 2 folder = $TEMPFOLDER storage = nil - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_post_hide_worksheet_rows(name, sheet_name, startrow, total_rows, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_post_hide_worksheet_rows(name, sheet_name, startrow, total_rows, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -611,8 +655,10 @@ style = AsposeCellsCloud::Style.new folder = $TEMPFOLDER storage = nil - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_post_row_style(name, sheet_name, row_index, { :style=>style, :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_post_row_style(name, sheet_name, row_index, { :style=>style, :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -633,8 +679,10 @@ cell_name = $CellName folder = $TEMPFOLDER storage = nil - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_get_cell_html_string(name, sheet_name, cell_name, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_get_cell_html_string(name, sheet_name, cell_name, { :folder=>folder}) + expect(result).not_to be_empty # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -656,8 +704,11 @@ cell_name = $CellName folder = $TEMPFOLDER storage = nil - @instance.cells_post_set_cell_html_string(name, sheet_name, cell_name, { :folder=>folder}) - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) + html_string ="sssssssssssssssssssssss" + # result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + # expect(result.uploaded.size).to be > 0 + result = @instance.cells_post_set_cell_html_string(name, sheet_name, cell_name, html_string, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -683,8 +734,10 @@ type = 'string' folder = $TEMPFOLDER storage = nil - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_post_set_cell_range_value(name, sheet_name, cellarea, value, type, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_post_set_cell_range_value(name, sheet_name, cellarea, value, type, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -708,8 +761,10 @@ width = 10 folder = $TEMPFOLDER storage = nil - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_post_set_worksheet_column_width(name, sheet_name, column_index, width, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_post_set_worksheet_column_width(name, sheet_name, column_index, width, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -733,8 +788,10 @@ last_index = 2 folder = $TEMPFOLDER storage = nil - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_post_ungroup_worksheet_columns(name, sheet_name, first_index, last_index, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_post_ungroup_worksheet_columns(name, sheet_name, first_index, last_index, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -760,8 +817,10 @@ is_all = true folder = $TEMPFOLDER storage = nil - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_post_ungroup_worksheet_rows(name, sheet_name, first_index, last_index, { :is_all=>is_all, :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_post_ungroup_worksheet_rows(name, sheet_name, first_index, last_index, { :is_all=>is_all, :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -787,8 +846,10 @@ width = 10 folder = $TEMPFOLDER storage = nil - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_post_unhide_worksheet_columns(name, sheet_name, startcolumn, total_columns, { :width=>width, :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_post_unhide_worksheet_columns(name, sheet_name, startcolumn, total_columns, { :width=>width, :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -814,8 +875,10 @@ height = 10 folder = $TEMPFOLDER storage = nil - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_post_unhide_worksheet_rows(name, sheet_name, startrow, total_rows, {:height=>height, :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_post_unhide_worksheet_rows(name, sheet_name, startrow, total_rows, {:height=>height, :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -839,8 +902,10 @@ style = AsposeCellsCloud::Style.new folder = $TEMPFOLDER storage = nil - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_post_update_worksheet_cell_style(name, sheet_name, cell_name,{ :style=>style, :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_post_update_worksheet_cell_style(name, sheet_name, cell_name,{ :style=>style, :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -864,8 +929,10 @@ style = AsposeCellsCloud::Style.new folder = $TEMPFOLDER storage = nil - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_post_update_worksheet_range_style(name, sheet_name, range,{ :style=>style, :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_post_update_worksheet_range_style(name, sheet_name, range,{ :style=>style, :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -889,8 +956,10 @@ height = 10 folder = $TEMPFOLDER storage = nil - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_post_update_worksheet_row(name, sheet_name, row_index, { :height=>height,:folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_post_update_worksheet_row(name, sheet_name, row_index, { :height=>height,:folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -918,8 +987,10 @@ formula = nil folder = $TEMPFOLDER storage = nil - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_post_worksheet_cell_set_value(name, sheet_name, cell_name, {:value=>value, :type=>type, :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_post_worksheet_cell_set_value(name, sheet_name, cell_name, {:value=>value, :type=>type, :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -947,8 +1018,10 @@ total_columns = 2 folder = $TEMPFOLDER storage = nil - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_post_worksheet_merge(name, sheet_name, start_row, start_column, total_rows, total_columns, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_post_worksheet_merge(name, sheet_name, start_row, start_column, total_rows, total_columns, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -976,8 +1049,10 @@ total_columns = 2 folder = $TEMPFOLDER storage = nil - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_post_worksheet_unmerge(name, sheet_name, start_row, start_column, total_rows, total_columns, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_post_worksheet_unmerge(name, sheet_name, start_row, start_column, total_rows, total_columns, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -1003,8 +1078,10 @@ update_reference = true folder = $TEMPFOLDER storage = nil - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_put_insert_worksheet_columns(name, sheet_name, column_index, columns, {:update_reference=>update_reference, :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_put_insert_worksheet_columns(name, sheet_name, column_index, columns, {:update_reference=>update_reference, :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -1026,8 +1103,10 @@ row_index = 100 folder = $TEMPFOLDER storage = nil - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_put_insert_worksheet_row(name, sheet_name, row_index, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_put_insert_worksheet_row(name, sheet_name, row_index, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -1053,8 +1132,10 @@ update_reference = true folder = $TEMPFOLDER storage = nil - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_put_insert_worksheet_rows(name, sheet_name, startrow, { :total_rows=>total_rows, :update_reference=>update_reference, :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_put_insert_worksheet_rows(name, sheet_name, startrow, { :total_rows=>total_rows, :update_reference=>update_reference, :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end diff --git a/spec/api/cells_auto_filter_api_spec.rb b/spec/api/cells_auto_filter_api_spec.rb index e3a84ff..9846c05 100644 --- a/spec/api/cells_auto_filter_api_spec.rb +++ b/spec/api/cells_auto_filter_api_spec.rb @@ -1,14 +1,3 @@ -=begin -#Web API Swagger specification - -#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) - -OpenAPI spec version: 1.0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.3.0-SNAPSHOT - -=end require 'spec_helper' require 'json' @@ -18,7 +7,7 @@ # Please update as you see appropriate describe 'CellsAutoFilterApi' do before do - @instance = AsposeCellsCloud::CellsApi.new("66164C51-693E-4904-A121-545961673EC1","536e76768419db9585afdd37bb5f7533") + @instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,"v3.0") end after do @@ -39,8 +28,10 @@ name = $BOOK1 sheet_name = $SHEET1 folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_auto_filter_get_worksheet_auto_filter(name, sheet_name, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_auto_filter_get_worksheet_auto_filter(name, sheet_name, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -59,8 +50,10 @@ name = $BOOK1 sheet_name = $SHEET1 folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_auto_filter_post_worksheet_auto_filter_refresh(name, sheet_name, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_auto_filter_post_worksheet_auto_filter_refresh(name, sheet_name, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -81,8 +74,10 @@ sheet_name = $SHEET1 field_index = 0 folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_auto_filter_post_worksheet_match_blanks(name, sheet_name, field_index, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_auto_filter_post_worksheet_match_blanks(name, sheet_name, field_index, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -103,8 +98,10 @@ sheet_name = $SHEET1 field_index = 0 folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_auto_filter_post_worksheet_match_non_blanks(name, sheet_name, field_index, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_auto_filter_post_worksheet_match_non_blanks(name, sheet_name, field_index, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -135,8 +132,10 @@ match_blanks = true refresh = true folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_auto_filter_put_worksheet_color_filter(name, sheet_name, range, field_index, { :color_filter=>color_filter, :match_blanks=>match_blanks, :refresh=>refresh,:folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_auto_filter_put_worksheet_color_filter(name, sheet_name, range, field_index, { :color_filter=>color_filter, :match_blanks=>match_blanks, :refresh=>refresh,:folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -173,8 +172,10 @@ match_blanks = true refresh = true folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_auto_filter_put_worksheet_custom_filter(name, sheet_name, range, field_index, operator_type1, criteria1, {:is_and=>is_and, :operator_type2=>operator_type2, :criteria2=>criteria2, :match_blanks=>match_blanks, :refresh=>refresh, :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_auto_filter_put_worksheet_custom_filter(name, sheet_name, range, field_index, operator_type1, criteria1, {:is_and=>is_and, :operator_type2=>operator_type2, :criteria2=>criteria2, :match_blanks=>match_blanks, :refresh=>refresh, :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -215,8 +216,10 @@ match_blanks = true refresh = true folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_auto_filter_put_worksheet_date_filter(name, sheet_name, range, field_index, date_time_grouping_type, {:year=>year, :month=>month, :day=>day, :hour=>hour, :minute=>minute, :second=>second, :match_blanks=>match_blanks, :refresh=>refresh, :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_auto_filter_put_worksheet_date_filter(name, sheet_name, range, field_index, date_time_grouping_type, {:year=>year, :month=>month, :day=>day, :hour=>hour, :minute=>minute, :second=>second, :match_blanks=>match_blanks, :refresh=>refresh, :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -245,9 +248,10 @@ match_blanks = true refresh = true folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_auto_filter_put_worksheet_dynamic_filter(name, sheet_name, range, field_index, dynamic_filter_type, {:match_blanks=>match_blanks, :refresh=>refresh, :folder=>folder}) - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_auto_filter_put_worksheet_dynamic_filter(name, sheet_name, range, field_index, dynamic_filter_type, {:match_blanks=>match_blanks, :refresh=>refresh, :folder=>folder}) + expect(result.code).to eql(200)# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -275,8 +279,10 @@ match_blanks = true refresh = true folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_auto_filter_put_worksheet_filter(name, sheet_name, range, field_index, criteria, {:match_blanks=>match_blanks, :refresh=>refresh, :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_auto_filter_put_worksheet_filter(name, sheet_name, range, field_index, criteria, {:match_blanks=>match_blanks, :refresh=>refresh, :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -309,8 +315,10 @@ match_blanks = true refresh = true folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_auto_filter_put_worksheet_filter_top10(name, sheet_name, range, field_index, is_top, is_percent, item_count, {:match_blanks=>match_blanks, :refresh=>refresh, :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_auto_filter_put_worksheet_filter_top10(name, sheet_name, range, field_index, is_top, is_percent, item_count, {:match_blanks=>match_blanks, :refresh=>refresh, :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -341,8 +349,10 @@ match_blanks = true refresh = true folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_auto_filter_put_worksheet_icon_filter(name, sheet_name, range, field_index, icon_set_type, icon_id, {:match_blanks=>match_blanks, :refresh=>refresh, :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_auto_filter_put_worksheet_icon_filter(name, sheet_name, range, field_index, icon_set_type, icon_id, {:match_blanks=>match_blanks, :refresh=>refresh, :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -376,8 +386,10 @@ minute = 1 second = 1 folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_auto_filter_delete_worksheet_date_filter(name, sheet_name, field_index, date_time_grouping_type, {:year=>year, :month=>month, :day=>day, :hour=>hour, :minute=>minute, :second=>second, :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_auto_filter_delete_worksheet_date_filter(name, sheet_name, field_index, date_time_grouping_type, {:year=>year, :month=>month, :day=>day, :hour=>hour, :minute=>minute, :second=>second, :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -400,8 +412,10 @@ field_index = 1 criteria = 'test' folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_auto_filter_delete_worksheet_filter(name, sheet_name, field_index, {:criteria=>criteria, :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_auto_filter_delete_worksheet_filter(name, sheet_name, field_index, {:criteria=>criteria, :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end diff --git a/spec/api/cells_autoshapes_api_spec.rb b/spec/api/cells_autoshapes_api_spec.rb index ebb836a..34d3c4f 100644 --- a/spec/api/cells_autoshapes_api_spec.rb +++ b/spec/api/cells_autoshapes_api_spec.rb @@ -1,14 +1,3 @@ -=begin -#Web API Swagger specification - -#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) - -OpenAPI spec version: 1.0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.3.0-SNAPSHOT - -=end require 'spec_helper' require 'json' @@ -18,7 +7,7 @@ # Please update as you see appropriate describe 'CellsAutoshapesApi' do before do - @instance = AsposeCellsCloud::CellsApi.new("66164C51-693E-4904-A121-545961673EC1","536e76768419db9585afdd37bb5f7533") + @instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,"v3.0") end after do @@ -44,8 +33,10 @@ autoshape_number = 4 format = 'PNG' folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_autoshapes_get_worksheet_autoshape(name, sheet_name, autoshape_number, { :format=>format,:folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_autoshapes_get_worksheet_autoshape(name, sheet_name, autoshape_number, { :format=>format,:folder=>folder}) + # expect(result.code).not_to be_empty # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -64,8 +55,10 @@ name = $MYDOC sheet_name = $SHEET1 folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_autoshapes_get_worksheet_autoshapes(name, sheet_name, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_autoshapes_get_worksheet_autoshapes(name, sheet_name, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end diff --git a/spec/api/cells_chart_area_api_spec.rb b/spec/api/cells_chart_area_api_spec.rb index f8510c0..d8c4b8b 100644 --- a/spec/api/cells_chart_area_api_spec.rb +++ b/spec/api/cells_chart_area_api_spec.rb @@ -1,14 +1,4 @@ -=begin -#Web API Swagger specification -#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) - -OpenAPI spec version: 1.0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.3.0-SNAPSHOT - -=end require 'spec_helper' require 'json' @@ -18,7 +8,7 @@ # Please update as you see appropriate describe 'CellsChartAreaApi' do before do - @instance = AsposeCellsCloud::CellsApi.new("66164C51-693E-4904-A121-545961673EC1","536e76768419db9585afdd37bb5f7533") + @instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,"v3.0") end after do @@ -43,8 +33,9 @@ sheet_name = $SHEET3 chart_index = 0 folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_chart_area_get_chart_area(name, sheet_name, chart_index, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_chart_area_get_chart_area(name, sheet_name, chart_index, { :folder=>folder}) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -65,8 +56,10 @@ sheet_name = $SHEET3 chart_index = 0 folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_chart_area_get_chart_area_border(name, sheet_name, chart_index, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_chart_area_get_chart_area_border(name, sheet_name, chart_index, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -87,8 +80,10 @@ sheet_name = $SHEET3 chart_index = 0 folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_chart_area_get_chart_area_fill_format(name, sheet_name, chart_index, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_chart_area_get_chart_area_fill_format(name, sheet_name, chart_index, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end diff --git a/spec/api/cells_charts_api_spec.rb b/spec/api/cells_charts_api_spec.rb index 5128f1b..c2afffb 100644 --- a/spec/api/cells_charts_api_spec.rb +++ b/spec/api/cells_charts_api_spec.rb @@ -18,7 +18,7 @@ # Please update as you see appropriate describe 'CellsChartsApi' do before do - @instance = AsposeCellsCloud::CellsApi.new("66164C51-693E-4904-A121-545961673EC1","536e76768419db9585afdd37bb5f7533") + @instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,"v3.0") end after do @@ -43,8 +43,10 @@ sheet_name = $SHEET3 chart_index = 0 folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_charts_delete_worksheet_chart_legend(name, sheet_name, chart_index, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_charts_delete_worksheet_chart_legend(name, sheet_name, chart_index, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -68,8 +70,10 @@ chart_number = 0 format = 'PNG' folder = $TEMPFOLDER - - @instance.cells_charts_get_worksheet_chart(name, sheet_name, chart_number, {:format=>format, :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_charts_get_worksheet_chart(name, sheet_name, chart_number, {:format=>format, :folder=>folder}) + # expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -90,8 +94,10 @@ sheet_name = $SHEET3 chart_index = 0 folder = $TEMPFOLDER - - @instance.cells_charts_get_worksheet_chart_legend(name, sheet_name, chart_index, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_charts_get_worksheet_chart_legend(name, sheet_name, chart_index, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -112,8 +118,10 @@ sheet_name = $SHEET3 chart_index = 0 folder = $TEMPFOLDER - - @instance.cells_charts_get_worksheet_chart_title(name, sheet_name, chart_index, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_charts_get_worksheet_chart_title(name, sheet_name, chart_index, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -132,8 +140,10 @@ name = $MYDOC sheet_name = $SHEET3 folder = $TEMPFOLDER - - @instance.cells_charts_get_worksheet_charts(name, sheet_name, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_charts_get_worksheet_charts(name, sheet_name, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -156,8 +166,10 @@ chart_index = 0 chart = AsposeCellsCloud::Chart.new folder = $TEMPFOLDER - - @instance.cells_charts_post_worksheet_chart(name, sheet_name, chart_index, { :chart=>chart,:folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_charts_post_worksheet_chart(name, sheet_name, chart_index, { :chart=>chart,:folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -180,8 +192,10 @@ chart_index = 0 legend = AsposeCellsCloud::Legend.new folder = $TEMPFOLDER - - @instance.cells_charts_post_worksheet_chart_legend(name, sheet_name, chart_index, { :legend=>legend, :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_charts_post_worksheet_chart_legend(name, sheet_name, chart_index, { :legend=>legend, :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -204,8 +218,10 @@ chart_index = 0 title = AsposeCellsCloud::Title.new folder = $TEMPFOLDER - - @instance.cells_charts_post_worksheet_chart_title(name, sheet_name, chart_index, { :title=>title, :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_charts_post_worksheet_chart_title(name, sheet_name, chart_index, { :title=>title, :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -244,8 +260,10 @@ is_auto_get_serial_name = nil title = nil folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_charts_put_worksheet_add_chart(name, sheet_name, chart_type, { :upper_left_row=>upper_left_row, :upper_left_column=>upper_left_column, :lower_right_row=>lower_right_row, :lower_right_column=>lower_right_column, :area=>area, :is_vertical=>is_vertical, :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = result = @instance.cells_charts_put_worksheet_add_chart(name, sheet_name, chart_type, { :upper_left_row=>upper_left_row, :upper_left_column=>upper_left_column, :lower_right_row=>lower_right_row, :lower_right_column=>lower_right_column, :area=>area, :is_vertical=>is_vertical, :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -266,8 +284,9 @@ sheet_name = $SHEET3 chart_index = 0 folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_charts_put_worksheet_chart_legend(name, sheet_name, chart_index, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_charts_put_worksheet_chart_legend(name, sheet_name, chart_index, { :folder=>folder}) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -290,8 +309,10 @@ chart_index = 0 title = AsposeCellsCloud::Title.new folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_charts_put_worksheet_chart_title(name, sheet_name, chart_index, {:title=>title, :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_charts_put_worksheet_chart_title(name, sheet_name, chart_index, {:title=>title, :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -311,8 +332,10 @@ sheet_name = $SHEET3 chart_index = 0 folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_charts_delete_worksheet_chart_title(name, sheet_name, chart_index, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_charts_delete_worksheet_chart_title(name, sheet_name, chart_index, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -333,8 +356,10 @@ sheet_name = $SHEET3 chart_index = 0 folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_charts_delete_worksheet_delete_chart(name, sheet_name, chart_index, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_charts_delete_worksheet_delete_chart(name, sheet_name, chart_index, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -353,8 +378,10 @@ name = $MYDOC sheet_name = $SHEET3 folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_charts_delete_worksheet_clear_charts(name, sheet_name, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_charts_delete_worksheet_clear_charts(name, sheet_name, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end diff --git a/spec/api/cells_conditional_formattings_api_spec.rb b/spec/api/cells_conditional_formattings_api_spec.rb index 9c6994e..888c7b7 100644 --- a/spec/api/cells_conditional_formattings_api_spec.rb +++ b/spec/api/cells_conditional_formattings_api_spec.rb @@ -1,14 +1,3 @@ -=begin -#Web API Swagger specification - -#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) - -OpenAPI spec version: 1.0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.3.0-SNAPSHOT - -=end require 'spec_helper' require 'json' @@ -18,7 +7,7 @@ # Please update as you see appropriate describe 'CellsConditionalFormattingsApi' do before do - @instance = AsposeCellsCloud::CellsApi.new("66164C51-693E-4904-A121-545961673EC1","536e76768419db9585afdd37bb5f7533") + @instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,"v3.0") end after do @@ -42,8 +31,10 @@ sheet_name = $SHEET1 index = 0 folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_conditional_formattings_get_worksheet_conditional_formatting(name, sheet_name, index, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_conditional_formattings_get_worksheet_conditional_formatting(name, sheet_name, index, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -62,8 +53,10 @@ name = $BOOK1 sheet_name = $SHEET1 folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_conditional_formattings_get_worksheet_conditional_formattings(name, sheet_name, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_conditional_formattings_get_worksheet_conditional_formattings(name, sheet_name, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -86,8 +79,10 @@ cell_area = $CELLAREA formatcondition = AsposeCellsCloud::FormatCondition.new({:'Type'=> 'CellValue', :'Operator'=>'Between',:'Formula1'=>'v1',:'Formula2'=>'v1'}) folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_conditional_formattings_put_worksheet_conditional_formatting(name, sheet_name, cell_area, {:formatcondition=>formatcondition, :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_conditional_formattings_put_worksheet_conditional_formatting(name, sheet_name, cell_area, {:format_condition=>formatcondition, :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -118,8 +113,10 @@ formula1 = 'v1' formula2 = 'v2' folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_conditional_formattings_put_worksheet_format_condition(name, sheet_name, index, cell_area, type, operator_type, formula1, formula2, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_conditional_formattings_put_worksheet_format_condition(name, sheet_name, index, cell_area, type, operator_type, formula1, formula2, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -142,8 +139,10 @@ index = 0 cell_area = $CELLAREA folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_conditional_formattings_put_worksheet_format_condition_area(name, sheet_name, index, cell_area, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_conditional_formattings_put_worksheet_format_condition_area(name, sheet_name, index, cell_area, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -172,8 +171,10 @@ formula1 = 'v1' formula2 = 'v2' folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_conditional_formattings_put_worksheet_format_condition_condition(name, sheet_name, index, type, operator_type, formula1, formula2, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_conditional_formattings_put_worksheet_format_condition_condition(name, sheet_name, index, type, operator_type, formula1, formula2, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -193,8 +194,10 @@ sheet_name = $SHEET1 index = 0 folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_conditional_formattings_delete_worksheet_conditional_formatting(name, sheet_name, index, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_conditional_formattings_delete_worksheet_conditional_formatting(name, sheet_name, index, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -221,8 +224,10 @@ total_rows = 4 total_columns = 6 folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_conditional_formattings_delete_worksheet_conditional_formatting_area(name, sheet_name, start_row, start_column, total_rows, total_columns, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result =@instance.cells_conditional_formattings_delete_worksheet_conditional_formatting_area(name, sheet_name, start_row, start_column, total_rows, total_columns, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -241,8 +246,10 @@ name = $BOOK1 sheet_name = $SHEET1 folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_conditional_formattings_delete_worksheet_conditional_formattings(name, sheet_name, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_conditional_formattings_delete_worksheet_conditional_formattings(name, sheet_name, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end diff --git a/spec/api/cells_hypelinks_api_spec.rb b/spec/api/cells_hypelinks_api_spec.rb index 31d36eb..ac686f6 100644 --- a/spec/api/cells_hypelinks_api_spec.rb +++ b/spec/api/cells_hypelinks_api_spec.rb @@ -1,14 +1,3 @@ -=begin -#Web API Swagger specification - -#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) - -OpenAPI spec version: 1.0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.3.0-SNAPSHOT - -=end require 'spec_helper' require 'json' @@ -18,7 +7,7 @@ # Please update as you see appropriate describe 'CellsHypelinksApi' do before do - @instance = AsposeCellsCloud::CellsApi.new("66164C51-693E-4904-A121-545961673EC1","536e76768419db9585afdd37bb5f7533") + @instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,"v3.0") end after do @@ -41,8 +30,10 @@ sheet_name = $SHEET1 hyperlink_index = 0 folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_hypelinks_get_worksheet_hyperlink(name, sheet_name, hyperlink_index, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_hypelinks_get_worksheet_hyperlink(name, sheet_name, hyperlink_index, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -61,8 +52,10 @@ name = $BOOK1 sheet_name = $SHEET1 folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_hypelinks_get_worksheet_hyperlinks(name, sheet_name, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_hypelinks_get_worksheet_hyperlinks(name, sheet_name, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -85,8 +78,10 @@ hyperlink_index = 0 hyperlink = AsposeCellsCloud::Hyperlink.new({:Address=>'www.aspose.com'}) folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_hypelinks_post_worksheet_hyperlink(name, sheet_name, hyperlink_index, { :hyperlink=>hyperlink, :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_hypelinks_post_worksheet_hyperlink(name, sheet_name, hyperlink_index, { :hyperlink=>hyperlink, :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -115,8 +110,10 @@ total_columns = 2 address = 'www.aspose.com' folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_hypelinks_put_worksheet_hyperlink(name, sheet_name, first_row, first_column, total_rows, total_columns, address, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_hypelinks_put_worksheet_hyperlink(name, sheet_name, first_row, first_column, total_rows, total_columns, address, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -138,7 +135,10 @@ hyperlink_index = 0 folder = $TEMPFOLDER - @instance.cells_hypelinks_delete_worksheet_hyperlink(name, sheet_name, hyperlink_index, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_hypelinks_delete_worksheet_hyperlink(name, sheet_name, hyperlink_index, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -158,7 +158,10 @@ sheet_name = $SHEET1 folder = $TEMPFOLDER - @instance.cells_hypelinks_delete_worksheet_hyperlinks(name, sheet_name, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_hypelinks_delete_worksheet_hyperlinks(name, sheet_name, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end diff --git a/spec/api/cells_list_objects_api_spec.rb b/spec/api/cells_list_objects_api_spec.rb index e6f9488..0710503 100644 --- a/spec/api/cells_list_objects_api_spec.rb +++ b/spec/api/cells_list_objects_api_spec.rb @@ -1,14 +1,3 @@ -=begin -#Web API Swagger specification - -#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) - -OpenAPI spec version: 1.0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.3.0-SNAPSHOT - -=end require 'spec_helper' require 'json' @@ -18,7 +7,7 @@ # Please update as you see appropriate describe 'CellsListObjectsApi' do before do - @instance = AsposeCellsCloud::CellsApi.new("66164C51-693E-4904-A121-545961673EC1","536e76768419db9585afdd37bb5f7533") + @instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,"v3.0") end after do @@ -42,8 +31,9 @@ sheet_name = $SHEET7 listobjectindex = 0 folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_list_objects_get_worksheet_list_object(name, sheet_name, listobjectindex, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_list_objects_get_worksheet_list_object(name, sheet_name, listobjectindex, { :folder=>folder}) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -62,8 +52,10 @@ name = $BOOK1 sheet_name = $SHEET7 folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_list_objects_get_worksheet_list_objects(name, sheet_name, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_list_objects_get_worksheet_list_objects(name, sheet_name, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -87,7 +79,10 @@ list_object = AsposeCellsCloud::ListObject.new({ :'StartRow'=>1}) folder = $TEMPFOLDER - @instance.cells_list_objects_post_worksheet_list_object(name, sheet_name, list_object_index, { :list_object=>list_object, :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_list_objects_post_worksheet_list_object(name, sheet_name, list_object_index, { :list_object=>list_object, :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -132,8 +127,10 @@ list_object_index = 0 data_sorter = AsposeCellsCloud::DataSorter.new({:'CaseSensitive'=>true}) folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_list_objects_post_worksheet_list_object_sort_table(name, sheet_name, list_object_index, {:data_sorter=>data_sorter, :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_list_objects_post_worksheet_list_object_sort_table(name, sheet_name, list_object_index, {:data_sorter=>data_sorter, :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -158,8 +155,10 @@ destsheet_name = $SHEET7 request = AsposeCellsCloud::CreatePivotTableRequest.new({:DestCellName=>'C1',:Name=>'testp',:PivotFieldColumns=>[2],:PivotFieldData=>[1],:PivotFieldRows=>[0],:SourceData=>'=Sheet2!A1:E8',:UseSameSource=>true}) folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_list_objects_post_worksheet_list_object_summarize_with_pivot_table(name, sheet_name, list_object_index, destsheet_name, {:request=>request, :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_list_objects_post_worksheet_list_object_summarize_with_pivot_table(name, sheet_name, list_object_index, destsheet_name, {:request=>request, :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -187,9 +186,11 @@ end_row = 6 end_column = 6 folder = $TEMPFOLDER - has_headers = true - @instance.cells_list_objects_put_worksheet_list_object(name, sheet_name, start_row, start_column, end_row, end_column, { :folder=>folder, :has_headers=>has_headers}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_list_objects_put_worksheet_list_object(name, sheet_name, start_row, start_column, end_row, end_column, { :folder=>folder, :has_headers=>has_headers}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -210,8 +211,10 @@ sheet_name = $SHEET7 list_object_index = 0 folder = $TEMPFOLDER - - @instance.cells_list_objects_delete_worksheet_list_object(name, sheet_name, list_object_index, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_list_objects_delete_worksheet_list_object(name, sheet_name, list_object_index, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -230,8 +233,10 @@ name = $BOOK1 sheet_name = $SHEET7 folder = $TEMPFOLDER - - @instance.cells_list_objects_delete_worksheet_list_objects(name, sheet_name, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_list_objects_delete_worksheet_list_objects(name, sheet_name, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end diff --git a/spec/api/cells_ole_objects_api_spec.rb b/spec/api/cells_ole_objects_api_spec.rb index b28854e..9da2c53 100644 --- a/spec/api/cells_ole_objects_api_spec.rb +++ b/spec/api/cells_ole_objects_api_spec.rb @@ -1,14 +1,4 @@ -=begin -#Web API Swagger specification -#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) - -OpenAPI spec version: 1.0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.3.0-SNAPSHOT - -=end require 'spec_helper' require 'json' @@ -18,7 +8,7 @@ # Please update as you see appropriate describe 'CellsOleObjectsApi' do before do - @instance = AsposeCellsCloud::CellsApi.new("66164C51-693E-4904-A121-545961673EC1","536e76768419db9585afdd37bb5f7533") + @instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,"v3.0") end after do # run after each test @@ -43,8 +33,10 @@ object_number = 0 format = 'PNG' folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_ole_objects_get_worksheet_ole_object(name, sheet_name, object_number, {:format=>format, :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_ole_objects_get_worksheet_ole_object(name, sheet_name, object_number, {:format=>format, :folder=>folder}) + # expect(result).not_to be_empty # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -63,8 +55,10 @@ name = $BOOK1 sheet_name = $SHEET6 folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_ole_objects_get_worksheet_ole_objects(name, sheet_name, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_ole_objects_get_worksheet_ole_objects(name, sheet_name, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -87,8 +81,10 @@ ole_object_index = 0 ole = AsposeCellsCloud::OleObject.new({:Left=>10,:Right=>10,:Height=>100,:Width=>90}) folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_ole_objects_post_update_worksheet_ole_object(name, sheet_name, ole_object_index, { :ole=>ole,:folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_ole_objects_post_update_worksheet_ole_object(name, sheet_name, ole_object_index, { :ole=>ole,:folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -121,8 +117,10 @@ ole_file = 'OLEDoc.docx' image_file = 'word.jpg' folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_ole_objects_put_worksheet_ole_object(name, sheet_name, { :ole_object=>ole_object, :upper_left_row=>upper_left_row, :upper_left_column=>upper_left_column, :height=>height, :width=>width, :ole_file=>ole_file, :image_file=>image_file,:folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_ole_objects_put_worksheet_ole_object(name, sheet_name, { :ole_object=>ole_object, :upper_left_row=>upper_left_row, :upper_left_column=>upper_left_column, :height=>height, :width=>width, :ole_file=>ole_file, :image_file=>image_file,:folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -143,8 +141,10 @@ sheet_name = $SHEET6 ole_object_index = 0 folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_ole_objects_delete_worksheet_ole_object(name, sheet_name, ole_object_index, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_ole_objects_delete_worksheet_ole_object(name, sheet_name, ole_object_index, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -163,8 +163,10 @@ name = $BOOK1 sheet_name = $SHEET6 folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_ole_objects_delete_worksheet_ole_objects(name, sheet_name, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_ole_objects_delete_worksheet_ole_objects(name, sheet_name, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end diff --git a/spec/api/cells_page_breaks_api_spec.rb b/spec/api/cells_page_breaks_api_spec.rb index 27eff83..037757d 100644 --- a/spec/api/cells_page_breaks_api_spec.rb +++ b/spec/api/cells_page_breaks_api_spec.rb @@ -1,14 +1,3 @@ -=begin -#Web API Swagger specification - -#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) - -OpenAPI spec version: 1.0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.3.0-SNAPSHOT - -=end require 'spec_helper' require 'json' @@ -18,7 +7,7 @@ # Please update as you see appropriate describe 'CellsPageBreaksApi' do before do - @instance = AsposeCellsCloud::CellsApi.new("66164C51-693E-4904-A121-545961673EC1","536e76768419db9585afdd37bb5f7533") + @instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,"v3.0") end after do # run after each test @@ -40,8 +29,10 @@ sheet_name = $SHEET1 index = 0 folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_page_breaks_get_horizontal_page_break(name, sheet_name, index, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_page_breaks_get_horizontal_page_break(name, sheet_name, index, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -60,8 +51,10 @@ name = $BOOK1 sheet_name = $SHEET1 folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_page_breaks_get_horizontal_page_breaks(name, sheet_name, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_page_breaks_get_horizontal_page_breaks(name, sheet_name, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -82,8 +75,10 @@ sheet_name = $SHEET1 index = 0 folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_page_breaks_get_vertical_page_break(name, sheet_name, index, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_page_breaks_get_vertical_page_break(name, sheet_name, index, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -102,8 +97,10 @@ name = $BOOK1 sheet_name = $SHEET1 folder = $TEMPFOLDER - - @instance.cells_page_breaks_get_vertical_page_breaks(name, sheet_name, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_page_breaks_get_vertical_page_breaks(name, sheet_name, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -132,8 +129,10 @@ start_column = 1 end_column = 1 folder = $TEMPFOLDER - - @instance.cells_page_breaks_put_horizontal_page_break(name, sheet_name, { :cellname=>cellname, :row=>row, :column=>column, :start_column=>start_column, :end_column=>end_column, :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_page_breaks_put_horizontal_page_break(name, sheet_name, { :cellname=>cellname, :row=>row, :column=>column, :start_column=>start_column, :end_column=>end_column, :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -162,8 +161,10 @@ start_row = 1 end_row = 1 folder = $TEMPFOLDER - - @instance.cells_page_breaks_put_vertical_page_break(name, sheet_name, {:cellname=>cellname, :column=>column, :row=>row, :start_row=>start_row, :end_row=>end_row, :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_page_breaks_put_vertical_page_break(name, sheet_name, {:cellname=>cellname, :column=>column, :row=>row, :start_row=>start_row, :end_row=>end_row, :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -184,8 +185,10 @@ sheet_name = $SHEET1 index = 0 folder = $TEMPFOLDER - - @instance.cells_page_breaks_delete_horizontal_page_break(name, sheet_name, index, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_page_breaks_delete_horizontal_page_break(name, sheet_name, index, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -206,8 +209,10 @@ sheet_name = $SHEET1 row = 1 folder = $TEMPFOLDER - - @instance.cells_page_breaks_delete_horizontal_page_breaks(name, sheet_name, { :row=>row,:folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_page_breaks_delete_horizontal_page_breaks(name, sheet_name, { :row=>row,:folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -228,8 +233,10 @@ sheet_name = $SHEET1 index = 0 folder = $TEMPFOLDER - - @instance.cells_page_breaks_delete_vertical_page_break(name, sheet_name, index, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_page_breaks_delete_vertical_page_break(name, sheet_name, index, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -250,8 +257,10 @@ sheet_name = $SHEET1 column = 1 folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_page_breaks_delete_vertical_page_breaks(name, sheet_name, { :column=>column,:folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_page_breaks_delete_vertical_page_breaks(name, sheet_name, { :column=>column,:folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end diff --git a/spec/api/cells_page_setup_api_spec.rb b/spec/api/cells_page_setup_api_spec.rb index 63fe519..1bde173 100644 --- a/spec/api/cells_page_setup_api_spec.rb +++ b/spec/api/cells_page_setup_api_spec.rb @@ -18,7 +18,7 @@ # Please update as you see appropriate describe 'CellsPageSetupApi' do before do - @instance = AsposeCellsCloud::CellsApi.new("66164C51-693E-4904-A121-545961673EC1","536e76768419db9585afdd37bb5f7533") + @instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,"v3.0") end after do # run after each test @@ -40,8 +40,10 @@ name = $BOOK1 sheet_name = $SHEET1 folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_page_setup_delete_header_footer(name, sheet_name, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_page_setup_delete_header_footer(name, sheet_name, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -60,8 +62,10 @@ name = $BOOK1 sheet_name = $SHEET1 folder = $TEMPFOLDER - - @instance.cells_page_setup_get_footer(name, sheet_name, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_page_setup_get_footer(name, sheet_name, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -80,8 +84,10 @@ name = $BOOK1 sheet_name = $SHEET1 folder = $TEMPFOLDER - - @instance.cells_page_setup_get_header(name, sheet_name, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_page_setup_get_header(name, sheet_name, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -100,8 +106,10 @@ name = $BOOK1 sheet_name = $SHEET1 folder = $TEMPFOLDER - - @instance.cells_page_setup_get_page_setup(name, sheet_name, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_page_setup_get_page_setup(name, sheet_name, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -126,8 +134,10 @@ script = 'test' is_first_page = true folder = $TEMPFOLDER - - @instance.cells_page_setup_post_footer(name, sheet_name, section, script, is_first_page, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_page_setup_post_footer(name, sheet_name, section, script, is_first_page, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -152,8 +162,10 @@ script = 'tret' is_first_page = true folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_page_setup_post_header(name, sheet_name, section, script, is_first_page, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_page_setup_post_header(name, sheet_name, section, script, is_first_page, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -174,8 +186,10 @@ sheet_name = $SHEET1 page_setup = AsposeCellsCloud::PageSetup.new folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_page_setup_post_page_setup(name, sheet_name, {:page_setup=>page_setup, :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_page_setup_post_page_setup(name, sheet_name, {:page_setup=>page_setup, :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end diff --git a/spec/api/cells_pictures_api_spec.rb b/spec/api/cells_pictures_api_spec.rb index 469a13a..7d8f8e8 100644 --- a/spec/api/cells_pictures_api_spec.rb +++ b/spec/api/cells_pictures_api_spec.rb @@ -1,15 +1,3 @@ -=begin -#Web API Swagger specification - -#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) - -OpenAPI spec version: 1.0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.3.0-SNAPSHOT - -=end - require 'spec_helper' require 'json' @@ -18,7 +6,7 @@ # Please update as you see appropriate describe 'CellsPicturesApi' do before do - @instance = AsposeCellsCloud::CellsApi.new("66164C51-693E-4904-A121-545961673EC1","536e76768419db9585afdd37bb5f7533") + @instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,"v3.0") end after do @@ -45,8 +33,10 @@ picture_index = 0 format = 'PNG' folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_pictures_get_worksheet_picture(name, sheet_name, picture_index, {:format=>format, :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_pictures_get_worksheet_picture(name, sheet_name, picture_index, {:format=>format, :folder=>folder}) + # expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -65,8 +55,10 @@ name = $BOOK1 sheet_name = $SHEET6 folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_pictures_get_worksheet_pictures(name, sheet_name, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_pictures_get_worksheet_pictures(name, sheet_name, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -89,8 +81,10 @@ picture_index = 0 picture = AsposeCellsCloud::Picture.new(:AlternativeText=>'AlternativeText') folder = $TEMPFOLDER - - @instance.cells_pictures_post_worksheet_picture(name, sheet_name, picture_index, {:picture=>picture, :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_pictures_post_worksheet_picture(name, sheet_name, picture_index, {:picture=>picture, :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -121,8 +115,10 @@ lower_right_column = 10 picture_path = 'WaterMark.png' folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_pictures_put_worksheet_add_picture(name, sheet_name, {:picture=>picture, :upper_left_row=>upper_left_row, :upper_left_column=>upper_left_column, :lower_right_row=>lower_right_row, :lower_right_column=>lower_right_column, :picture_path=>picture_path, :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_pictures_put_worksheet_add_picture(name, sheet_name, {:picture=>picture, :upper_left_row=>upper_left_row, :upper_left_column=>upper_left_column, :lower_right_row=>lower_right_row, :lower_right_column=>lower_right_column, :picture_path=>picture_path, :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -143,8 +139,10 @@ sheet_name = $SHEET6 picture_index = 0 folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_pictures_delete_worksheet_picture(name, sheet_name, picture_index, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_pictures_delete_worksheet_picture(name, sheet_name, picture_index, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -163,8 +161,10 @@ name = $BOOK1 sheet_name = $SHEET6 folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_pictures_delete_worksheet_pictures(name, sheet_name, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_pictures_delete_worksheet_pictures(name, sheet_name, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end diff --git a/spec/api/cells_pivot_tables_api_spec.rb b/spec/api/cells_pivot_tables_api_spec.rb index e3715f7..5432db3 100644 --- a/spec/api/cells_pivot_tables_api_spec.rb +++ b/spec/api/cells_pivot_tables_api_spec.rb @@ -1,14 +1,3 @@ -=begin -#Web API Swagger specification - -#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) - -OpenAPI spec version: 1.0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.3.0-SNAPSHOT - -=end require 'spec_helper' require 'json' @@ -18,7 +7,7 @@ # Please update as you see appropriate describe 'CellsPivotTablesApi' do before do - @instance = AsposeCellsCloud::CellsApi.new("66164C51-693E-4904-A121-545961673EC1","536e76768419db9585afdd37bb5f7533") + @instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,"v3.0") end after do @@ -46,8 +35,10 @@ pivot_field_index = 0 pivot_field_type = 'row' folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_pivot_tables_get_pivot_table_field(name, sheet_name, pivot_table_index, pivot_field_index, pivot_field_type, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_pivot_tables_get_pivot_table_field(name, sheet_name, pivot_table_index, pivot_field_index, pivot_field_type, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -68,8 +59,10 @@ sheet_name = $SHEET4 pivottable_index = 0 folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_pivot_tables_get_worksheet_pivot_table(name, sheet_name, pivottable_index, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_pivot_tables_get_worksheet_pivot_table(name, sheet_name, pivottable_index, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -90,8 +83,10 @@ sheet_name = $SHEET4 pivot_table_index = 0 folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_pivot_tables_get_worksheet_pivot_table_filters(name, sheet_name, pivot_table_index, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_pivot_tables_get_worksheet_pivot_table_filters(name, sheet_name, pivot_table_index, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -110,8 +105,10 @@ name = $PivTestFile sheet_name = $SHEET4 folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_pivot_tables_get_worksheet_pivot_tables(name, sheet_name, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_pivot_tables_get_worksheet_pivot_tables(name, sheet_name, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -140,8 +137,10 @@ style = AsposeCellsCloud::Style.new({:Custom=>'p'}) need_re_calculate = true folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_pivot_tables_post_pivot_table_cell_style(name, sheet_name, pivot_table_index, column, row, {:style=>style, :need_re_calculate=>need_re_calculate, :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_pivot_tables_post_pivot_table_cell_style(name, sheet_name, pivot_table_index, column, row, {:style=>style, :need_re_calculate=>need_re_calculate, :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -172,8 +171,10 @@ is_hide = true need_re_calculate = true folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_pivot_tables_post_pivot_table_field_hide_item(name, sheet_name, pivot_table_index, pivot_field_type, field_index, item_index, is_hide, { :need_re_calculate=>need_re_calculate,:folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_pivot_tables_post_pivot_table_field_hide_item(name, sheet_name, pivot_table_index, pivot_field_type, field_index, item_index, is_hide, { :need_re_calculate=>need_re_calculate,:folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -200,8 +201,10 @@ from = 'Row' to = 'Column' folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_pivot_tables_post_pivot_table_field_move_to(name, sheet_name, pivot_table_index, field_index, from, to, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_pivot_tables_post_pivot_table_field_move_to(name, sheet_name, pivot_table_index, field_index, from, to, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -226,8 +229,10 @@ style = AsposeCellsCloud::Style.new({:Custom=>'p'}) need_re_calculate = true folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_pivot_tables_post_pivot_table_style(name, sheet_name, pivot_table_index, { :style=>style, :need_re_calculate=>need_re_calculate,:folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_pivot_tables_post_pivot_table_style(name, sheet_name, pivot_table_index, { :style=>style, :need_re_calculate=>need_re_calculate,:folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -248,8 +253,10 @@ sheet_name = $SHEET4 pivot_table_index = 0 folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_pivot_tables_post_worksheet_pivot_table_calculate(name, sheet_name, pivot_table_index, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_pivot_tables_post_worksheet_pivot_table_calculate(name, sheet_name, pivot_table_index, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -276,8 +283,10 @@ column = 1 dest_cell_name = 'C10' folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_pivot_tables_post_worksheet_pivot_table_move(name, sheet_name, pivot_table_index, { :row=>row, :column=>column, :dest_cell_name=>dest_cell_name, :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_pivot_tables_post_worksheet_pivot_table_move(name, sheet_name, pivot_table_index, { :row=>row, :column=>column, :dest_cell_name=>dest_cell_name, :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -304,8 +313,10 @@ request = AsposeCellsCloud::PivotTableFieldRequest.new({:Data=>[1]}) need_re_calculate = nil folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_pivot_tables_put_pivot_table_field(name, sheet_name, pivot_table_index, pivot_field_type, {:request=>request, :need_re_calculate=>need_re_calculate, :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_pivot_tables_put_pivot_table_field(name, sheet_name, pivot_table_index, pivot_field_type, {:request=>request, :need_re_calculate=>need_re_calculate, :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -330,12 +341,14 @@ sheet_name = $SHEET4 request = AsposeCellsCloud::CreatePivotTableRequest.new({:Name=>'TestPivot',:DestCellName=>'C1',:SourceData =>'Sheet1!C6:E13',:UseSameSource=>true}) folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 source_data = 'Sheet1!C6:E13' dest_cell_name = 'C1' table_name = 'TestPivot' use_same_source = true - @instance.cells_pivot_tables_put_worksheet_pivot_table(name, sheet_name, { :folder=>folder, :source_data=>source_data, :dest_cell_name=>dest_cell_name, :table_name=>table_name, :use_same_source=>use_same_source}) + result = @instance.cells_pivot_tables_put_worksheet_pivot_table(name, sheet_name, { :folder=>folder, :source_data=>source_data, :dest_cell_name=>dest_cell_name, :table_name=>table_name, :use_same_source=>use_same_source}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -364,9 +377,12 @@ need_re_calculate = true folder = $TEMPFOLDER filter_index =0 - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_pivot_tables_put_worksheet_pivot_table_filter(name, sheet_name, pivot_table_index, { :filter=>filter, :need_re_calculate=>need_re_calculate, :folder=>folder}) - @instance.cells_pivot_tables_get_worksheet_pivot_table_filter(name, sheet_name, pivot_table_index, filter_index, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_pivot_tables_put_worksheet_pivot_table_filter(name, sheet_name, pivot_table_index, { :filter=>filter, :need_re_calculate=>need_re_calculate, :folder=>folder}) + expect(result.code).to eql(200) + result = @instance.cells_pivot_tables_get_worksheet_pivot_table_filter(name, sheet_name, pivot_table_index, filter_index, { :folder=>folder}) + expect(result.code).to eql(200) end end @@ -390,8 +406,10 @@ pivot_field_type = 'Row' request = AsposeCellsCloud::PivotTableFieldRequest.new({:Data=>[1]}) folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_pivot_tables_delete_pivot_table_field(name, sheet_name, pivot_table_index, pivot_field_type, { :request=>request,:folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_pivot_tables_delete_pivot_table_field(name, sheet_name, pivot_table_index, pivot_field_type, { :request=>request,:folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -412,8 +430,10 @@ sheet_name = $SHEET4 pivot_table_index = 0 folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_pivot_tables_delete_worksheet_pivot_table(name, sheet_name, pivot_table_index, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_pivot_tables_delete_worksheet_pivot_table(name, sheet_name, pivot_table_index, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -438,8 +458,10 @@ field_index = 0 need_re_calculate = true folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_pivot_tables_delete_worksheet_pivot_table_filter(name, sheet_name, pivot_table_index, field_index, {:need_re_calculate=>need_re_calculate, :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_pivot_tables_delete_worksheet_pivot_table_filter(name, sheet_name, pivot_table_index, field_index, {:need_re_calculate=>need_re_calculate, :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -462,8 +484,10 @@ pivot_table_index = 0 need_re_calculate = true folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_pivot_tables_delete_worksheet_pivot_table_filters(name, sheet_name, pivot_table_index, {:need_re_calculate=>need_re_calculate, :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_pivot_tables_delete_worksheet_pivot_table_filters(name, sheet_name, pivot_table_index, {:need_re_calculate=>need_re_calculate, :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -482,8 +506,10 @@ name = $PivTestFile sheet_name = $SHEET4 folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_pivot_tables_delete_worksheet_pivot_tables(name, sheet_name, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_pivot_tables_delete_worksheet_pivot_tables(name, sheet_name, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end diff --git a/spec/api/cells_properties_api_spec.rb b/spec/api/cells_properties_api_spec.rb index bcab381..0c87ae2 100644 --- a/spec/api/cells_properties_api_spec.rb +++ b/spec/api/cells_properties_api_spec.rb @@ -1,14 +1,4 @@ -=begin -#Web API Swagger specification -#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) - -OpenAPI spec version: 1.0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.3.0-SNAPSHOT - -=end require 'spec_helper' require 'json' @@ -18,7 +8,7 @@ # Please update as you see appropriate describe 'CellsPropertiesApi' do before do - @instance = AsposeCellsCloud::CellsApi.new("66164C51-693E-4904-A121-545961673EC1","536e76768419db9585afdd37bb5f7533") + @instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,"v3.0") end after do @@ -39,8 +29,10 @@ it "should work" do name = $BOOK1 folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_properties_delete_document_properties(name, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_properties_delete_document_properties(name, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -59,8 +51,10 @@ name = $BOOK1 property_name = 'Author' folder = $TEMPFOLDER - - @instance.cells_properties_delete_document_property(name, property_name, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_properties_delete_document_property(name, property_name, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -77,8 +71,10 @@ it "should work" do name = $BOOK1 folder = $TEMPFOLDER - - @instance.cells_properties_get_document_properties(name, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_properties_get_document_properties(name, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -97,8 +93,10 @@ name = $BOOK1 property_name = 'Author' folder = $TEMPFOLDER - - @instance.cells_properties_get_document_property(name, property_name, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_properties_get_document_property(name, property_name, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -119,8 +117,10 @@ property_name = 'Author' property = AsposeCellsCloud::CellsDocumentProperty.new({:Name=>'Author',:Value=>'roy'}) folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_properties_put_document_property(name, property_name, { :property=>property, :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_properties_put_document_property(name, property_name, { :property=>property, :folder=>folder}) + expect(result.code).to eql(201) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end diff --git a/spec/api/cells_ranges_api_spec.rb b/spec/api/cells_ranges_api_spec.rb index a642126..2340e20 100644 --- a/spec/api/cells_ranges_api_spec.rb +++ b/spec/api/cells_ranges_api_spec.rb @@ -1,14 +1,4 @@ -=begin -#Web API Swagger specification -#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) - -OpenAPI spec version: 1.0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.3.0-SNAPSHOT - -=end require 'spec_helper' require 'json' @@ -18,7 +8,7 @@ # Please update as you see appropriate describe 'CellsRangesApi' do before do - @instance = AsposeCellsCloud::CellsApi.new("66164C51-693E-4904-A121-545961673EC1","536e76768419db9585afdd37bb5f7533") + @instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,"v3.0") end after do @@ -50,8 +40,10 @@ row_count = 3 column_count = 2 folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_ranges_get_worksheet_cells_range_value(name, sheet_name, { :namerange=>namerange, :first_row=>first_row, :first_column=>first_column, :row_count=>row_count, :column_count=>column_count,:folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_ranges_get_worksheet_cells_range_value(name, sheet_name, { :namerange=>namerange, :first_row=>first_row, :first_column=>first_column, :row_count=>row_count, :column_count=>column_count,:folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -74,8 +66,10 @@ value = 10.01 range = AsposeCellsCloud::Range.new({:ColumnCount=>1,:ColumnWidth=>10.01,:FirstColumn=>1,:FirstRow=>1,:RowCount=>10}) folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_ranges_post_worksheet_cells_range_column_width(name, sheet_name, value, {:range=>range,:folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_ranges_post_worksheet_cells_range_column_width(name, sheet_name, value, {:range=>range,:folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -96,8 +90,10 @@ sheet_name = $SHEET1 range = AsposeCellsCloud::Range.new({:ColumnCount=>1,:ColumnWidth=>10.01,:FirstColumn=>1,:FirstRow=>1,:RowCount=>10}) folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_ranges_post_worksheet_cells_range_merge(name, sheet_name, { :range=>range, :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_ranges_post_worksheet_cells_range_merge(name, sheet_name, { :range=>range, :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -122,8 +118,10 @@ dest_column = 1 range = AsposeCellsCloud::Range.new({:ColumnCount=>1,:ColumnWidth=>10.01,:FirstColumn=>1,:FirstRow=>1,:RowCount=>10}) folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_ranges_post_worksheet_cells_range_move_to(name, sheet_name, dest_row, dest_column, { :range=>range, :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_ranges_post_worksheet_cells_range_move_to(name, sheet_name, dest_row, dest_column, { :range=>range, :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -146,8 +144,10 @@ range = AsposeCellsCloud::Range.new({:ColumnCount=>1,:FirstColumn=>1,:FirstRow=>1,:RowCount=>10}) range_operate = AsposeCellsCloud::RangeSetOutlineBorderRequest.new({:borderEdge=>'LeftBorder',:borderStyle=>'Dotted',:borderColor=>color,:Range=>range }) folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_ranges_post_worksheet_cells_range_outline_border(name, sheet_name, { :range_operate=>range_operate, :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_ranges_post_worksheet_cells_range_outline_border(name, sheet_name, { :range_operate=>range_operate, :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -170,8 +170,10 @@ value = 10.01 range = AsposeCellsCloud::Range.new({:ColumnCount=>1,:ColumnWidth=>10.01,:FirstColumn=>1,:FirstRow=>1,:RowCount=>10}) folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_ranges_post_worksheet_cells_range_row_height(name, sheet_name, value, { :range=>range, :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_ranges_post_worksheet_cells_range_row_height(name, sheet_name, value, { :range=>range, :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -192,8 +194,10 @@ sheet_name = $SHEET1 range_operate = AsposeCellsCloud::RangeSetStyleRequest.new({:Range=>AsposeCellsCloud::Range.new({:ColumnCount=>1,:FirstColumn=>1,:FirstRow=>1,:RowCount=>10} ), :Style=>AsposeCellsCloud::Style.new()}) folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_ranges_post_worksheet_cells_range_style(name, sheet_name, {:range_operate=>range_operate, :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_ranges_post_worksheet_cells_range_style(name, sheet_name, {:range_operate=>range_operate, :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -214,8 +218,10 @@ sheet_name = $SHEET1 range = AsposeCellsCloud::Range.new({:ColumnCount=>1,:ColumnWidth=>10.01,:FirstColumn=>1,:FirstRow=>1,:RowCount=>10}) folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_ranges_post_worksheet_cells_range_unmerge(name, sheet_name, {:range=>range, :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_ranges_post_worksheet_cells_range_unmerge(name, sheet_name, {:range=>range, :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -242,8 +248,10 @@ is_converted = true set_style = true folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_ranges_post_worksheet_cells_range_value(name, sheet_name, value, {:range=>range, :is_converted=>is_converted, :set_style=>set_style, :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_ranges_post_worksheet_cells_range_value(name, sheet_name, value, {:range=>range, :is_converted=>is_converted, :set_style=>set_style, :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -264,8 +272,10 @@ sheet_name = $SHEET1 range_operate = AsposeCellsCloud::RangeCopyRequest.new({:Operate=>'copydata',:PasteOptions=>AsposeCellsCloud::PasteOptions.new({:OnlyVisibleCells=>true}),:Source=>AsposeCellsCloud::Range.new({:ColumnCount=>1,:FirstColumn=>1,:FirstRow=>1,:RowCount=>10}),:Target=>AsposeCellsCloud::Range.new({:ColumnCount=>1,:FirstColumn=>11,:FirstRow=>11,:RowCount=>10})}) folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_ranges_post_worksheet_cells_ranges(name, sheet_name, { :range_operate=>range_operate , :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_ranges_post_worksheet_cells_ranges(name, sheet_name, { :range_operate=>range_operate , :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end diff --git a/spec/api/cells_save_as_api_spec.rb b/spec/api/cells_save_as_api_spec.rb index 044ad30..45aa61a 100644 --- a/spec/api/cells_save_as_api_spec.rb +++ b/spec/api/cells_save_as_api_spec.rb @@ -1,14 +1,3 @@ -=begin -#Web API Swagger specification - -#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) - -OpenAPI spec version: 1.0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.3.0-SNAPSHOT - -=end require 'spec_helper' require 'json' @@ -18,7 +7,7 @@ # Please update as you see appropriate describe 'CellsSaveAsApi' do before do - @instance = AsposeCellsCloud::CellsApi.new("66164C51-693E-4904-A121-545961673EC1","536e76768419db9585afdd37bb5f7533") + @instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,"v3.0") end after do @@ -46,8 +35,10 @@ is_auto_fit_rows = true is_auto_fit_columns = true folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_save_as_post_document_save_as(name, { :save_options=>save_options, :newfilename=>newfilename, :is_auto_fit_rows=>is_auto_fit_rows, :is_auto_fit_columns=>is_auto_fit_columns, :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_save_as_post_document_save_as(name, { :save_options=>save_options, :newfilename=>newfilename, :is_auto_fit_rows=>is_auto_fit_rows, :is_auto_fit_columns=>is_auto_fit_columns, :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -72,8 +63,10 @@ is_auto_fit_rows = true is_auto_fit_columns = true folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_save_as_post_document_save_as(name, { :save_options=>save_options, :newfilename=>newfilename, :is_auto_fit_rows=>is_auto_fit_rows, :is_auto_fit_columns=>is_auto_fit_columns, :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_save_as_post_document_save_as(name, { :save_options=>save_options, :newfilename=>newfilename, :is_auto_fit_rows=>is_auto_fit_rows, :is_auto_fit_columns=>is_auto_fit_columns, :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end diff --git a/spec/api/cells_shapes_api_spec.rb b/spec/api/cells_shapes_api_spec.rb index 5a84735..7d60e2a 100644 --- a/spec/api/cells_shapes_api_spec.rb +++ b/spec/api/cells_shapes_api_spec.rb @@ -1,14 +1,4 @@ -=begin -#Web API Swagger specification -#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) - -OpenAPI spec version: 1.0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.3.0-SNAPSHOT - -=end require 'spec_helper' require 'json' @@ -18,7 +8,7 @@ # Please update as you see appropriate describe 'CellsShapesApi' do before do - @instance = AsposeCellsCloud::CellsApi.new("66164C51-693E-4904-A121-545961673EC1","536e76768419db9585afdd37bb5f7533") + @instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,"v3.0") end after do @@ -42,8 +32,10 @@ sheet_name = $SHEET1 shapeindex = 0 folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_shapes_get_worksheet_shape(name, sheet_name, shapeindex, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_shapes_get_worksheet_shape(name, sheet_name, shapeindex, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -62,8 +54,10 @@ name = $BOOK1 sheet_name = $SHEET1 folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_shapes_get_worksheet_shapes(name, sheet_name, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_shapes_get_worksheet_shapes(name, sheet_name, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -86,8 +80,10 @@ shapeindex = 0 dto = AsposeCellsCloud::Shape.new({:Name=>'postShape'}) folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_shapes_post_worksheet_shape(name, sheet_name, shapeindex, { :dto=>dto, :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_shapes_post_worksheet_shape(name, sheet_name, shapeindex, { :dto=>dto, :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -120,8 +116,10 @@ width = 100 height = 80 folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_shapes_put_worksheet_shape(name, sheet_name, drawing_type, upper_left_row, upper_left_column, top, left, width, height, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_shapes_put_worksheet_shape(name, sheet_name, drawing_type, upper_left_row, upper_left_column, top, left, width, height, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -142,8 +140,10 @@ sheet_name = $SHEET1 shapeindex = 0 folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_shapes_delete_worksheet_shape(name, sheet_name, shapeindex, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_shapes_delete_worksheet_shape(name, sheet_name, shapeindex, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -162,8 +162,10 @@ name = $BOOK1 sheet_name = $SHEET1 folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_shapes_delete_worksheet_shapes(name, sheet_name, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_shapes_delete_worksheet_shapes(name, sheet_name, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end diff --git a/spec/api/cells_simple_spec.rb b/spec/api/cells_simple_spec.rb new file mode 100644 index 0000000..f169159 --- /dev/null +++ b/spec/api/cells_simple_spec.rb @@ -0,0 +1,43 @@ +=begin +#Web API Swagger specification + +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: 1.0 + +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.3.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' + +# Unit tests for AsposeCellsCloud::CellsApi +# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Please update as you see appropriate +describe 'CellsApi' do + before do + @instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,"v3.0") + end + + after do + # run after each test + end + + describe 'cells_unit test' do + it "should work" do + name = $BOOK1 + sheet_name = $SHEET1 + cell_area = $CELLAREA + formatcondition = AsposeCellsCloud::FormatCondition.new({:'Type'=> 'CellValue', :'Operator'=>'Between',:'Formula1'=>'v1',:'Formula2'=>'v1'}) + folder = $TEMPFOLDER + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_conditional_formattings_put_worksheet_conditional_formatting(name, sheet_name, cell_area, {:format_condition=>formatcondition, :folder=>folder}) + expect(result.code).to eql(200) + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end +end + diff --git a/spec/api/cells_storage_api_spec.rb b/spec/api/cells_storage_api_spec.rb new file mode 100644 index 0000000..f50ef89 --- /dev/null +++ b/spec/api/cells_storage_api_spec.rb @@ -0,0 +1,68 @@ +=begin +#Web API Swagger specification + +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: 1.0 + +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.3.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'base64' + +# Unit tests for AsposeCellsCloud::CellsTaskApi +# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Please update as you see appropriate +describe 'CellsTaskApi' do + before do + @instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,"v3.0") + end + + after do + # run after each test + end + + + # unit tests for cells_copy + # Run tasks + # + # @param task_data + # @param [Hash] opts the optional parameters + # @return [Object] + describe 'cells_storage_op test' do + it "should work" do + name ="ReportData.xml" + folder = $TEMPFOLDER +# stream = File.read("/home/roywang/asposecellscloudsdk/data/" << name) +# @instance.object_exists(name) +# @instance.storage_exists("Default App"); +# filename = folder +"/" + name +# aFile = File.new("/home/roywang/asposecellscloudsdk/data/" +name , 'rb') +# stream = aFile.sysread(aFile.size) +# aFile.close +# binary_file = File.open("/home/roywang/asposecellscloudsdk/data/" +name, "rb") +# data = [ +# [ "import[sync]","false" ], +# [ "import[name]", stream, { filename: "Book1.xlsx"} ] +# ] +# stream = File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) } + @instance.upload_file( "Temp/ReportData.xml", ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) +# @instance.copy_file(name , folder +"/1"+ name) +# @instance.copy_folder(folder, folder + "2"); +# @instance.move_folder(folder+ "2", folder + "3"); +# @instance.delete_folder("Temp3"); +# @instance.create_folder("Temp1"); +# @instance.delete_folder(folder + "1"); +# @instance.download_file( folder +"/"+ name) +# @instance.delete_file("Temp/book1updata.xlsx") +# @instance.get_files_list(folder ); +# @instance.move_file(folder + "\\1" + name, folder + "\\2" + name); + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/api/cells_storage_spec.rb b/spec/api/cells_storage_spec.rb new file mode 100644 index 0000000..bef5acd --- /dev/null +++ b/spec/api/cells_storage_spec.rb @@ -0,0 +1,52 @@ +require 'spec_helper' +require 'json' + +# Unit tests for AsposeCellsCloud::CellsApi +# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Please update as you see appropriate +describe 'CellsApi' do + before do + @instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,"v3.0") + end + + after do + # run after each test + end + + +# unit tests for cells_workbook_put_convert_workbook + # Convert workbook from request content to some format. + # + # @param [Hash] opts the optional parameters + # @option opts [String] :format The format to convert. + # @option opts [String] :password The workbook password. + # @option opts [String] :out_path Path to save result + # @return [File] + describe 'cells_workbook_put_convert_workbook test' do + it "should work" do + format = 'pdf' + password = nil + out_path = "Tdd.pdf" + name = $BOOK1 + folder = $TEMPFOLDER + @instance.create_folder("ruby") + @instance.copy_folder("ruby","ruby1") + @instance.delete_folder("ruby") + @instance.move_folder("ruby1","ruby") + @instance.upload_file( "ruby/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) + @instance.copy_file("ruby/"+name,"ruby/1"+name) + @instance.delete_file("ruby/"+name) + @instance.move_file("ruby/1"+name,"ruby/"+name) + @instance.download_file("ruby/"+name) +# @instance.delete_file("ruby/"+name) +# @instance.delete_folder("ruby") + + + #@instance.cells_workbook_put_convert_workbook(::File.open("/home/roywang/asposecellscloudsdk/data/Book1.xlsx","r") {|io| io.read(io.size) },{:format=>format,out_path=>out_path}) + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + + + end diff --git a/spec/api/cells_task_api_spec.rb b/spec/api/cells_task_api_spec.rb index 2b7b623..bc0138c 100644 --- a/spec/api/cells_task_api_spec.rb +++ b/spec/api/cells_task_api_spec.rb @@ -1,14 +1,4 @@ -=begin -#Web API Swagger specification -#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) - -OpenAPI spec version: 1.0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.3.0-SNAPSHOT - -=end require 'spec_helper' require 'json' @@ -18,7 +8,7 @@ # Please update as you see appropriate describe 'CellsTaskApi' do before do - @instance = AsposeCellsCloud::CellsApi.new("66164C51-693E-4904-A121-545961673EC1","536e76768419db9585afdd37bb5f7533") + @instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,"v3.0") end after do @@ -60,7 +50,9 @@ param1 = AsposeCellsCloud::SplitWorkbookTaskParameter.new({:DestinationFileFormat=>'xlsx' ,:DestinationFilePosition=> AsposeCellsCloud::FileSource.new({:FilePath=>$TEMPFOLDER,:FileSourceType=>'CloudFileSystem'}),:SplitNameRule=>'sheetname',:Workbook=>AsposeCellsCloud::FileSource.new({:FilePath=>$TEMPFOLDER +'\\' + $BOOK1,:FileSourceType=>'CloudFileSystem'})}) task1 =AsposeCellsCloud::TaskDescription.new({:TaskType=>'SplitWorkbook',:TaskParameter=>param1}) task_data = AsposeCellsCloud::TaskData.new(:Tasks=>[task1]) - @instance.cells_task_post_run_task(task_data) + result = @instance.cells_task_post_run_task(task_data) + + expect(result).not_to be_empty # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end diff --git a/spec/api/cells_workbook_api_spec.rb b/spec/api/cells_workbook_api_spec.rb index 8fef6f7..8c3fb48 100644 --- a/spec/api/cells_workbook_api_spec.rb +++ b/spec/api/cells_workbook_api_spec.rb @@ -1,14 +1,4 @@ -=begin -#Web API Swagger specification -#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) - -OpenAPI spec version: 1.0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.3.0-SNAPSHOT - -=end require 'spec_helper' require 'json' @@ -18,7 +8,7 @@ # Please update as you see appropriate describe 'CellsWorkbookApi' do before do - @instance = AsposeCellsCloud::CellsApi.new("66164C51-693E-4904-A121-545961673EC1","536e76768419db9585afdd37bb5f7533") + @instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,"v3.0") end after do @@ -48,9 +38,11 @@ is_auto_fit = true only_save_table = true folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) out_path = nil - @instance.cells_workbook_get_workbook(name, { :password=>password, :format=>format,:folder=>folder, :out_path=>out_path}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_workbook_get_workbook(name, { :password=>password, :format=>format,:folder=>folder, :out_path=>out_path}) + # expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -76,9 +68,11 @@ is_auto_fit = true only_save_table = true folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) out_path = nil - @instance.cells_workbook_get_workbook(name, { :password=>password, :format=>format,:folder=>folder, :out_path=>out_path}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_workbook_get_workbook(name, { :password=>password, :format=>format,:folder=>folder, :out_path=>out_path}) + # expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -95,8 +89,10 @@ it "should work" do name = $BOOK1 folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_workbook_get_workbook_default_style(name, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_workbook_get_workbook_default_style(name, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -115,8 +111,10 @@ name = $BOOK1 name_name = 'Name_2' folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_workbook_get_workbook_name(name, name_name, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_workbook_get_workbook_name(name, name_name, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -135,8 +133,10 @@ name = $BOOK1 name_name = 'Name_2' folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_workbook_get_workbook_name_value(name, name_name, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_workbook_get_workbook_name_value(name, name_name, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -153,8 +153,10 @@ it "should work" do name = $BOOK1 folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_workbook_get_workbook_names(name, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_workbook_get_workbook_names(name, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -171,8 +173,10 @@ it "should work" do name = $BOOK1 folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_workbook_get_workbook_settings(name, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_workbook_get_workbook_settings(name, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -189,8 +193,10 @@ it "should work" do name = $BOOK1 folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_workbook_get_workbook_text_items(name, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_workbook_get_workbook_text_items(name, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -215,8 +221,10 @@ end_row = 100 only_auto = true folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_workbook_post_autofit_workbook_rows(name, {:auto_fitter_options=>auto_fitter_options, :start_row=>start_row, :end_row=>end_row, :only_auto=>only_auto, :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_workbook_post_autofit_workbook_rows(name, {:auto_fitter_options=>auto_fitter_options, :start_row=>start_row, :end_row=>end_row, :only_auto=>only_auto, :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -236,8 +244,10 @@ name = $BOOK1 importdata = AsposeCellsCloud::ImportIntArrayOption.new({:DestinationWorksheet=>$SHEET1,:FirstColumn=>1,:FirstRow=>3,:ImportDataType=>'IntArray',:IsVertical=>true,:Data=>[1,2,3,4]}) folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_workbook_post_import_data(name, importdata, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_workbook_post_import_data(name, importdata, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -259,8 +269,10 @@ options = AsposeCellsCloud::CalculationOptions.new({:IgnoreError=>true}) ignore_error = true folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_workbook_post_workbook_calculate_formula(name, { :options=>options, :ignore_error=>ignore_error,:folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_workbook_post_workbook_calculate_formula(name, { :options=>options, :ignore_error=>ignore_error,:folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -280,9 +292,11 @@ name = $BOOK1 xml_file = 'ReportData.xml' folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) out_path = nil - @instance.cells_workbook_post_workbook_get_smart_marker_result(name, { :xml_file=>xml_file,:folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_workbook_post_workbook_get_smart_marker_result(name, { :xml_file=>xml_file,:folder=>folder}) + # expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -301,8 +315,10 @@ name = $BOOK1 settings = AsposeCellsCloud::WorkbookSettings.new(:AutoCompressPictures=>true) folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_workbook_post_workbook_settings(name, {:settings=>settings, :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_workbook_post_workbook_settings(name, {:settings=>settings, :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -329,8 +345,10 @@ horizontal_resolution = 100 vertical_resolution = 90 folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_workbook_post_workbook_split(name, { :format=>format, :from=>from, :to=>to, :horizontal_resolution=>horizontal_resolution, :vertical_resolution=>vertical_resolution,:folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_workbook_post_workbook_split(name, { :format=>format, :from=>from, :to=>to, :horizontal_resolution=>horizontal_resolution, :vertical_resolution=>vertical_resolution,:folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -349,8 +367,10 @@ name = $BOOK1 merge_with = 'myDocument.xlsx' folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_workbook_post_workbooks_merge(name, merge_with, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_workbook_post_workbooks_merge(name, merge_with, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -371,8 +391,10 @@ old_value = '!22' new_value = '22' folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_workbook_post_workbooks_text_replace(name, old_value, new_value, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_workbook_post_workbooks_text_replace(name, old_value, new_value, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -391,8 +413,10 @@ name = $BOOK1 text = 'test' folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_workbook_post_workbooks_text_search(name, text, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_workbook_post_workbooks_text_search(name, text, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -411,7 +435,8 @@ format = 'pdf' password = nil out_path = "Tdd.pdf" - @instance.cells_workbook_put_convert_workbook(::File.open("/home/roywang/asposecellscloudsdk/data/Book1.xlsx","r") {|io| io.read(io.size) },{:format=>format,out_path=>out_path}) + result = @instance.cells_workbook_put_convert_workbook(::File.open("/home/roywang/asposecellscloudsdk/data/Book1.xlsx","r") {|io| io.read(io.size) },{:format=>format,out_path=>out_path}) + # expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -429,13 +454,16 @@ describe 'cells_workbook_put_workbook_create test' do it "should work" do t = Time.now - name = 'NewBook'+ $BOOK1 + name = Time.now.strftime("%y%m%d%H%M%s") + $BOOK1 template_file = $BOOK1 data_file = 'ReportData.xml' folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+template_file, ::File.open("/home/roywang/asposecellscloudsdk/data/" +template_file,"r") {|io| io.read(io.size) }) - @instance.upload_file(folder+"/"+data_file, ::File.open("/home/roywang/asposecellscloudsdk/data/" +data_file,"r") {|io| io.read(io.size) }) - @instance.cells_workbook_put_workbook_create(name, {:template_file=>folder+"/"+template_file, :data_file=>folder+"/"+data_file, :folder=>folder}) + result = @instance.upload_file( folder+"/"+template_file, ::File.open(File.expand_path("data/"+template_file),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.upload_file(folder+"/"+data_file, ::File.open(File.expand_path("data/"+data_file),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_workbook_put_workbook_create(name, {:template_file=>folder+"/"+template_file, :data_file=>folder+"/"+data_file, :folder=>folder}) + # expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -454,8 +482,10 @@ name = $BOOK1 name_name = 'Name_2' folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_workbook_delete_workbook_name(name, name_name, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_workbook_delete_workbook_name(name, name_name, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -472,8 +502,9 @@ it "should work" do name = $BOOK1 folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_workbook_delete_workbook_names(name, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_workbook_delete_workbook_names(name, { :folder=>folder}) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -492,8 +523,9 @@ name = $BOOK1 password = AsposeCellsCloud::PasswordRequest.new({:Password=>'123456'}) folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_workbook_put_document_protect_from_changes(name, {:password=>password, :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_workbook_put_document_protect_from_changes(name, {:password=>password, :folder=>folder}) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -511,8 +543,9 @@ name = $BOOK1 protection = AsposeCellsCloud::WorkbookProtectionRequest.new(:Password=>'123',:ProtectionType=>'All') folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_workbook_post_protect_document(name, { :protection=>protection, :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_workbook_post_protect_document(name, { :protection=>protection, :folder=>folder}) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -531,8 +564,9 @@ name = $BOOK1 protection = AsposeCellsCloud::WorkbookProtectionRequest.new({:Password=>'123',:ProtectionType=>'All'}) folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_workbook_delete_unprotect_document(name, {:protection=>protection, :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_workbook_delete_unprotect_document(name, {:protection=>protection, :folder=>folder}) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -549,8 +583,10 @@ it "should work" do name = $BOOK1 folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_workbook_delete_document_unprotect_from_changes(name, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result =@instance.cells_workbook_delete_document_unprotect_from_changes(name, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -569,8 +605,10 @@ name = $BOOK1 encryption = AsposeCellsCloud::WorkbookEncryptionRequest.new({:Password=>'123456',:KeyLength=>128,:EncryptionType=>'XOR'}) folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_workbook_post_encrypt_document(name, {:encryption=>encryption, :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result =@instance.cells_workbook_post_encrypt_document(name, {:encryption=>encryption, :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -589,8 +627,10 @@ name = $BOOK1 encryption = AsposeCellsCloud::WorkbookEncryptionRequest.new({:Password=>'123456',:KeyLength=>128,:EncryptionType=>'XOR'}) folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_workbook_delete_decrypt_document(name, { :encryption=>encryption,:folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_workbook_delete_decrypt_document(name, { :encryption=>encryption,:folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end diff --git a/spec/api/cells_worksheet_validations_api_spec.rb b/spec/api/cells_worksheet_validations_api_spec.rb index 350e385..684ef2f 100644 --- a/spec/api/cells_worksheet_validations_api_spec.rb +++ b/spec/api/cells_worksheet_validations_api_spec.rb @@ -1,14 +1,3 @@ -=begin -#Web API Swagger specification - -#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) - -OpenAPI spec version: 1.0 - -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.3.0-SNAPSHOT - -=end require 'spec_helper' require 'json' @@ -18,7 +7,7 @@ # Please update as you see appropriate describe 'CellsWorksheetValidationsApi' do before do - @instance = AsposeCellsCloud::CellsApi.new("66164C51-693E-4904-A121-545961673EC1","536e76768419db9585afdd37bb5f7533") + @instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,"v3.0") end after do @@ -42,8 +31,10 @@ sheet_name = $SHEET1 validation_index = 0 folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_worksheet_validations_get_worksheet_validation(name, sheet_name, validation_index, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_worksheet_validations_get_worksheet_validation(name, sheet_name, validation_index, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -62,8 +53,10 @@ name = $BOOK1 sheet_name = $SHEET1 folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_worksheet_validations_get_worksheet_validations(name, sheet_name, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_worksheet_validations_get_worksheet_validations(name, sheet_name, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -86,8 +79,10 @@ validation_index = 0 validation = AsposeCellsCloud::Validation.new({:IgnoreBlank=>true}) folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_worksheet_validations_post_worksheet_validation(name, sheet_name, validation_index, { :validation=>validation,:folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_worksheet_validations_post_worksheet_validation(name, sheet_name, validation_index, { :validation=>validation,:folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -108,8 +103,10 @@ sheet_name = $SHEET1 validation_index = 0 folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_worksheet_validations_delete_worksheet_validation(name, sheet_name, validation_index, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_worksheet_validations_delete_worksheet_validation(name, sheet_name, validation_index, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -130,8 +127,10 @@ sheet_name = $SHEET1 range = $RANGE folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_worksheet_validations_put_worksheet_validation(name, sheet_name, {:range=>range, :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_worksheet_validations_put_worksheet_validation(name, sheet_name, {:range=>range, :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end diff --git a/spec/api/cells_worksheets_api_spec.rb b/spec/api/cells_worksheets_api_spec.rb index 58eca7c..42a7b0a 100644 --- a/spec/api/cells_worksheets_api_spec.rb +++ b/spec/api/cells_worksheets_api_spec.rb @@ -18,7 +18,7 @@ # Please update as you see appropriate describe 'CellsWorksheetsApi' do before do - @instance = AsposeCellsCloud::CellsApi.new("66164C51-693E-4904-A121-545961673EC1","536e76768419db9585afdd37bb5f7533") + @instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,"v3.0") end after do @@ -44,8 +44,10 @@ png = aFile.sysread(aFile.size) aFile.close folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_worksheets_put_worksheet_background(name, sheet_name, png, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_worksheets_put_worksheet_background(name, sheet_name, png, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -63,8 +65,10 @@ name = $BOOK1 sheet_name = $SHEET1 folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_worksheets_delete_worksheet_background(name, sheet_name, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_worksheets_delete_worksheet_background(name, sheet_name, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -85,8 +89,10 @@ sheet_name = $SHEET1 cell_name = 'C1' folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_worksheets_delete_worksheet_comment(name, sheet_name, cell_name, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_worksheets_delete_worksheet_comment(name, sheet_name, cell_name, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -105,8 +111,9 @@ name = $BOOK1 sheet_name = $SHEET1 folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_worksheets_delete_worksheet_comments(name, sheet_name, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_worksheets_delete_worksheet_comments(name, sheet_name, { :folder=>folder}) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -133,8 +140,9 @@ freezed_rows = 2 freezed_columns = 2 folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_worksheets_delete_worksheet_freeze_panes(name, sheet_name, row, column, freezed_rows, freezed_columns, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_worksheets_delete_worksheet_freeze_panes(name, sheet_name, row, column, freezed_rows, freezed_columns, { :folder=>folder}) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -151,8 +159,10 @@ it "should work" do name = $BOOK1 folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_worksheets_get_named_ranges(name, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_worksheets_get_named_ranges(name, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -177,8 +187,10 @@ vertical_resolution = 100 horizontal_resolution = 90 folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_worksheets_get_worksheet(name, sheet_name, {:format=>format, :vertical_resolution=>vertical_resolution, :horizontal_resolution=>horizontal_resolution, :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_worksheets_get_worksheet(name, sheet_name, {:format=>format, :vertical_resolution=>vertical_resolution, :horizontal_resolution=>horizontal_resolution, :folder=>folder}) + # expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -199,8 +211,10 @@ sheet_name = $SHEET1 formula = '=NOW()' folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_worksheets_get_worksheet_calculate_formula(name, sheet_name, formula, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_worksheets_get_worksheet_calculate_formula(name, sheet_name, formula, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -221,8 +235,10 @@ name = $BOOK1 sheet_name = $SHEET1 folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_worksheets_get_worksheet_comments(name, sheet_name, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_worksheets_get_worksheet_comments(name, sheet_name, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -243,8 +259,10 @@ sheet_name = $SHEET1 merged_cell_index = 1 folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_worksheets_get_worksheet_merged_cell(name, sheet_name, merged_cell_index, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_worksheets_get_worksheet_merged_cell(name, sheet_name, merged_cell_index, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -263,8 +281,10 @@ name = $BOOK1 sheet_name = $SHEET1 folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_worksheets_get_worksheet_merged_cells(name, sheet_name, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_worksheets_get_worksheet_merged_cells(name, sheet_name, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -283,8 +303,10 @@ name = $BOOK1 sheet_name = $SHEET1 folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_worksheets_get_worksheet_text_items(name, sheet_name, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_worksheets_get_worksheet_text_items(name, sheet_name, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -301,8 +323,10 @@ it "should work" do name = $BOOK1 folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_worksheets_get_worksheets(name, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_worksheets_get_worksheets(name, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -331,8 +355,9 @@ first_row = 1 last_row = 10 folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_worksheets_post_autofit_worksheet_columns(name, sheet_name, first_column, last_column, {:auto_fitter_options=>auto_fitter_options, :first_row=>first_row, :last_row=>last_row, :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_worksheets_post_autofit_worksheet_columns(name, sheet_name, first_column, last_column, {:auto_fitter_options=>auto_fitter_options, :first_row=>first_row, :last_row=>last_row, :folder=>folder}) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -359,8 +384,9 @@ last_column = 10 auto_fitter_options = AsposeCellsCloud::AutoFitterOptions.new({:AutoFitMergedCells=>true}) folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_worksheets_post_autofit_worksheet_row(name, sheet_name, row_index, first_column, last_column, { :auto_fitter_options=>auto_fitter_options,:folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_worksheets_post_autofit_worksheet_row(name, sheet_name, row_index, first_column, last_column, { :auto_fitter_options=>auto_fitter_options,:folder=>folder}) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -387,8 +413,9 @@ end_row = 10 only_auto = true folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_worksheets_post_autofit_worksheet_rows(name, sheet_name, {:auto_fitter_options=>auto_fitter_options, :start_row=>start_row, :end_row=>end_row, :only_auto=>only_auto, :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_worksheets_post_autofit_worksheet_rows(name, sheet_name, {:auto_fitter_options=>auto_fitter_options, :start_row=>start_row, :end_row=>end_row, :only_auto=>only_auto, :folder=>folder}) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -415,9 +442,12 @@ source_workbook = $BOOK1 source_folder = $TEMPFOLDER folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.upload_file( folder+"/"+source_workbook, ::File.open("/home/roywang/asposecellscloudsdk/data/" +source_workbook,"r") {|io| io.read(io.size) }) - @instance.cells_worksheets_post_copy_worksheet(name, sheet_name, source_sheet,{ :options=>options, :source_workbook=>source_workbook, :source_folder=>source_folder,:folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.upload_file( folder+"/"+source_workbook, ::File.open(File.expand_path("data/"+source_workbook),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_worksheets_post_copy_worksheet(name, sheet_name, source_sheet,{ :options=>options, :source_workbook=>source_workbook, :source_folder=>source_folder,:folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -438,8 +468,10 @@ sheet_name = $SHEET1 moving = AsposeCellsCloud::WorksheetMovingRequest.new({:DestinationWorksheet=>$SHEET3,:Position=>'after'}) folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_worksheets_post_move_worksheet(name, sheet_name, { :moving=>moving,:folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_worksheets_post_move_worksheet(name, sheet_name, { :moving=>moving,:folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -459,8 +491,10 @@ sheet_name = $SHEET1 value = 1 folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_worksheets_post_update_worksheet_zoom(name, sheet_name, value, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_worksheets_post_update_worksheet_zoom(name, sheet_name, value, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -483,8 +517,10 @@ cell_area = $CELLAREA data_sorter = AsposeCellsCloud::DataSorter.new(:CaseSensitive=>true) folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_worksheets_post_worksheet_range_sort(name, sheet_name, cell_area, {:data_sorter=>data_sorter, :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_worksheets_post_worksheet_range_sort(name, sheet_name, cell_area, {:data_sorter=>data_sorter, :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -505,8 +541,10 @@ sheet_name = $SHEET1 text = '123456' folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_worksheets_post_worksheet_text_search(name, sheet_name, text, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_worksheets_post_worksheet_text_search(name, sheet_name, text, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -529,8 +567,10 @@ old_value = '123' new_value = '123456' folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_worksheets_post_worsheet_text_replace(name, sheet_name, old_value, new_value, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_worksheets_post_worsheet_text_replace(name, sheet_name, old_value, new_value, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -551,8 +591,10 @@ sheet_name = $SHEET1 sheet = AsposeCellsCloud::Worksheet.new({:IsGridlinesVisible=>true}) folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_worksheets_post_update_worksheet_property(name, sheet_name, { :sheet=>sheet,:folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_worksheets_post_update_worksheet_property(name, sheet_name, { :sheet=>sheet,:folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -596,8 +638,9 @@ sheet_name = $SHEET1 cell_name = 'B3' folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_worksheets_get_worksheet_comment(name, sheet_name, cell_name, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_worksheets_get_worksheet_comment(name, sheet_name, cell_name, { :folder=>folder}) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -619,8 +662,10 @@ cell_name = 'B3' comment = AsposeCellsCloud::Comment.new({:Author=>'Roy'}) folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_worksheets_post_worksheet_comment(name, sheet_name, cell_name, {:comment=>comment, :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_worksheets_post_worksheet_comment(name, sheet_name, cell_name, {:comment=>comment, :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -646,8 +691,10 @@ freezed_rows = 10 freezed_columns = 10 folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_worksheets_put_worksheet_freeze_panes(name, sheet_name, row, column, freezed_rows, freezed_columns, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_worksheets_put_worksheet_freeze_panes(name, sheet_name, row, column, freezed_rows, freezed_columns, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -667,8 +714,10 @@ sheet_name = $SHEET1 protect_parameter = AsposeCellsCloud::ProtectSheetParameter.new({:ProtectionType=>'All',:Password=>'123456'}) folder = $TEMPFOLDER - - @instance.cells_worksheets_put_protect_worksheet(name, sheet_name, { :protect_parameter=>protect_parameter,:folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_worksheets_put_protect_worksheet(name, sheet_name, { :protect_parameter=>protect_parameter,:folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -688,8 +737,9 @@ sheet_name = $SHEET1 protect_parameter = AsposeCellsCloud::ProtectSheetParameter.new({:Password=>'123456',:ProtectionType=>'All'}) folder = $TEMPFOLDER - - @instance.cells_worksheets_delete_unprotect_worksheet(name, sheet_name, {:protect_parameter=>protect_parameter, :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_worksheets_delete_unprotect_worksheet(name, sheet_name, {:protect_parameter=>protect_parameter, :folder=>folder}) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -709,8 +759,10 @@ sheet_name = $SHEET1 newname = 'renametest' folder = $TEMPFOLDER - - @instance.cells_worksheets_post_rename_worksheet(name, sheet_name, newname, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_worksheets_post_rename_worksheet(name, sheet_name, newname, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -733,8 +785,10 @@ position = 1 sheettype = 'VB' folder = $TEMPFOLDER - - @instance.cells_worksheets_put_add_new_worksheet(name, sheet_name, {:position=>position, :sheettype=>sheettype, :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_worksheets_put_add_new_worksheet(name, sheet_name, {:position=>position, :sheettype=>sheettype, :folder=>folder}) + expect(result.code).to eql(201) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -755,8 +809,10 @@ sheet_name = $SHEET1 is_visible = true folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_worksheets_put_change_visibility_worksheet(name, sheet_name, is_visible, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_worksheets_put_change_visibility_worksheet(name, sheet_name, is_visible, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end @@ -775,8 +831,10 @@ name = $BOOK1 sheet_name = $SHEET1 folder = $TEMPFOLDER - @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) - @instance.cells_worksheets_delete_worksheet(name, sheet_name, { :folder=>folder}) + result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) + expect(result.uploaded.size).to be > 0 + result = @instance.cells_worksheets_delete_worksheet(name, sheet_name, { :folder=>folder}) + expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end