files.com 1.1.802 → 1.1.803

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 621d25b3b830e30a4474c75326ddebc27f1f1067baa8f3d7e2d2ca7d5b0cbdb8
4
- data.tar.gz: 4e2426393d1242a3c535b2591f0c5f0fbcdc0d9e4d6c352b4e9fbc0d08ae260b
3
+ metadata.gz: 3fde439a751fae76d99298db114c359f6dd675ad51b17d173ebdb8d4be011284
4
+ data.tar.gz: e716632be7616edf7ce3cf7c51ad61325e87d1b093e021e22d45fcb520cb3e8d
5
5
  SHA512:
6
- metadata.gz: d78e2b818d7d370e1931999bcad7d0a38dd5fa8c8a7fb63ee17ae6125cc7e44146b7f62e86748eaef1fe30c50e560664147926fdaf130fa5fdf478c6a5b4afc0
7
- data.tar.gz: 7a9548906e51c2a88f17c5a7429795e388180cb04e09c8eff2f0763bdac5bc412a0f6d57b1aa6cd473431d043e13c038634bf130fc1b0c029f61958373aa0ca4
6
+ metadata.gz: faf8e3363b6ef1e4fb47e0bcdefe86ad0462f15a8bcf4bcdb739f45b0e63fd28f6c1ba4c991ba52cceb4ba73e8d7b35ff35a2fae152377bc9bbd5d400dd66fda
7
+ data.tar.gz: 33dc5267810ce31d2da8dac9142662d279a5f9913baaeac0b1758597ca59fc36c6545178a9914b15f8b5d6bdce1701bebe1a405334bb82409339eb8167df312c
data/_VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.802
1
+ 1.1.803
@@ -1,7 +1,7 @@
1
1
  require "spec_helper"
2
2
  require "tempfile"
3
3
 
4
- RSpec.describe Files::File, :with_test_folder, skip: ENV.fetch("GITLAB", nil) do
4
+ RSpec.describe Files::File, :with_test_folder do
5
5
  describe "#read" do
6
6
  before do
7
7
  Files::File.open(test_folder.join("[[strange stuff]]#yes.text").to_s, 'w', options) do |f|
@@ -17,7 +17,8 @@ RSpec.describe Files::File, :with_test_folder, skip: ENV.fetch("GITLAB", nil) do
17
17
  context "stream failure" do
18
18
  let(:expired_download) { "https://s3.amazonaws.com/objects.brickftp.com/metadata/37868/52f55a21-1685-46aa-aaff-99ca8b172c00?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIEWLY3MN4YGZQOWA%2F20210621%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20210621T202802Z&X-Amz-Expires=60&X-Amz-SignedHeaders=host&response-cache-control=no-cache%2C%20no-store&response-content-disposition=attachment%3B%20filename%3D%22write-as-io.txt%22&response-content-type=text%2Fplain&X-Amz-Signature=83d5b5789cbd2282bfea6e560e4319385135204dc0df3217930f96905c9cb18f" }
19
19
 
20
- it "waits for io to be ready" do
20
+ # The download URL is a real, expired S3 URL outside the simulator, so CI never requests it.
21
+ it "waits for io to be ready", skip: ENV.fetch("GITLAB", nil) do
21
22
  file = Files::File.new
22
23
  allow(file).to receive(:download_uri_with_load).and_return(expired_download)
23
24
  expect { file.read_io }.to raise_error('403 "Forbidden"')
@@ -40,10 +41,10 @@ RSpec.describe Files::File, :with_test_folder, skip: ENV.fetch("GITLAB", nil) do
40
41
  end
41
42
 
42
43
  it "works for file with zero bytes" do
43
- file = Files::File.open("zero-byte.txt", 'w', options)
44
+ file = Files::File.open(test_folder.join("zero-byte.txt").to_s, 'w', options)
44
45
  file.write("")
45
46
  file.close
46
- file = Files::File.find("zero-byte.txt", {}, options)
47
+ file = Files::File.find(test_folder.join("zero-byte.txt").to_s, {}, options)
47
48
  expect(file.read_io.read).to eq("")
48
49
  end
49
50
  end
@@ -83,7 +84,8 @@ RSpec.describe Files::File, :with_test_folder, skip: ENV.fetch("GITLAB", nil) do
83
84
  temp_file.close
84
85
  end
85
86
 
86
- it "will send with_rename" do
87
+ # The simulator answers with_rename with 501 (simulation/not-supported), so CI leaves this probe out.
88
+ it "will send with_rename", skip: ENV.fetch("GITLAB", nil) do
87
89
  path = test_folder.join("with_rename_test.txt").to_s
88
90
  io = StringIO.new("I am a string via IO")
89
91
  file = Files::File.new({ path: path, with_rename: true }, options)
@@ -123,8 +125,8 @@ RSpec.describe Files::File, :with_test_folder, skip: ENV.fetch("GITLAB", nil) do
123
125
  end
124
126
 
125
127
  it "returns a directory type" do
126
- Files::Folder.mkdir("testdir", {}, options) unless Files::Folder.exist?("testdir", options)
127
- expect(Files::File.from_path("testdir", options).type).to eq("directory")
128
+ Files::Folder.mkdir(test_folder.join("testdir").to_s, {}, options)
129
+ expect(Files::File.from_path(test_folder.join("testdir").to_s, options).type).to eq("directory")
128
130
  end
129
131
  end
130
132
  end
@@ -1,28 +1,33 @@
1
1
  require "spec_helper"
2
2
 
3
3
  RSpec.describe Files::Folder, :with_test_folder do
4
- xdescribe "#list_for" do
4
+ describe "#list_for" do
5
+ # The shared fixture already makes test_folder/nested, so the listing gets a folder of its own.
6
+ let(:listed_folder) { test_folder.join("listed") }
7
+
5
8
  before do
6
- Files::File.open(test_folder.join("example.txt").to_s, 'w', options) do |f|
9
+ Files::Folder.mkdir(listed_folder.to_s, {}, options)
10
+
11
+ Files::File.open(listed_folder.join("example.txt").to_s, 'w', options) do |f|
7
12
  f.write("my text")
8
13
  end
9
14
 
10
- Files::Folder.mkdir(test_folder.join("other").to_s, {}, options)
15
+ Files::Folder.mkdir(listed_folder.join("other").to_s, {}, options)
11
16
 
12
- Files::File.open(test_folder.join("other/example2.txt").to_s, 'w', options) do |f|
17
+ Files::File.open(listed_folder.join("other/example2.txt").to_s, 'w', options) do |f|
13
18
  f.write("my text 2")
14
19
  end
15
20
  end
16
21
 
17
22
  it "lists from the root" do
18
- results = described_class.list_for(test_folder.to_s, {}, options)
23
+ results = described_class.list_for(listed_folder.to_s, {}, options)
19
24
 
20
- expect(results.map(&:path).to_a).to match_array([ test_folder.join("example.txt").to_s, test_folder.join("other").to_s ])
25
+ expect(results.map(&:path).to_a).to match_array([ listed_folder.join("example.txt").to_s, listed_folder.join("other").to_s ])
21
26
  expect(results.map(&:type).to_a).to match_array(%w[file directory])
22
27
  end
23
28
  end
24
29
 
25
- xdescribe "#delete" do
30
+ describe "#delete" do
26
31
  it "deletes a folder" do
27
32
  Files::Folder.mkdir(test_folder.join("my-new-folder").to_s, {}, options)
28
33
  Files::Folder.delete(test_folder.join("my-new-folder").to_s, {}, options)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: files.com
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.802
4
+ version: 1.1.803
5
5
  platform: ruby
6
6
  authors:
7
7
  - files.com