Skip to content

Commit f92f712

Browse files
committed
Update ruby upload tests for input file
1 parent 03ba1ed commit f92f712

File tree

3 files changed

+20
-10
lines changed

3 files changed

+20
-10
lines changed

composer.lock

Lines changed: 7 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/Ruby30Test.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ class Ruby30Test extends Base
1717
...Base::BAR_RESPONSES,
1818
...Base::GENERAL_RESPONSES,
1919
...Base::LARGE_FILE_RESPONSES,
20+
...Base::LARGE_FILE_RESPONSES,
21+
...Base::LARGE_FILE_RESPONSES,
22+
...Base::LARGE_FILE_RESPONSES,
2023
...Base::EXCEPTION_RESPONSES
2124
];
2225
}

tests/languages/ruby/tests.rb

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,18 @@
4949
response = general.redirect()
5050
puts response["result"]
5151

52-
response = general.upload(x: 'string', y: 123, z:['string in array'], file: './tests/resources/file.png')
52+
response = general.upload(x: 'string', y: 123, z:['string in array'], file: Appwrite::InputFile.fromPath('./tests/resources/file.png'))
5353
puts response.result
5454

55-
response = general.upload(x: 'string', y: 123, z:['string in array'], file: './tests/resources/large_file.mp4')
55+
response = general.upload(x: 'string', y: 123, z:['string in array'], file: Appwrite::InputFile.fromPath('./tests/resources/large_file.mp4'))
56+
puts response.result
57+
58+
data = IO.read('./tests/resources/file.png')
59+
response = general.upload(x: 'string', y: 123, z:['string in array'], file: Appwrite::InputFile.fromBytes(data, filename:'file.png', mime_type: 'image/png'))
60+
puts response.result
61+
62+
data = IO.read('./tests/resources/large_file.mp4')
63+
response = general.upload(x: 'string', y: 123, z:['string in array'], file: Appwrite::InputFile.fromBytes(data, filename:'large_file.mp4', mime_type: 'video/mp4'))
5664
puts response.result
5765

5866
begin

0 commit comments

Comments
 (0)