disk_cache 0.0.6 → 0.0.7
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.
- data/lib/disk_cache/version.rb +1 -1
- data/lib/disk_cache.rb +2 -1
- data/spec/disk_cache/disk_cache_spec.rb +10 -0
- metadata +1 -1
data/lib/disk_cache/version.rb
CHANGED
data/lib/disk_cache.rb
CHANGED
@@ -46,10 +46,14 @@ describe DiskCache do
|
|
46
46
|
|
47
47
|
context "sanity" do
|
48
48
|
let(:web) { 'http://example.com/Troll face.svg' }
|
49
|
+
let(:web_correct) { 'http://example.com/Troll%20face.svg' }
|
49
50
|
|
50
51
|
before(:each) do
|
51
52
|
stub_request(:get, "http://example.com/Troll face.svg").
|
52
53
|
to_return(body: File.read(path))
|
54
|
+
|
55
|
+
stub_request(:get, "http://example.com/Troll%20face.svg").
|
56
|
+
to_return(body: File.read(path))
|
53
57
|
end
|
54
58
|
|
55
59
|
it "should handle urls with spaces" do
|
@@ -57,5 +61,11 @@ describe DiskCache do
|
|
57
61
|
file_from_cache = DiskCache.get(web)
|
58
62
|
FileUtils.compare_file(path, file_from_cache).should be_true
|
59
63
|
end
|
64
|
+
|
65
|
+
it "should handle urls with escaped spaces" do
|
66
|
+
DiskCache.put(web_correct)
|
67
|
+
file_from_cache = DiskCache.get(web_correct)
|
68
|
+
FileUtils.compare_file(path, file_from_cache).should be_true
|
69
|
+
end
|
60
70
|
end
|
61
71
|
end
|